E5Gui/E5PathPicker.py

changeset 4589
b648ccbdbef9
parent 4581
76999ca7bbf1
child 4593
cc745fa6c914
--- a/E5Gui/E5PathPicker.py	Sun Nov 29 13:21:15 2015 +0100
+++ b/E5Gui/E5PathPicker.py	Sun Nov 29 14:33:38 2015 +0100
@@ -37,6 +37,7 @@
     SaveFileMode = 2
     DirectoryMode = 3
 
+# TODO: Refactor the classes using a base class with common functions
 
 class E5PathPicker(QWidget):
     """
@@ -87,6 +88,8 @@
         
         self.__button.clicked.connect(self.__showPathPickerDialog)
         self.__editor.textChanged.connect(self.textChanged)
+        
+        self.setFocusProxy(self.__editor)
     
     def setMode(self, mode):
         """
@@ -128,6 +131,24 @@
         """
         return self.__mode
     
+    def setPickerEnabled(self, enable):
+        """
+        Public method to set the enabled state of the file dialog button.
+        
+        @param enable flag indicating the enabled state
+        @type bool
+        """
+        self.__button.setEnabled(enable)
+    
+    def isPickerEnabled(self):
+        """
+        Public method to get the file dialog button enabled state.
+        
+        @return flag indicating the enabled state
+        @rtype bool
+        """
+        return self.__button.isEnabled()
+    
     def clear(self):
         """
         Public method to clear the current path.
@@ -442,6 +463,8 @@
         
         self.__button.clicked.connect(self.__showPathPickerDialog)
         self.__editor.editTextChanged.connect(self.editTextChanged)
+        
+        self.setFocusProxy(self.__editor)
     
     def setMode(self, mode):
         """
@@ -483,6 +506,24 @@
         """
         return self.__mode
     
+    def setPickerEnabled(self, enable):
+        """
+        Public method to set the enabled state of the file dialog button.
+        
+        @param enable flag indicating the enabled state
+        @type bool
+        """
+        self.__button.setEnabled(enable)
+    
+    def isPickerEnabled(self):
+        """
+        Public method to get the file dialog button enabled state.
+        
+        @return flag indicating the enabled state
+        @rtype bool
+        """
+        return self.__button.isEnabled()
+    
     def clear(self):
         """
         Public method to clear the list of paths.
@@ -725,6 +766,24 @@
         """
         return self.__editor.toolTip()
     
+    def setInsertPolicy(self, policy):
+        """
+        Public method to set the insertion policy of the combo box.
+        
+        @param policy insertion policy
+        @type QComboBox.InsertPolicy
+        """
+        self.__editor.setInsertPolicy(policy)
+    
+    def setSizeAdjustPolicy(self, policy):
+        """
+        Public method to set the size adjust policy of the combo box.
+        
+        @param policy size adjust policy
+        @type QComboBox.SizeAdjustPolicy
+        """
+        self.__editor.setSizeAdjustPolicy(policy)
+    
     def __showPathPickerDialog(self):
         """
         Private slot to show the path picker dialog.

eric ide

mercurial