def Save (self): """ Сохранить текущую страницу """ if self.__saveProcessing: return if self.__pageView != None: if not pageExists (Application.selectedPage.root): # Нет папки с деревом self.__saveProcessing = True MessageBox (_(u"Can't save page. Wiki folder not exists. Wiki will be closed."), _("Error"), wx.OK | wx.ICON_ERROR) self.__saveProcessing = False Application.wikiroot = None return if not pageExists (Application.selectedPage): # Похоже, страница удалена вручную, перезагрузим вики self.__saveProcessing = True MessageBox (_(u"Can't save page. Page folder not exists. Wiki will be reloaded."), _("Error"), wx.OK | wx.ICON_ERROR) self.__saveProcessing = False self.__reloadWiki() return self.__pageView.Save()
def Save(self): """ Сохранить текущую страницу """ if self.__saveProcessing: return if (self.__pageView is not None and self._application.selectedPage is not None): if not pageExists(self._application.selectedPage.root): # Нет папки с деревом self.__saveProcessing = True showError(self._application.mainWindow, _(u"Can't save page. Wiki folder not exists. Wiki will be closed.")) self.__saveProcessing = False self._application.wikiroot = None return if not pageExists(self._application.selectedPage): # Похоже, страница удалена вручную, перезагрузим вики self.__saveProcessing = True showError(self._application.mainWindow, _(u"Can't save page. Page folder not exists. Wiki will be reloaded.")) self.__saveProcessing = False try: self.__reloadWiki() except OSError: self._application.wikiroot = None return self.__pageView.Save()
def Save(self): """ Сохранить текущую страницу """ if self.__saveProcessing: return if self.__pageView is not None: if not pageExists(self._application.selectedPage.root): # Нет папки с деревом self.__saveProcessing = True showError(self._application.mainWindow, _(u"Can't save page. Wiki folder not exists. Wiki will be closed.")) self.__saveProcessing = False self._application.wikiroot = None return if not pageExists(self._application.selectedPage): # Похоже, страница удалена вручную, перезагрузим вики self.__saveProcessing = True showError(self._application.mainWindow, _(u"Can't save page. Page folder not exists. Wiki will be reloaded.")) self.__saveProcessing = False try: self.__reloadWiki() except OSError: self._application.wikiroot = None return self.__pageView.Save()
def Save(self): """ Сохранить текущую страницу """ if self.__saveProcessing: return if self.__pageView is not None: if not pageExists(Application.selectedPage.root): # Нет папки с деревом self.__saveProcessing = True MessageBox( _(u"Can't save page. Wiki folder not exists. Wiki will be closed." ), _("Error"), wx.OK | wx.ICON_ERROR) self.__saveProcessing = False Application.wikiroot = None return if not pageExists(Application.selectedPage): # Похоже, страница удалена вручную, перезагрузим вики self.__saveProcessing = True MessageBox( _(u"Can't save page. Page folder not exists. Wiki will be reloaded." ), _("Error"), wx.OK | wx.ICON_ERROR) self.__saveProcessing = False self.__reloadWiki() return self.__pageView.Save()
def editPage (parentWnd, currentPage): """ Вызвать диалог для редактирования страницы parentWnd - родительское окно currentPage - страница для редактирования """ if currentPage.readonly: raise outwiker.core.exceptions.ReadonlyException if not pageExists (currentPage): MessageBox (_(u'Page "%s" not found') % currentPage.display_title, _(u"Error"), wx.OK | wx.ICON_ERROR) return with EditPageDialog (parentWnd, currentPage) as dlg: if dlg.ShowModal() == wx.ID_OK: try: currentPage.display_title = dlg.pageTitle except EnvironmentError as e: MessageBox (_(u"Can't rename page\n") + unicode (e), _(u"Error"), wx.ICON_ERROR | wx.OK) if not dlg.setPageProperties (currentPage): return None
def editPage (parentWnd, currentPage): """ Вызвать диалог для редактирования страницы parentWnd - родительское окно currentPage - страница для редактирования """ if currentPage.readonly: raise outwiker.core.exceptions.ReadonlyException if not pageExists (currentPage): MessageBox (_(u'Page "%s" not found') % currentPage.title, _(u"Error"), wx.OK | wx.ICON_ERROR) return dlg = EditPageDialog (currentPage, currentPage.parent, parent = parentWnd) if dlg.ShowModal() == wx.ID_OK: currentPage.tags = dlg.tags currentPage.icon = dlg.icon try: currentPage.title = dlg.pageTitle except OSError as e: outwiker.core.commands.MessageBox (_(u"Can't rename page\n") + unicode (e), _(u"Error"), wx.ICON_ERROR | wx.OK) try: Style().setPageStyle (currentPage, dlg.style) except IOError as e: outwiker.core.commands.MessageBox (_(u"Can't change page style\n") + unicode (e), _(u"Error"), wx.ICON_ERROR | wx.OK) currentPage.root.selectedPage = currentPage dlg.Destroy()
def Save(self): """ Сохранить настройки страницы """ if (self.page is not None and not self.page.isRemoved and pageExists(self.page)): self.__saveSearchPhrase() self.__saveSearchTags() self.__saveSearchTagsStrategy() self.__saveSortStrategy()
def Save(self): """ Сохранить страницу """ if self.page is None: return if not pageExists(self.page): return if not self.page.isRemoved: self.checkForExternalEditAndSave()
def __onPageSelect (self, page): """ Событие при выборе страницы """ if page is not None and not pageExists (page): MessageBox (_(u"Can't open page. Page folder not exists"), _("Error"), wx.OK | wx.ICON_ERROR) Application.selectedPage = None return self.__updatePageView (page) self.__updatePageInfo (page) self.bookmarkButton.Enable (page is not None)
def Save (self): """ Сохранить страницу """ if self.page is None: return if not pageExists (self.page): return if not self.page.isRemoved: self.checkForExternalEditAndSave()
def __onPageSelect(self, page): """ Событие при выборе страницы """ if page is not None and not pageExists(page): showError(self._application.mainWindow, _(u"Can't open page. Page folder not exists")) self.__reloadWiki() return self.__updatePageView(page) self.__updatePageInfo(page) self.bookmarkButton.Enable(page is not None)
def __onPageSelect(self, page): """ Событие при выборе страницы """ if page is not None and not pageExists(page): MessageBox(_(u"Can't open page. Page folder not exists"), _("Error"), wx.OK | wx.ICON_ERROR) self.__reloadWiki() return self.__updatePageView(page) self.__updatePageInfo(page) self.bookmarkButton.Enable(page is not None)
def editPage(parentWnd, currentPage): """ Вызвать диалог для редактирования страницы parentWnd - родительское окно currentPage - страница для редактирования """ if currentPage.readonly: raise outwiker.core.exceptions.ReadonlyException if not pageExists(currentPage): showError(Application.mainWindow, _(u'Page "%s" not found') % currentPage.display_title) return with EditPageDialog(parentWnd, currentPage, Application) as dlg: if dlg.ShowModal() == wx.ID_OK: renamePage(currentPage, dlg.pageTitle) if not dlg.setPageProperties(currentPage): return None