From e8472e20679e2c9739a72f5224402174ba12493f Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Fri, 12 Aug 2005 14:53:09 +0000 Subject: [PATCH] on cancel works for context menu selection with keyboard reflects on sensitivity of the buttons --- src/dialogs.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/dialogs.py b/src/dialogs.py index fa0880c65..01b5639fb 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -1601,6 +1601,7 @@ class FileTransfersWindow: self.tree.append_column(col) self.set_images() self.tree.get_selection().set_mode(gtk.SELECTION_SINGLE) + self.tree.get_selection().connect('changed', self.selection_changed) self.tooltip = FileTransfersTooltip() self.xml.signal_autoconnect(self) popup_xml = gtk.glade.XML(GTKGUI_GLADE, 'file_transfers_menu', @@ -1984,6 +1985,15 @@ _('Connection with peer cannot be established.')).get_response() self.continue_menuitem.set_sensitive(False) return True + def selection_changed(self, args): + selection = args + selected = selection.get_selected_rows() + if selected[1] != []: + selected_path = selected[1][0] + self.select_func(selected_path) + else: + self.set_all_insensitive() + def select_func(self, path): is_selected = False selected = self.tree.get_selection().get_selected_rows() @@ -2202,7 +2212,7 @@ _('Connection with peer cannot be established.')).get_response() if os.path.exists(path) and os.path.isdir(path): helpers.launch_file_manager(path) - def on_stop_menuitem_activate(self, widget): + def on_cancel_menuitem_activate(self, widget): self.on_cancel_button_clicked(widget) def on_continue_menuitem_activate(self, widget):