Exemplo n.º 1
0
    def _validateCommon (self, parentPage, pageAlias):
        if not pageAlias and not testPageTitle (self.pageTitle):
            self._generalPanel.titleTextCtrl.SetFocus()
            self._generalPanel.titleTextCtrl.SetSelection (-1, -1)
            return False

        return True
Exemplo n.º 2
0
    def _validateCommon(self, parentPage, pageAlias):
        if not pageAlias and not testPageTitle(self.pageTitle):
            self._generalPanel.titleTextCtrl.SetFocus()
            self._generalPanel.titleTextCtrl.SetSelection(-1, -1)
            return False

        return True
Exemplo n.º 3
0
    def onOk (self, event):
        if not testPageTitle (self.pageTitle):
            self.generalPanel.titleTextCtrl.SetFocus()
            self.generalPanel.titleTextCtrl.SetSelection (-1, -1)
            return

        if not self.currentPage.canRename (self.pageTitle):
            outwiker.core.commands.MessageBox (_(u"Can't rename page when page with that title already exists"), 
                    _(u"Error"), 
                    wx.ICON_ERROR | wx.OK)
            return

        self.saveParams()
        event.Skip()
Exemplo n.º 4
0
    def onOk (self, event):
        if not testPageTitle (self.pageTitle):
            self.generalPanel.titleTextCtrl.SetFocus()
            self.generalPanel.titleTextCtrl.SetSelection (-1, -1)
            return

        if (self.parentPage != None and
                not RootWikiPage.testDublicate(self.parentPage, self.pageTitle)):
            outwiker.core.commands.MessageBox (_(u"A page with this title already exists"), _(u"Error"), wx.ICON_ERROR | wx.OK)
            return

        self.saveParams()
        self.lastCreatedPageType.value = self.selectedFactory.getTypeString()
        event.Skip()
Exemplo n.º 5
0
 def RenamePage(self, manual=False):
     config = PluginConfig(self._application.config)
     if config.autoRenameAllPages or manual:
         currentPage = self._application.selectedPage
         if currentPage is not None and not currentPage.content == "":
             text = currentPage.content.splitlines()[0]
             text = self.getValidName(text)
             if not text == "" and text != currentPage.title:
                 if testPageTitle(text) == True:
                     renamePage(currentPage, text)
     if config.autoSetFirstLine:
         currentPage = self._application.selectedPage
         if currentPage is not None and currentPage.content == "":
             currentPage.content = currentPage.title
Exemplo n.º 6
0
	def RenamePage (self, manual=False):
		config = PluginConfig (self._application.config)
		if config.autoRenameAllPages or manual:
			currentPage = self._application.selectedPage
			if currentPage is not None and not currentPage.content == "":
				text = currentPage.content.splitlines()[0]
				text = self.getValidName(text)
				if not text == "" and text != currentPage.title:
					if testPageTitle (text) == True:
						renamePage(currentPage, text)
		if config.autoSetFirstLine:
			currentPage = self._application.selectedPage
			if currentPage is not None and currentPage.content == "":
				currentPage.content = currentPage.title