Project/AddFileDialog.py

changeset 5986
1e78a1aa438b
parent 5969
584c21b6587a
child 6048
82ad8ec9548c
--- a/Project/AddFileDialog.py	Sun Nov 19 13:03:04 2017 +0100
+++ b/Project/AddFileDialog.py	Sun Nov 19 14:43:20 2017 +0100
@@ -19,7 +19,6 @@
 from .Ui_AddFileDialog import Ui_AddFileDialog
 
 
-# TODO: add fileTypeFilter 'protocol'
 class AddFileDialog(QDialog, Ui_AddFileDialog):
     """
     Class implementing a dialog to add a file to the project.
@@ -74,6 +73,7 @@
                 "FORMS": [],
                 "RESOURCES": [],
                 "INTERFACES": [],
+                "PROTOCOLS": [],
                 "TRANSLATIONS": [],
             }
             for pattern, filetype in list(self.filetypes.items()):
@@ -84,13 +84,15 @@
                 "Forms Files ({1});;"
                 "Resource Files ({2});;"
                 "Interface Files ({3});;"
-                "Translation Files ({4});;"
+                "Protocol Files ({4});;"
+                "Translation Files ({5});;"
                 "All Files (*)")\
                 .format(
                     " ".join(patterns["SOURCES"]),
                     " ".join(patterns["FORMS"]),
                     " ".join(patterns["RESOURCES"]),
                     " ".join(patterns["INTERFACES"]),
+                    " ".join(patterns["PROTOCOLS"]),
                     " ".join(patterns["TRANSLATIONS"]))
             caption = self.tr("Select Files")
         elif self.fileTypeFilter == 'form':
@@ -125,6 +127,14 @@
             dfilter = self.tr("Interface Files ({0})")\
                 .format(" ".join(patterns))
             caption = self.tr("Select interface files")
+        elif self.fileTypeFilter == 'protocol':
+            patterns = []
+            for pattern, filetype in list(self.filetypes.items()):
+                if filetype == "PROTOCOLS":
+                    patterns.append(pattern)
+            dfilter = self.tr("Protocol Files ({0})")\
+                .format(" ".join(patterns))
+            caption = self.tr("Select protocol files")
         elif self.fileTypeFilter == 'translation':
             patterns = []
             for pattern, filetype in list(self.filetypes.items()):

eric ide

mercurial