Mon, 03 Mar 2014 19:21:23 +0100
Added the encodings, eol and language menus to the respective status bar entries.
UI/UserInterface.py | file | annotate | diff | comparison | revisions | |
ViewManager/ViewManager.py | file | annotate | diff | comparison | revisions |
--- a/UI/UserInterface.py Sun Mar 02 16:46:20 2014 +0100 +++ b/UI/UserInterface.py Mon Mar 03 19:21:23 2014 +0100 @@ -32,6 +32,7 @@ from E5Gui.E5MainWindow import E5MainWindow from E5Gui.E5ZoomWidget import E5ZoomWidget from E5Gui.E5ProgressDialog import E5ProgressDialog +from E5Gui.E5ClickableLabel import E5ClickableLabel import Preferences import Utilities @@ -2705,21 +2706,21 @@ self.__statusBar = self.statusBar() self.__statusBar.setSizeGripEnabled(True) - self.sbLanguage = QLabel(self.__statusBar) + self.sbLanguage = E5ClickableLabel(self.__statusBar) self.__statusBar.addPermanentWidget(self.sbLanguage) self.sbLanguage.setWhatsThis(self.tr( """<p>This part of the status bar displays the""" """ current editors language.</p>""" )) - self.sbEncoding = QLabel(self.__statusBar) + self.sbEncoding = E5ClickableLabel(self.__statusBar) self.__statusBar.addPermanentWidget(self.sbEncoding) self.sbEncoding.setWhatsThis(self.tr( """<p>This part of the status bar displays the""" """ current editors encoding.</p>""" )) - self.sbEol = QLabel(self.__statusBar) + self.sbEol = E5ClickableLabel(self.__statusBar) self.__statusBar.addPermanentWidget(self.sbEol) self.sbEol.setWhatsThis(self.tr( """<p>This part of the status bar displays the"""
--- a/ViewManager/ViewManager.py Sun Mar 02 16:46:20 2014 +0100 +++ b/ViewManager/ViewManager.py Mon Mar 03 19:21:23 2014 +0100 @@ -266,6 +266,50 @@ self.sbZoom = sbZoom self.sbZoom.valueChanged.connect(self.__zoom) self.__setSbFile(zoom=0) + + self.sbLang.clicked.connect(self.__showLanguagesMenu) + self.sbEol.clicked.connect(self.__showEolMenu) + self.sbEnc.clicked.connect(self.__showEncodingsMenu) + + ################################################################## + ## Below are menu handling methods for status bar labels + ################################################################## + + def __showLanguagesMenu(self, pos): + """ + Private slot to show the Languages menu of the current editor. + + @param pos position the menu should be shown at (QPoint) + """ + aw = self.activeWindow() + if aw is not None: + menu = aw.getMenu("Languages") + if menu is not None: + menu.exec_(pos) + + def __showEolMenu(self, pos): + """ + Private slot to show the EOL menu of the current editor. + + @param pos position the menu should be shown at (QPoint) + """ + aw = self.activeWindow() + if aw is not None: + menu = aw.getMenu("Eol") + if menu is not None: + menu.exec_(pos) + + def __showEncodingsMenu(self, pos): + """ + Private slot to show the Encodings menu of the current editor. + + @param pos position the menu should be shown at (QPoint) + """ + aw = self.activeWindow() + if aw is not None: + menu = aw.getMenu("Encodings") + if menu is not None: + menu.exec_(pos) ########################################################################### ## methods below need to be implemented by a subclass