QScintilla/Lexers/__init__.py

changeset 740
9625b5817d1c
parent 428
58405c24aa09
child 788
5b1b59777460
--- a/QScintilla/Lexers/__init__.py	Sun Dec 05 18:14:56 2010 +0100
+++ b/QScintilla/Lexers/__init__.py	Tue Dec 07 08:45:48 2010 +0100
@@ -231,7 +231,7 @@
     else:
         return None
     
-def getOpenFileFiltersList(includeAll = False, asString = False):
+def getOpenFileFiltersList(includeAll = False, asString = False, withAdditional = True):
     """
     Module function to get the file filter list for an open file operation.
     
@@ -239,6 +239,8 @@
         All Files filter (boolean)
     @param asString flag indicating the list should be returned 
         as a string (boolean)
+    @keyparam withAdditional flag indicating to include additional filters
+        defined by the user (boolean)
     @return file filter list (list of strings or string)
     """
     openFileFiltersList = [
@@ -321,6 +323,9 @@
     for name in LexerRegistry:
         openFileFiltersList.append(LexerRegistry[name][3])
     
+    if withAdditional:
+        openFileFiltersList.extend(Preferences.getEditor("AdditionalOpenFilters"))
+    
     openFileFiltersList.sort()
     if includeAll:
         openFileFiltersList.append(QApplication.translate('Lexers', 'All Files (*)'))
@@ -330,7 +335,7 @@
     else:
         return openFileFiltersList
 
-def getSaveFileFiltersList(includeAll = False, asString = False):
+def getSaveFileFiltersList(includeAll = False, asString = False, withAdditional = True):
     """
     Module function to get the file filter list for a save file operation.
     
@@ -338,6 +343,8 @@
         All Files filter (boolean)
     @param asString flag indicating the list should be returned 
         as a string (boolean)
+    @keyparam withAdditional flag indicating to include additional filters
+        defined by the user (boolean)
     @return file filter list (list of strings or string)
     """
     saveFileFiltersList = [
@@ -444,6 +451,9 @@
     for name in LexerRegistry:
         saveFileFiltersList.append(LexerRegistry[name][4])
     
+    if withAdditional:
+        saveFileFiltersList.extend(Preferences.getEditor("AdditionalSaveFilters"))
+    
     saveFileFiltersList.sort()
     
     if includeAll:

eric ide

mercurial