diff options
Diffstat (limited to 'mat-gui')
| -rwxr-xr-x | mat-gui | 16 |
1 files changed, 15 insertions, 1 deletions
| @@ -73,6 +73,7 @@ class GUI: | |||
| 73 | self.treeview.set_search_column(1) # filename column is searchable | 73 | self.treeview.set_search_column(1) # filename column is searchable |
| 74 | self.treeview.set_rules_hint(True) # alternate colors for rows | 74 | self.treeview.set_rules_hint(True) # alternate colors for rows |
| 75 | self.treeview.set_rubber_banding(True) # mouse selection | 75 | self.treeview.set_rubber_banding(True) # mouse selection |
| 76 | self.treeview.connect("key_press_event", self.treeview_keyboard_event) | ||
| 76 | self.treeview.connect('row-activated', self.__popup_metadata) | 77 | self.treeview.connect('row-activated', self.__popup_metadata) |
| 77 | self.treeview.connect('drag_data_received', | 78 | self.treeview.connect('drag_data_received', |
| 78 | self.__on_drag_data_received) | 79 | self.__on_drag_data_received) |
| @@ -183,7 +184,7 @@ class GUI: | |||
| 183 | edit_menu = self.__create_sub_menu(_('Edit'), menubar) | 184 | edit_menu = self.__create_sub_menu(_('Edit'), menubar) |
| 184 | self.__create_menu_item(_('Clear the filelist'), | 185 | self.__create_menu_item(_('Clear the filelist'), |
| 185 | lambda x: self.liststore.clear(), edit_menu, gtk.STOCK_REMOVE, | 186 | lambda x: self.liststore.clear(), edit_menu, gtk.STOCK_REMOVE, |
| 186 | '<Control>L') | 187 | '') |
| 187 | self.__create_menu_item(_('Preferences'), self.__preferences, | 188 | self.__create_menu_item(_('Preferences'), self.__preferences, |
| 188 | edit_menu, gtk.STOCK_PREFERENCES, '<Control>P') | 189 | edit_menu, gtk.STOCK_PREFERENCES, '<Control>P') |
| 189 | 190 | ||
| @@ -218,6 +219,19 @@ class GUI: | |||
| 218 | 219 | ||
| 219 | return menubar | 220 | return menubar |
| 220 | 221 | ||
| 222 | |||
| 223 | def treeview_keyboard_event(self, widget, event): | ||
| 224 | ''' | ||
| 225 | Remove selected files from the treeview | ||
| 226 | when the use hit the 'suppr' key | ||
| 227 | ''' | ||
| 228 | if gtk.gdk.keyval_name(event.keyval) == "Delete": | ||
| 229 | rows = [] | ||
| 230 | model = self.liststore | ||
| 231 | self.selection.selected_foreach(lambda model, path, iter: rows.append(iter)) | ||
| 232 | [self.liststore.remove(i) for i in rows] | ||
| 233 | |||
| 234 | |||
| 221 | def __add_files(self, button): | 235 | def __add_files(self, button): |
| 222 | ''' | 236 | ''' |
| 223 | Add the files chosed by the filechoser ("Add" button) | 237 | Add the files chosed by the filechoser ("Add" button) |
