From bc64bed102bef8950e1ca00d10b37588eabf8363 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Thu, 14 Aug 2008 01:11:54 +0000 Subject: [PATCH] add 'edit' tracker to edit trackers dialog --- ChangeLog | 1 + deluge/ui/gtkui/edittrackersdialog.py | 28 +++- deluge/ui/gtkui/glade/edit_trackers.glade | 171 +++++++++++++++++++++- 3 files changed, 196 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa49e73d1..e9f149b01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,3 +6,4 @@ Deluge 1.1.0 - "" (In Development) GtkUI: * Add peer progress to the peers tab + * Add 'edit' to edit trackers dialog diff --git a/deluge/ui/gtkui/edittrackersdialog.py b/deluge/ui/gtkui/edittrackersdialog.py index 5a088c959..c89648ab6 100644 --- a/deluge/ui/gtkui/edittrackersdialog.py +++ b/deluge/ui/gtkui/edittrackersdialog.py @@ -50,6 +50,8 @@ class EditTrackersDialog: self.treeview = self.glade.get_widget("tracker_treeview") self.add_tracker_dialog = self.glade.get_widget("add_tracker_dialog") self.add_tracker_dialog.set_transient_for(self.dialog) + self.edit_tracker_entry = self.glade.get_widget("edit_tracker_entry") + self.edit_tracker_entry.set_transient_for(self.dialog) self.dialog.set_icon(deluge.common.get_logo(32)) @@ -60,6 +62,9 @@ class EditTrackersDialog: self.glade.signal_autoconnect({ "on_button_up_clicked": self.on_button_up_clicked, "on_button_add_clicked": self.on_button_add_clicked, + "on_button_edit_clicked": self.on_button_edit_clicked, + "on_button_edit_cancel_clicked": self.on_button_edit_cancel_clicked, + "on_button_edit_ok_clicked": self.on_button_edit_ok_clicked, "on_button_remove_clicked": self.on_button_remove_clicked, "on_button_down_clicked": self.on_button_down_clicked, "on_button_ok_clicked": self.on_button_ok_clicked, @@ -127,7 +132,28 @@ class EditTrackersDialog: selected = self.get_selected() if selected != None: self.liststore.remove(selected) - + + def on_button_edit_clicked(self, widget): + """edits an existing tracker""" + log.debug("on_button_edit_clicked") + selected = self.get_selected() + if selected: + tracker = self.liststore.get_value(selected, 1) + self.glade.get_widget("entry_edit_tracker").set_text(tracker) + self.edit_tracker_entry.show() + self.glade.get_widget("edit_tracker_entry").grab_focus() + + def on_button_edit_cancel_clicked(self, widget): + log.debug("on_button_edit_cancel_clicked") + self.edit_tracker_entry.hide() + + def on_button_edit_ok_clicked(self, widget): + log.debug("on_button_edit_ok_clicked") + selected = self.get_selected() + tracker = self.glade.get_widget("entry_edit_tracker").get_text() + self.liststore.set_value(selected, 1, tracker) + self.edit_tracker_entry.hide() + def on_button_down_clicked(self, widget): log.debug("on_button_down_clicked") selected = self.get_selected() diff --git a/deluge/ui/gtkui/glade/edit_trackers.glade b/deluge/ui/gtkui/glade/edit_trackers.glade index 9e6fc8f71..22e8e8c0f 100644 --- a/deluge/ui/gtkui/glade/edit_trackers.glade +++ b/deluge/ui/gtkui/glade/edit_trackers.glade @@ -1,8 +1,9 @@ - + + 400 GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 Edit Trackers @@ -113,6 +114,20 @@ 1 + + + True + True + True + gtk-edit + True + 0 + + + + 2 + + True @@ -125,7 +140,7 @@ - 2 + 3 @@ -140,7 +155,7 @@ - 3 + 4 @@ -202,6 +217,7 @@ + 400 GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 Add Tracker @@ -349,4 +365,153 @@ + + 400 + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + Edit Tracker + GTK_WIN_POS_CENTER_ON_PARENT + True + GDK_WINDOW_TYPE_HINT_DIALOG + False + False + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-edit + + + False + False + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + <b>Edit Tracker</b> + True + + + False + False + 1 + + + + + False + False + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + False + 1 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Tracker: + + + False + False + + + + + True + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + + + 1 + + + + + False + False + 2 + + + + + 1 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_BUTTONBOX_END + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-cancel + True + 0 + + + + + + True + True + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-ok + True + 0 + + + + 1 + + + + + False + GTK_PACK_END + + + + +