diff options
| author | jvoisin | 2015-12-19 20:15:38 +0100 |
|---|---|---|
| committer | jvoisin | 2015-12-19 20:15:38 +0100 |
| commit | 27746e4cd822cf80d467fdff40f3e7509a0d9af2 (patch) | |
| tree | 597d563b5fb13781186514144c2e1c18ec71af06 /mat-gui | |
| parent | 31e1037fb6cbc2ee68a7c10ba322922aafc0d5ae (diff) | |
The GUI proposes to add supported files only by default
Now, the popup to add files to the interface
only shows supported files by default. It's of course
still possible to chose to show every possible files,
but it's not the default behaviour anymore.
Diffstat (limited to 'mat-gui')
| -rwxr-xr-x | mat-gui | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -136,12 +136,6 @@ class GUI(object): | |||
| 136 | chooser.set_default_response(0) | 136 | chooser.set_default_response(0) |
| 137 | chooser.set_select_multiple(True) | 137 | chooser.set_select_multiple(True) |
| 138 | 138 | ||
| 139 | # filter that shows all files | ||
| 140 | all_filter = Gtk.FileFilter() | ||
| 141 | all_filter.set_name(_('All files')) | ||
| 142 | all_filter.add_pattern('*') | ||
| 143 | chooser.add_filter(all_filter) | ||
| 144 | |||
| 145 | # filter that shows only supported formats | 139 | # filter that shows only supported formats |
| 146 | supported_filter = Gtk.FileFilter() | 140 | supported_filter = Gtk.FileFilter() |
| 147 | supported_filter.set_name(_('Supported files')) | 141 | supported_filter.set_name(_('Supported files')) |
| @@ -149,6 +143,12 @@ class GUI(object): | |||
| 149 | supported_filter.add_mime_type(i) | 143 | supported_filter.add_mime_type(i) |
| 150 | chooser.add_filter(supported_filter) | 144 | chooser.add_filter(supported_filter) |
| 151 | 145 | ||
| 146 | # filter that shows all files | ||
| 147 | all_filter = Gtk.FileFilter() | ||
| 148 | all_filter.set_name(_('All files')) | ||
| 149 | all_filter.add_pattern('*') | ||
| 150 | chooser.add_filter(all_filter) | ||
| 151 | |||
| 152 | if not chooser.run(): # Gtk.STOCK_OK | 152 | if not chooser.run(): # Gtk.STOCK_OK |
| 153 | filenames = chooser.get_filenames() | 153 | filenames = chooser.get_filenames() |
| 154 | GLib.idle_add(self.populate(filenames).next) # asynchronous processing | 154 | GLib.idle_add(self.populate(filenames).next) # asynchronous processing |
