diff options
| author | jvoisin | 2011-09-22 18:50:18 +0200 |
|---|---|---|
| committer | jvoisin | 2011-09-22 18:50:18 +0200 |
| commit | 2a42a242e322fa1b8ec686f26a445a426b468d06 (patch) | |
| tree | 22df1cf5b87e75afc49472f98c2603fb0795c620 /mat-gui | |
| parent | 51145d73da291e52b626bdf6a55b4a047af688d1 (diff) | |
Cleanup
Diffstat (limited to 'mat-gui')
| -rwxr-xr-x | mat-gui | 21 |
1 files changed, 11 insertions, 10 deletions
| @@ -102,12 +102,14 @@ class GUI: | |||
| 102 | toolbutton = gtk.ToolButton(gtk.STOCK_PRINT_REPORT) | 102 | toolbutton = gtk.ToolButton(gtk.STOCK_PRINT_REPORT) |
| 103 | toolbutton.set_label(_('Clean (lossless)')) | 103 | toolbutton.set_label(_('Clean (lossless)')) |
| 104 | toolbutton.connect('clicked', self.process_files, self.mat_clean) | 104 | toolbutton.connect('clicked', self.process_files, self.mat_clean) |
| 105 | toolbutton.set_tooltip_text(_('Clean selected files without data loss')) | 105 | toolbutton.set_tooltip_text(_('Clean selected files without possible \ |
| 106 | data loss')) | ||
| 106 | toolbar.add(toolbutton) | 107 | toolbar.add(toolbutton) |
| 107 | 108 | ||
| 108 | toolbutton = gtk.ToolButton(gtk.STOCK_PRINT_WARNING) | 109 | toolbutton = gtk.ToolButton(gtk.STOCK_PRINT_WARNING) |
| 109 | toolbutton.set_label(_('Clean (strict)')) | 110 | toolbutton.set_label(_('Clean (strict)')) |
| 110 | toolbutton.connect('clicked', self.process_files, self.mat_clean_strict) | 111 | toolbutton.connect('clicked', self.process_files, |
| 112 | self.mat_clean_strict) | ||
| 111 | toolbutton.set_tooltip_text(_('Clean selected files with possible \ | 113 | toolbutton.set_tooltip_text(_('Clean selected files with possible \ |
| 112 | data loss, but clean more efficiently')) | 114 | data loss, but clean more efficiently')) |
| 113 | toolbar.add(toolbutton) | 115 | toolbar.add(toolbutton) |
| @@ -149,7 +151,7 @@ data loss, but clean more efficiently')) | |||
| 149 | Create a MenuItem() like Preferences, Quit, Add, Clean, ... | 151 | Create a MenuItem() like Preferences, Quit, Add, Clean, ... |
| 150 | ''' | 152 | ''' |
| 151 | item = gtk.ImageMenuItem() | 153 | item = gtk.ImageMenuItem() |
| 152 | if shortcut : | 154 | if shortcut: |
| 153 | key, mod = gtk.accelerator_parse(shortcut) | 155 | key, mod = gtk.accelerator_parse(shortcut) |
| 154 | item.add_accelerator('activate', self.accelerator, | 156 | item.add_accelerator('activate', self.accelerator, |
| 155 | key, mod, gtk.ACCEL_VISIBLE) | 157 | key, mod, gtk.ACCEL_VISIBLE) |
| @@ -224,10 +226,9 @@ data loss, but clean more efficiently')) | |||
| 224 | item.connect('activate', self.process_files, self.mat_check) | 226 | item.connect('activate', self.process_files, self.mat_check) |
| 225 | process_menu.append(item) | 227 | process_menu.append(item) |
| 226 | 228 | ||
| 227 | |||
| 228 | help_menu = self.create_sub_menu(_('Help'), menubar) | 229 | help_menu = self.create_sub_menu(_('Help'), menubar) |
| 229 | self.create_menu_item(_('Supported formats'), self.supported, help_menu, | 230 | self.create_menu_item(_('Supported formats'), self.supported, |
| 230 | gtk.STOCK_INFO, False) | 231 | help_menu, gtk.STOCK_INFO, False) |
| 231 | self.create_menu_item(_('About'), self.about, help_menu, | 232 | self.create_menu_item(_('About'), self.about, help_menu, |
| 232 | gtk.STOCK_ABOUT, False) | 233 | gtk.STOCK_ABOUT, False) |
| 233 | 234 | ||
| @@ -272,14 +273,14 @@ data loss, but clean more efficiently')) | |||
| 272 | for root, dirs, files in os.walk(filename): | 273 | for root, dirs, files in os.walk(filename): |
| 273 | for item in files: | 274 | for item in files: |
| 274 | path_to_file = os.path.join(root, item) | 275 | path_to_file = os.path.join(root, item) |
| 276 | |||
| 275 | if self.add_file_to_treeview(path_to_file): | 277 | if self.add_file_to_treeview(path_to_file): |
| 276 | not_supported.append(item) | 278 | not_supported.append(item) |
| 277 | else: # filename is a regular file | 279 | else: # filename is a regular file |
| 278 | if self.add_file_to_treeview(filename): | 280 | if self.add_file_to_treeview(filename): |
| 279 | not_supported.append(filename) | 281 | not_supported.append(filename) |
| 280 | yield True | 282 | yield True |
| 281 | #self.popup_non_supported(not_supported) | 283 | if not_supported: |
| 282 | if len(not_supported): | ||
| 283 | self.popup_non_supported(not_supported) | 284 | self.popup_non_supported(not_supported) |
| 284 | yield False | 285 | yield False |
| 285 | 286 | ||
| @@ -655,7 +656,7 @@ if __name__ == '__main__': | |||
| 655 | #Add files from command line | 656 | #Add files from command line |
| 656 | infiles = [arg for arg in sys.argv[1:] if os.path.exists(arg)] | 657 | infiles = [arg for arg in sys.argv[1:] if os.path.exists(arg)] |
| 657 | if infiles: | 658 | if infiles: |
| 658 | task = gui.populate(infiles) | 659 | task = gui.populate(infiles) |
| 659 | gobject.idle_add(task.next) | 660 | gobject.idle_add(task.next) |
| 660 | 661 | ||
| 661 | gtk.main() | 662 | gtk.main() |
