From 9e174166b8b6b1698aa7c8f25f2ab90a78a03d03 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 21 Nov 2008 10:11:36 +0000 Subject: [PATCH] Fix up the Label plugin's GTK dialogs to be more consistent --- .../label/label/data/label_options.glade | 418 +++++++++++------- .../plugins/label/label/gtkui/sidebar_menu.py | 12 +- 2 files changed, 276 insertions(+), 154 deletions(-) diff --git a/deluge/plugins/label/label/data/label_options.glade b/deluge/plugins/label/label/data/label_options.glade index 7bfb11230..f78c809b2 100644 --- a/deluge/plugins/label/label/data/label_options.glade +++ b/deluge/plugins/label/label/data/label_options.glade @@ -1,17 +1,61 @@ - + 5 Label Options - GTK_WIN_POS_CENTER_ON_PARENT + True + GTK_WIN_POS_MOUSE GDK_WINDOW_TYPE_HINT_DIALOG + True + False False True - 2 + 5 + + + True + 5 + + + True + gtk-preferences + + + False + False + + + + + True + 0 + <b>Label Options</b> + True + + + False + False + 1 + + + + + 1 + + + + + True + + + False + 2 + + True @@ -19,6 +63,7 @@ True + 2 0 GTK_SHADOW_NONE @@ -54,41 +99,103 @@ - + True - 2 - 4 - 5 - GTK_FILL + 3 + 4 + GTK_FILL - + True True -1 -1 9999 1 10 10 - True 1 2 - 3 - 4 + 1 + 2 - + True - 0 - Connections: + KiB/s - 3 - 4 + 2 + 3 + GTK_FILL + GTK_FILL + + + + + True + True + -1 -1 9999 1 10 10 + + + 1 + 2 + + + + + + + True + 0 + Upload Slots: + + + 2 + 3 + GTK_FILL + GTK_FILL + + + + + True + 0 + Upload Speed: + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + 0 + Download Speed: + True + + + GTK_FILL + GTK_FILL + + + + + True + KiB/s + + + 2 + 3 + 1 + 2 GTK_FILL GTK_FILL @@ -110,105 +217,43 @@ - - True - Kib/s - - - 2 - 3 - 1 - 2 - GTK_FILL - GTK_FILL - - - - + True 0 - Download Speed: - True + Connections: + 3 + 4 GTK_FILL GTK_FILL - - True - 0 - Upload Speed: - - - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - 0 - Upload Slots: - - - 2 - 3 - GTK_FILL - GTK_FILL - - - - + True True -1 -1 9999 1 10 10 + True 1 2 + 3 + 4 - + True - Kib/s - 2 - 3 - GTK_FILL - GTK_FILL - - - - - True - True - -1 -1 9999 1 10 10 - - - 1 2 - 1 - 2 - - - - - - - True - - - 3 - 4 - GTK_FILL + 4 + 5 + GTK_FILL @@ -242,6 +287,7 @@ True + 2 0 GTK_SHADOW_NONE @@ -269,29 +315,42 @@ - + True - 2 - 3 - 4 - GTK_FILL + 2 + 3 + 1 + 2 + GTK_FILL - + True True - 2 1 100 1 10 10 - 2 + Auto Managed + 0 + True + + + GTK_FILL + + + + + + True + True + Stop seed at ratio: + 0 + True - 1 - 2 1 2 - + GTK_FILL GTK_FILL @@ -311,43 +370,30 @@ - + True True - Stop seed at ratio: - 0 - True + 2 1 100 1 10 10 + 2 + 1 + 2 1 2 - GTK_FILL + GTK_FILL - + True - True - Auto Managed - 0 - True + 2 + 3 + 4 GTK_FILL - - - - - - True - - - 2 - 3 - 1 - 2 - GTK_FILL @@ -385,6 +431,7 @@ True + 2 0 GTK_SHADOW_NONE @@ -397,13 +444,15 @@ 3 2 - + True + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER 2 - 2 - 3 + 1 + 2 + GTK_FILL @@ -421,15 +470,13 @@ - + True - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER 2 - 1 - 2 - GTK_FILL + 2 + 3 @@ -467,6 +514,7 @@ True + 2 0 GTK_SHADOW_NONE @@ -477,13 +525,22 @@ True - + True True - tracker1.org + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + + + True + True + tracker1.org tracker2.com this doesn't do anything yet.. + + @@ -532,7 +589,7 @@ this doesn't do anything yet.. - 1 + 3 @@ -544,7 +601,7 @@ this doesn't do anything yet.. True True True - gtk-cancel + gtk-cancel True 0 @@ -555,7 +612,7 @@ this doesn't do anything yet.. True True True - gtk-ok + gtk-ok True 0 @@ -576,8 +633,11 @@ this doesn't do anything yet.. 5 Add Label - GTK_WIN_POS_CENTER_ON_PARENT + True + GTK_WIN_POS_MOUSE GDK_WINDOW_TYPE_HINT_DIALOG + True + False False @@ -587,24 +647,78 @@ this doesn't do anything yet.. True + 5 - + True - <b>Label name:</b> - True - - - - - True - True + 5 + + + True + gtk-add + + + False + False + + + + + True + <b>Add Label</b> + True + + + False + False + 1 + + + False + False + + + + + True + + + False 1 - + + True + 5 + + + True + Name: + + + False + False + + + + + True + True + True + + + 1 + + + + + False + False + 2 + @@ -620,7 +734,7 @@ this doesn't do anything yet.. True True True - gtk-cancel + gtk-cancel True 0 @@ -630,8 +744,10 @@ this doesn't do anything yet.. True True + True + True True - gtk-ok + gtk-ok True 0 diff --git a/deluge/plugins/label/label/gtkui/sidebar_menu.py b/deluge/plugins/label/label/gtkui/sidebar_menu.py index f007d5ace..41f91d5dc 100644 --- a/deluge/plugins/label/label/gtkui/sidebar_menu.py +++ b/deluge/plugins/label/label/gtkui/sidebar_menu.py @@ -92,7 +92,7 @@ class LabelSidebarMenu(object): aclient.label_remove(None, self.treeview.value) def on_options (self, event=None): - self.options_dialog.show(self.treeview.value, (200,250)) + self.options_dialog.show(self.treeview.value) def on_show(self, widget=None, data=None): "No Label:disable options/del" @@ -135,6 +135,8 @@ class AddDialog(object): def show(self): self.glade = gtk.glade.XML(get_resource("label_options.glade")) self.dialog = self.glade.get_widget("dlg_label_add") + self.dialog.set_transient_for(component.get("MainWindow").window) + self.glade.signal_autoconnect({ "on_add_ok":self.on_ok, "on_add_cancel":self.on_cancel, @@ -168,21 +170,25 @@ class OptionsDialog(object): def __init__(self): pass - def show(self, label , position): + def show(self, label): self.label = label self.glade = gtk.glade.XML(get_resource("label_options.glade")) self.dialog = self.glade.get_widget("dlg_label_options") + self.dialog.set_transient_for(component.get("MainWindow").window) self.glade.signal_autoconnect({ "on_options_ok":self.on_ok, "on_options_cancel":self.on_cancel, }) + # Show the label name in the header label + self.glade.get_widget("label_header").set_markup("Label Options: %s" % self.label) + for chk_id, group in self.sensitive_groups: chk = self.glade.get_widget(chk_id) chk.connect("toggled",self.apply_sensitivity) aclient.label_get_options(self.load_options, self.label) - self.dialog.move(*position) + self.dialog.run() def load_options(self, options):