ViewManager/ViewManager.py

changeset 3321
ad3a75d3d870
parent 3261
b8fee972444b
child 3345
071afe8be2a1
--- 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

eric ide

mercurial