QScintilla/Editor.py

branch
5_2_x
changeset 1979
091b85ca9105
parent 1931
0e67826e1991
child 1995
11f09fe72991
equal deleted inserted replaced
1967:a08e65c41bcf 1979:091b85ca9105
2566 2566
2567 if not path and self.fileName is not None: 2567 if not path and self.fileName is not None:
2568 path = os.path.dirname(self.fileName) 2568 path = os.path.dirname(self.fileName)
2569 if path is None: 2569 if path is None:
2570 path = "" 2570 path = ""
2571 defaultFilter = Preferences.getEditor("DefaultSaveFilter") 2571 if self.fileName:
2572 filterPattern = "(*{0})".format(os.path.splitext(self.fileName)[1])
2573 for filter in Lexers.getSaveFileFiltersList(True):
2574 if filterPattern in filter:
2575 defaultFilter = filter
2576 break
2577 else:
2578 defaultFilter = Preferences.getEditor("DefaultSaveFilter")
2579 else:
2580 defaultFilter = Preferences.getEditor("DefaultSaveFilter")
2572 fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( 2581 fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
2573 self, 2582 self,
2574 self.trUtf8("Save File"), 2583 self.trUtf8("Save File"),
2575 path, 2584 path,
2576 Lexers.getSaveFileFiltersList(True, True), 2585 Lexers.getSaveFileFiltersList(True, True),

eric ide

mercurial