示例#1
0
    def __init__(self, parent, application):
        super().__init__(parent)
        self.mainWindowConfig = MainWindowConfig(application.config)
        self._createGUI()

        self.LoadState()
        self.SetupScrolling()
示例#2
0
 def __init__(self, application):
     global _
     _ = get_()
     self._application = application
     self._snippetChanged = False
     self._dialog = EditSnippetsDialog(self._application.mainWindow)
     self._config = SnippetsConfig(self._application.config)
     self._mainWindowconfig = MainWindowConfig(self._application.config)
     self._dialog.SetClientSize(
         (self._config.editDialogWidth, self._config.editDialogHeight))
     self._dialog.SetBackgroundColour(
         self._mainWindowconfig.mainPanesBackgroundColor.value)
     self._bind()
示例#3
0
    def testTitle2 (self):
        conf = MainWindowConfig (Application.config)
        conf.titleFormat.value = u"{file} - {page} - OutWiker"

        self.assertEqual (self.wnd.GetTitle(), u"OutWiker")

        Application.wikiroot = self.wikiroot
        self.assertEqual (self.wnd.GetTitle(), u"{} -  - OutWiker".format (basename (self.path)))

        self.wikiroot.selectedPage = self.wikiroot[u"Страница 1"]
        self.assertEqual (self.wnd.GetTitle(), u"{} - Страница 1 - OutWiker".format (basename (self.path)))

        self.wikiroot.selectedPage = self.wikiroot[u"Страница 2/Страница 3"]
        self.assertEqual (self.wnd.GetTitle(), u"{} - Страница 3 - OutWiker".format (basename (self.path)))
示例#4
0
    def __init__(self, parent):
        super(type(self), self).__init__(parent)

        self.trayConfig = TrayConfig(Application.config)
        self.generalConfig = GeneralGuiConfig(Application.config)
        self.mainWindowConfig = MainWindowConfig(Application.config)
        self.i18nConfig = outwiker.core.i18n.I18nConfig(Application.config)

        self.MIN_AUTOSAVE_INTERVAL = 0
        self.MAX_AUTOSAVE_INTERVAL = 3600

        self.MIN_HISTORY_LENGTH = 0
        self.MAX_HISTORY_LENGTH = 30

        self.PAGE_TAB_COMBO_WIDTH = 200
        self.LANG_COMBO_WIDTH = 200

        self.pageTabChoises = [
           (_(u'Recent used'), GeneralGuiConfig.PAGE_TAB_RECENT),
           (_(u'Preview'), GeneralGuiConfig.PAGE_TAB_RESULT),
           (_(u'Edit'), GeneralGuiConfig.PAGE_TAB_CODE),
        ]

        # Номер элемента при выборе "Авто" в списке языков
        self.__autoIndex = 0

        self.__createTrayGui()
        self.__createMiscGui()
        self.__createAutosaveGui(self.generalConfig)
        self.__createHistoryGui(self.generalConfig)
        self.__createTitleFormatGui()
        self.__createDateTimeFormatGui(self.generalConfig)
        self.__createOpenPageTabGui()
        self.__createLanguageGui()

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_CHECKBOX,
                  self.onMinimizeToTray,
                  self.minimizeCheckBox)

        self.LoadState()
        self.updateCheckState()
        self._setScrolling()
示例#5
0
    def __init__(self, parent, application):
        super(GeneralPanel, self).__init__(parent)

        self.generalConfig = GeneralGuiConfig(application.config)
        self.mainWindowConfig = MainWindowConfig(application.config)
        self.i18nConfig = outwiker.core.i18n.I18nConfig(application.config)

        self.MIN_AUTOSAVE_INTERVAL = 0
        self.MAX_AUTOSAVE_INTERVAL = 3600

        self.MIN_HISTORY_LENGTH = 0
        self.MAX_HISTORY_LENGTH = 30

        self.MIN_ICON_HISTORY_LENGTH = 0
        self.MAX_ICON_HISTORY_LENGTH = 100

        self.PAGE_TAB_COMBO_WIDTH = 200
        self.LANG_COMBO_WIDTH = 200

        self.MIN_TOASTER_DELAY = 1
        self.MAX_TOASTER_DELAY = 600

        self.pageTabChoises = [
            (_(u'Recent used'), GeneralGuiConfig.PAGE_TAB_RECENT),
            (_(u'Preview'), GeneralGuiConfig.PAGE_TAB_RESULT),
            (_(u'Edit'), GeneralGuiConfig.PAGE_TAB_CODE),
        ]

        # Номер элемента при выборе "Авто" в списке языков
        self.__autoIndex = 0

        self.__createMiscGui()
        self.__createAutosaveGui(self.generalConfig)
        self.__createToasterDelayGui(self.generalConfig)
        self.__createHistoryGui(self.generalConfig)
        self.__createTemplatesGui(self.generalConfig)
        # self.__createPageTitleTemplateGui(self.generalConfig)
        self.__createOpenPageTabGui()
        self.__createLanguageGui()

        self.__set_properties()
        self.__do_layout()

        self.LoadState()
        self.SetupScrolling()
示例#6
0
    def testTitle_01(self):
        conf = MainWindowConfig(self.application.config)
        conf.titleFormat.value = "OutWiker - {page} - {file}"

        self.assertEqual(self.mainWindow.GetTitle(), "OutWiker")

        self.application.wikiroot = self.wikiroot
        self.assertEqual(
            self.mainWindow.GetTitle(),
            "OutWiker -  - {}".format(basename(self.wikiroot.path)))

        self.wikiroot.selectedPage = self.wikiroot["Страница 1"]
        self.assertEqual(
            self.mainWindow.GetTitle(),
            "OutWiker - Страница 1 - {}".format(basename(self.wikiroot.path)))

        self.wikiroot.selectedPage = self.wikiroot["Страница 2/Страница 3"]
        self.assertEqual(
            self.mainWindow.GetTitle(),
            "OutWiker - Страница 3 - {}".format(basename(self.wikiroot.path)))