Changeset 263 for branches/mbutscher/work/lib/pwiki/PersonalWikiFrame.py
- Timestamp:
- 03/20/11 13:12:05 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/mbutscher/work/lib/pwiki/PersonalWikiFrame.py
r250 r263 61 61 62 62 from . import AdditionalDialogs 63 64 63 65 64 … … 198 197 self.lastCursorPositionInPage = {} 199 198 self.wikiHistory = [] 200 self.findDlg = None # Stores find&replace dialog, if present 201 self.mainWwSearchDlg = None 202 self.wwSearchDlgs = [] # Stores wiki wide search dialogs and detached fast search frames 199 self.nonModalFindDlg = None # Stores find&replace dialog, if present 200 self.nonModalMainWwSearchDlg = None 201 self.nonModalWwSearchDlgs = [] # Stores wiki wide search dialogs and detached fast search frames 202 self.nonModalFileCleanupDlg = None # Stores file dialog FileCleanup.FileCleanupDialog 203 203 self.spellChkDlg = None # Stores spell check dialog, if present 204 204 self.printer = None # Stores Printer object (initialized on demand) … … 380 380 return 381 381 382 self.statusBar.SetStatusText( 383 uniToGui(_(u"Last wiki doesn't exist: %s") % wikiToOpen), 0) 382 # self.statusBar.SetStatusText( 383 # uniToGui(_(u"Last wiki doesn't exist: %s") % wikiToOpen), 0) 384 self.displayErrorMessage( 385 _(u"Wiki doesn't exist: %s") % wikiToOpen) 384 386 385 387 cmdLineAction.actionBeforeShow(self) … … 1166 1168 self.openWiki(filePath, wikiWordsToOpen=(wikiWordToOpen,), 1167 1169 anchorToOpen=anchorToOpen) 1170 else: 1171 self.displayErrorMessage( 1172 _(u"Wiki doesn't exist: %s") % wikiToOpen) 1168 1173 else: 1169 1174 self.openWiki(os.path.abspath(entry.value)) … … 1237 1242 1238 1243 self.insertAttribute("color", self.cmdIdToColorNameForAttribute[evt.GetId()]) 1244 1245 1246 def resetCommanding(self): 1247 """ 1248 Reset the "commanding" (meaning menus, toolbar(s), shortcuts) 1249 """ 1250 self.buildMainMenu() 1251 1252 # Update toolbar by recreating 1253 if self.getShowToolbar(): 1254 with WindowUpdateLocker(self): 1255 self.setShowToolbar(False) 1256 self.setShowToolbar(True) 1239 1257 1240 1258 … … 1899 1917 # wx.EVT_MENU(self, menuID, lambda evt: OsAbstract.startFile(self, 1900 1918 # os.path.join(self.wikiAppDir, u'license.txt'))) 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1919 1920 1920 … … 2930 2930 of the corresponding wiki word to open 2931 2931 """ 2932 2933 2932 # Fix special case 2934 2933 if wikiWordsToOpen == (None,): … … 2948 2947 2949 2948 if cfgPath is None: 2950 self.displayErrorMessage(_(u"In valid path or missing file '%s'")2949 self.displayErrorMessage(_(u"Inaccessible or missing file: %s") 2951 2950 % wikiCombinedFilename) 2952 2951 … … 3053 3052 except (BadConfigurationFileException, 3054 3053 MissingConfigurationFileException), e: 3055 self.displayErrorMessage(_(u"Configuration file '%s' is corrupted or " 3056 u"missing.\nYou may have to change some settings in configuration " 3057 u'page "Current Wiki" and below which were lost.') % cfgPath) 3054 answer = wx.MessageBox(_(u"Configuration file '%s' is corrupted " 3055 u"or missing.\nYou may have to change some settings " 3056 u'in configuration page "Current Wiki" and below which ' 3057 u"were lost.") % cfgPath, _(u'Continue?'), 3058 wx.OK | wx.CANCEL | wx.ICON_QUESTION, self) 3059 if answer == wx.CANCEL: 3060 return False 3061 3058 3062 wdhName = self._askForDbType() 3059 3063 if wdhName is None: … … 3147 3151 with WindowUpdateLocker(self): 3148 3152 # reset the gui 3149 self. buildMainMenu()3153 self.resetCommanding() 3150 3154 3151 3155 # enable the top level menus … … 3732 3736 3733 3737 3734 def makeRelUrlAbsolute(self, relurl ):3738 def makeRelUrlAbsolute(self, relurl, addSafe=''): 3735 3739 """ 3736 3740 Return the absolute file: URL for a rel: URL 3737 3741 TODO: Remove 3738 3742 """ 3739 return self.getWikiDocument().makeRelUrlAbsolute(relurl) 3740 3741 3742 def makeAbsPathRelUrl(self, absPath): 3743 import warnings 3744 warnings.warn("PersonalWikiFrame.makeRelUrlAbsolute() deprecated, use " 3745 "WikiDocument.makeRelUrlAbsolute()", DeprecationWarning) 3746 3747 return self.getWikiDocument().makeRelUrlAbsolute(relurl, addSafe=addSafe) 3748 3749 3750 def makeAbsPathRelUrl(self, absPath, addSafe=''): 3743 3751 """ 3744 3752 Return the rel: URL for an absolute file path or None if … … 3746 3754 TODO: Remove 3747 3755 """ 3748 return self.getWikiDocument().makeAbsPathRelUrl(absPath) 3756 import warnings 3757 warnings.warn("PersonalWikiFrame.makeAbsPathRelUrl() deprecated, use " 3758 "WikiDocument.makeAbsPathRelUrl()", DeprecationWarning) 3759 3760 return self.getWikiDocument().makeAbsPathRelUrl(absPath, addSafe=addSafe) 3749 3761 3750 3762 … … 4271 4283 from .SearchAndReplaceDialogs import SearchWikiDialog 4272 4284 4273 if self. mainWwSearchDlg != None:4274 if isinstance(self. mainWwSearchDlg, SearchWikiDialog):4275 self. mainWwSearchDlg.SetFocus()4276 return 4277 4278 self. mainWwSearchDlg = SearchWikiDialog(self, self, -1,4285 if self.nonModalMainWwSearchDlg != None: 4286 if isinstance(self.nonModalMainWwSearchDlg, SearchWikiDialog): 4287 self.nonModalMainWwSearchDlg.SetFocus() 4288 return 4289 4290 self.nonModalMainWwSearchDlg = SearchWikiDialog(self, self, -1, 4279 4291 allowOkCancel=False, allowOrdering=False) 4280 self. mainWwSearchDlg.CenterOnParent(wx.BOTH)4281 self. mainWwSearchDlg.Show()4292 self.nonModalMainWwSearchDlg.CenterOnParent(wx.BOTH) 4293 self.nonModalMainWwSearchDlg.Show() 4282 4294 4283 4295 … … 4336 4348 from .SearchAndReplaceDialogs import SearchPageDialog 4337 4349 4338 if self. findDlg != None:4339 if isinstance(self. findDlg, SearchPageDialog):4340 self. findDlg.SetFocus()4341 return 4342 4343 self. findDlg = SearchPageDialog(self, -1)4344 self. findDlg.CenterOnParent(wx.BOTH)4345 self. findDlg.Show()4350 if self.nonModalFindDlg != None: 4351 if isinstance(self.nonModalFindDlg, SearchPageDialog): 4352 self.nonModalFindDlg.SetFocus() 4353 return 4354 4355 self.nonModalFindDlg = SearchPageDialog(self, -1) 4356 self.nonModalFindDlg.CenterOnParent(wx.BOTH) 4357 self.nonModalFindDlg.Show() 4346 4358 4347 4359
