Continued implementing user defined file filters.

Wed, 08 Dec 2010 20:01:04 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 08 Dec 2010 20:01:04 +0100
changeset 743
c58faf72e308
parent 742
30fc855257e9
child 744
2b850514083b

Continued implementing user defined file filters.

Preferences/ConfigurationPages/EditorFilePage.py file | annotate | diff | comparison | revisions
--- a/Preferences/ConfigurationPages/EditorFilePage.py	Tue Dec 07 20:10:13 2010 +0100
+++ b/Preferences/ConfigurationPages/EditorFilePage.py	Wed Dec 08 20:01:04 2010 +0100
@@ -133,11 +133,13 @@
             QScintilla.Lexers.getOpenFileFiltersList(False, withAdditional = False) + \
             self.openFileFilters
         openFileFiltersList.sort()
+        self.openFilesFilterComboBox.clear()
         self.openFilesFilterComboBox.addItems(openFileFiltersList)
         saveFileFiltersList = \
             QScintilla.Lexers.getSaveFileFiltersList(False, withAdditional = False) + \
             self.saveFileFilters
         saveFileFiltersList.sort()
+        self.saveFilesFilterComboBox.clear()
         self.saveFilesFilterComboBox.addItems(saveFileFiltersList)
         
         if keepSelection:
@@ -203,18 +205,29 @@
     @pyqtSlot()
     def on_editFileFilterButton_clicked(self):
         """
-        Slot documentation goes here.
+        Private slot called to edit a file filter entry.
         """
-        # TODO: not implemented yet
-        raise NotImplementedError
+        filter = self.fileFiltersList.currentItem().text()
+        filter, ok = QInputDialog.getText(
+            self,
+            self.trUtf8("Add File Filter"),
+            self.trUtf8("Enter the file filter entry:"),
+            QLineEdit.Normal, 
+            filter)
+        if ok and filter:
+            if self.__checkFileFilter(filter):
+                self.fileFiltersList.currentItem().setText(filter)
+                self.__extractFileFilters()
+                self.__setDefaultFiltersLists(keepSelection = True)
     
     @pyqtSlot()
     def on_deleteFileFilterButton_clicked(self):
         """
-        Slot documentation goes here.
+        Private slot called to delete a file filter entry.
         """
-        # TODO: not implemented yet
-        raise NotImplementedError
+        self.fileFiltersList.takeItem(self.fileFiltersList.currentRow())
+        self.__extractFileFilters()
+        self.__setDefaultFiltersLists(keepSelection = True)
     
     @pyqtSlot(bool)
     def on_openFiltersButton_toggled(self, checked):

eric ide

mercurial