Ignore:
Timestamp:
Mar 20, 2011 1:12:05 PM (6 years ago)
Author:
mbutscher
Message:

branches/stable-2.1:

  • Support for URL appendix "prnr" to create a relative link which is not relocated (modified) when exported as HTML to a different destination (backported to 2.1 to provide some backward compatibility to old behavior)
  • Bug fixed: Favorite wiki icons may open wrong wiki
  • Bug fixed: Misleading error message and bad error handling for corrupted wiki config file
  • Internal: Default maximum length of compatible filename reduced from 250 to 120

branches/mbutscher/work:

  • Less jumping around of selection in doc structure window when adding text (thanks to Christian Ziemski)
  • Support for spaces in bracketed URLs
  • Option to control type of URL (bracketed or not) on drag&drop
  • Support for URL appendix "prnr" to create a relative link which is not relocated (modified) when exported as HTML to a different destination
  • Option to sort list in "Open Wiki Word" dialog in reverse alphabetical order
  • Shortcuts introduced to move one or more selected logical lines one line up or down
  • Bug fixed: Favorite wiki icons may open wrong wiki
  • Bug fixed: Misleading error message and bad error handling for corrupted wiki config file
  • Internal: Deprecated makeRelUrlAbsolute() and makeAbsPathRelUrl() in PersonalWikiFrame?, call functions in WikiDocument? instead
  • Internal: Default maximum length of compatible filename reduced from 250 to 120
  • File cleanup now in usable state (orphaned files complete, missing files need work yet)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mbutscher/work/lib/pwiki/PersonalWikiFrame.py

    r250 r263  
    6161
    6262from . import AdditionalDialogs
    63 
    6463
    6564
     
    198197        self.lastCursorPositionInPage = {}
    199198        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
    203203        self.spellChkDlg = None  # Stores spell check dialog, if present
    204204        self.printer = None  # Stores Printer object (initialized on demand)
     
    380380                    return
    381381
    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)
    384386
    385387        cmdLineAction.actionBeforeShow(self)
     
    11661168                        self.openWiki(filePath, wikiWordsToOpen=(wikiWordToOpen,),
    11671169                                anchorToOpen=anchorToOpen)
     1170                    else:
     1171                        self.displayErrorMessage(
     1172                                _(u"Wiki doesn't exist: %s") % wikiToOpen)
    11681173                else:
    11691174                    self.openWiki(os.path.abspath(entry.value))
     
    12371242
    12381243        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)
    12391257
    12401258
     
    18991917#         wx.EVT_MENU(self, menuID, lambda evt: OsAbstract.startFile(self,
    19001918#                 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 
    19191919
    19201920
     
    29302930                of the corresponding wiki word to open
    29312931        """
    2932 
    29332932        # Fix special case
    29342933        if wikiWordsToOpen == (None,):
     
    29482947
    29492948        if cfgPath is None:
    2950             self.displayErrorMessage(_(u"Invalid path or missing file '%s'")
     2949            self.displayErrorMessage(_(u"Inaccessible or missing file: %s")
    29512950                        % wikiCombinedFilename)
    29522951
     
    30533052            except (BadConfigurationFileException,
    30543053                    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
    30583062                wdhName = self._askForDbType()
    30593063                if wdhName is None:
     
    31473151            with WindowUpdateLocker(self):
    31483152                # reset the gui
    3149                 self.buildMainMenu()
     3153                self.resetCommanding()
    31503154
    31513155                # enable the top level menus
     
    37323736
    37333737
    3734     def makeRelUrlAbsolute(self, relurl):
     3738    def makeRelUrlAbsolute(self, relurl, addSafe=''):
    37353739        """
    37363740        Return the absolute file: URL for a rel: URL
    37373741        TODO: Remove
    37383742        """
    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=''):
    37433751        """
    37443752        Return the rel: URL for an absolute file path or None if
     
    37463754        TODO: Remove
    37473755        """
    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)
    37493761
    37503762
     
    42714283        from .SearchAndReplaceDialogs import SearchWikiDialog
    42724284
    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,
    42794291                allowOkCancel=False, allowOrdering=False)
    4280         self.mainWwSearchDlg.CenterOnParent(wx.BOTH)
    4281         self.mainWwSearchDlg.Show()
     4292        self.nonModalMainWwSearchDlg.CenterOnParent(wx.BOTH)
     4293        self.nonModalMainWwSearchDlg.Show()
    42824294
    42834295
     
    43364348        from .SearchAndReplaceDialogs import SearchPageDialog
    43374349
    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()
    43464358
    43474359
Note: See TracChangeset for help on using the changeset viewer.