def __appendReplaceMessage(self):
        """Appends a proper message to the status bar after replace"""
        mainWindow = GlobalData().mainWindow
        currentMessage = mainWindow.getCurrentStatusBarMessage()
        currentIndex, totalMatches = self.__editor.getMatchesInfo()
        if totalMatches is None or totalMatches == 0:
            msg = currentMessage + '; no more matches'
        else:
            if currentIndex is not None:
                msg = currentMessage + '; match %d of %d' % (currentIndex,
                                                             totalMatches)
            else:
                if totalMatches == 1:
                    msg = currentMessage + '; 1 match left'
                else:
                    msg = currentMessage + '; %d matches left' % totalMatches
            if totalMatches > Settings()['maxHighlightedMatches']:
                msg += ' (too many to highlight)'

        mainWindow.showStatusBarMessage(msg)
Exemple #2
0
 def __showStatusBarMessage(msg):
     """Shows a main window status bar message"""
     mainWindow = GlobalData().mainWindow
     mainWindow.showStatusBarMessage(msg, 8000)