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
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
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()
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()
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
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