From 2ca1a61f32dc9ef77f9d56970a86b6250f6f6513 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Sat, 26 Jul 2008 22:03:15 +0000 Subject: [PATCH] more notification work - still not finished --- .../ui/gtkui/glade/preferences_dialog.glade | 1003 ++++++++--------- deluge/ui/gtkui/gtkui.py | 11 + deluge/ui/gtkui/preferences.py | 58 +- 3 files changed, 567 insertions(+), 505 deletions(-) diff --git a/deluge/ui/gtkui/glade/preferences_dialog.glade b/deluge/ui/gtkui/glade/preferences_dialog.glade index 74979e1bd..9bce6876d 100644 --- a/deluge/ui/gtkui/glade/preferences_dialog.glade +++ b/deluge/ui/gtkui/glade/preferences_dialog.glade @@ -1,7 +1,6 @@ - - - + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 @@ -562,8 +561,8 @@ page 6 - tab False + tab @@ -1098,9 +1097,9 @@ Disabled page 7 - tab 1 False + tab @@ -1166,127 +1165,40 @@ Disabled 2 15 - + True True + The maximum upload slots for all torrents. Set -1 for unlimited. 1 - -1 -1 9999 1 10 10 + -1 -1 9000 1 10 10 + 1 + True True 1 2 - 5 - 6 - GTK_FILL - - - - - True - True - 1 - -1 -1 9999 1 10 10 - True - - - 1 - 2 - 4 - 5 - GTK_FILL - - - - - True - 0 - Maximum Connection Attempts per Second: - - - 5 - 6 - GTK_FILL - - - - - True - 0 - Maximum Half-Open Connections: - - - 4 - 5 - GTK_FILL - - - - - True - The maximum upload speed for all torrents. Set -1 for unlimited. - 0 - Maximum Upload Speed (KiB/s): - - - 3 - 4 - GTK_FILL - - - - - True - The maximum number of connections allowed. Set -1 for unlimited. - 0 - Maximum Connections: - - - GTK_FILL - - - - - True - The maximum upload speed for all torrents. Set -1 for unlimited. - 0 - Maximum Upload Slots: - - 1 2 GTK_FILL - + True True - The maximum number of connections allowed. Set -1 for unlimited. - 4 + The maximum upload speed for all torrents. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 1 - True + 1 True - GTK_UPDATE_IF_VALID 1 2 - GTK_FILL - - - - - True - The maximum download speed for all torrents. Set -1 for unlimited. - 0 - Maximum Download Speed (KiB/s): - - - 2 - 3 + 3 + 4 GTK_FILL @@ -1311,40 +1223,127 @@ Disabled - + + True + The maximum download speed for all torrents. Set -1 for unlimited. + 0 + Maximum Download Speed (KiB/s): + + + 2 + 3 + GTK_FILL + + + + True True - The maximum upload speed for all torrents. Set -1 for unlimited. + The maximum number of connections allowed. Set -1 for unlimited. + 4 1 -1 -1 9000 1 10 10 1 - 1 + True True + GTK_UPDATE_IF_VALID 1 2 + GTK_FILL + + + + + True + The maximum upload speed for all torrents. Set -1 for unlimited. + 0 + Maximum Upload Slots: + + + 1 + 2 + GTK_FILL + + + + + True + The maximum number of connections allowed. Set -1 for unlimited. + 0 + Maximum Connections: + + + GTK_FILL + + + + + True + The maximum upload speed for all torrents. Set -1 for unlimited. + 0 + Maximum Upload Speed (KiB/s): + + 3 4 GTK_FILL - + + True + 0 + Maximum Half-Open Connections: + + + 4 + 5 + GTK_FILL + + + + + True + 0 + Maximum Connection Attempts per Second: + + + 5 + 6 + GTK_FILL + + + + True True - The maximum upload slots for all torrents. Set -1 for unlimited. 1 - -1 -1 9000 1 10 10 - 1 - True + -1 -1 9999 1 10 10 True 1 2 - 1 - 2 + 4 + 5 + GTK_FILL + + + + + True + True + 1 + -1 -1 9999 1 10 10 + True + + + 1 + 2 + 5 + 6 GTK_FILL @@ -1412,85 +1411,18 @@ Disabled 2 15 - - True - True - The maximum upload slots per torrent. Set -1 for unlimited. - 1 - -1 -1 9000 1 10 10 - 1 - True - True - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - + True True The maximum number of connections per torrent. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 - True + 1 True 1 2 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Maximum Connections: - - - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Maximum Upload Slots: - - - 1 - 2 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Maximum Download Speed (KiB/s): - - - 2 - 3 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Maximum Upload Speed (KiB/s): - - 3 4 GTK_FILL @@ -1515,20 +1447,87 @@ Disabled - + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Maximum Upload Speed (KiB/s): + + + 3 + 4 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Maximum Download Speed (KiB/s): + + + 2 + 3 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Maximum Upload Slots: + + + 1 + 2 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Maximum Connections: + + + GTK_FILL + + + + True True The maximum number of connections per torrent. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 - 1 + True True 1 2 - 3 - 4 + GTK_FILL + + + + + True + True + The maximum upload slots per torrent. Set -1 for unlimited. + 1 + -1 -1 9000 1 10 10 + 1 + True + True + + + 1 + 2 + 1 + 2 GTK_FILL @@ -1570,9 +1569,9 @@ Disabled page 8 - tab 2 False + tab @@ -1821,9 +1820,9 @@ Disabled page 10 - tab 3 False + tab @@ -2042,9 +2041,9 @@ Disabled page 11 - tab 4 False + tab @@ -2236,9 +2235,9 @@ Disabled page 11 - tab 5 False + tab @@ -2357,59 +2356,15 @@ Disabled 2 10 - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 0 -1 9999 1 10 10 - True - True - - - 1 - 2 - - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 0 -1 9999 1 10 10 - True - True - - - 1 - 2 - 2 - 3 - - - - - - True - 0 - Total active seeding: - - - 2 - 3 - GTK_FILL - - - - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - Total active: + Total active downloading: + 1 + 2 GTK_FILL @@ -2432,18 +2387,62 @@ Disabled - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - Total active downloading: + Total active: - 1 - 2 GTK_FILL + + + True + 0 + Total active seeding: + + + 2 + 3 + GTK_FILL + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 + 0 -1 9999 1 10 10 + True + True + + + 1 + 2 + 2 + 3 + + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 + 0 -1 9999 1 10 10 + True + True + + + 1 + 2 + + + @@ -2504,51 +2503,18 @@ Disabled 2 10 - - True - 0 - Share Ratio Limit: - - - GTK_FILL - - - - - True - 0 - Seed Time Ratio: - - - 1 - 2 - GTK_FILL - - - - - True - 0 - Seed Time (m): - - - 2 - 3 - GTK_FILL - - - - + True True 6 1 - 1.5 -1 100 0.10000000000000001 10 10 - 2 + 6 -1 100 1 10 10 1 2 + 2 + 3 @@ -2570,19 +2536,52 @@ Disabled - + True True 6 1 - 6 -1 100 1 10 10 + 1.5 -1 100 0.10000000000000001 10 10 + 2 1 2 + + + + + + True + 0 + Seed Time (m): + + 2 3 - + GTK_FILL + + + + + True + 0 + Seed Time Ratio: + + + 1 + 2 + GTK_FILL + + + + + True + 0 + Share Ratio Limit: + + + GTK_FILL @@ -2695,9 +2694,9 @@ Disabled page 12 - tab 6 False + tab @@ -2757,43 +2756,86 @@ Disabled 2 5 - + True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + 0 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 0 65000 1 10 10 + True + + 1 2 + 4 + 5 + + + + + True + 0 + Port: + + + 4 + 5 + GTK_FILL + + + + + True + 0 + Host: + + 3 4 + GTK_FILL - + True - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False + 0 + Password: - 1 - 2 2 3 + GTK_FILL - + True - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Username: - 1 - 2 1 2 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Type: + + + GTK_FILL @@ -2814,86 +2856,43 @@ HTTP W/ Auth - + True + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Type: - - - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Username: - - - 1 - 2 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Password: - - - 2 - 3 - GTK_FILL - - - - - True - 0 - Host: - - - 3 - 4 - GTK_FILL - - - - - True - 0 - Port: - - - 4 - 5 - GTK_FILL - - - - - True - 0 - 0 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 0 65000 1 10 10 - True - - 1 2 - 4 - 5 + 1 + 2 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + + + 1 + 2 + 2 + 3 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + 2 + 3 + 4 @@ -2994,22 +2993,32 @@ HTTP W/ Auth 2 5 - + + True + + + 1 + 2 + 2 + 3 + + + + True True - Sound: + Blinking tray icon True 0 True - 2 - 3 + 2 GTK_FILL - + True True Popup @@ -3025,28 +3034,18 @@ HTTP W/ Auth - + True True - Blinking tray icon + Sound: True 0 True - 2 - GTK_FILL - - - - - True - - - 1 - 2 2 3 + GTK_FILL @@ -3087,14 +3086,115 @@ HTTP W/ Auth 2 5 - + True - 0 - Security: + True + Enable + 0 + True - 5 - 6 + 2 + GTK_FILL + GTK_FILL + + + + + True + True + + + 1 + 2 + 1 + 2 + + + + + True + 0 + Address: + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + True + + + 1 + 2 + 2 + 3 + + + + + True + 0 + Server: + + + 2 + 3 + GTK_FILL + GTK_FILL + + + + + True + True + + + 1 + 2 + 3 + 4 + + + + + True + 0 + Username: + + + 3 + 4 + GTK_FILL + + + + + True + True + False + + + 1 + 2 + 4 + 5 + + + + + True + 0 + Password: + + + 4 + 5 GTK_FILL @@ -3103,14 +3203,14 @@ HTTP W/ Auth True 5 - + True True None 0 True True - rad_ssl + rad_ntf_ssl False @@ -3118,13 +3218,13 @@ HTTP W/ Auth - + True True SSL 0 True - rad_tls + rad_ntf_tls False @@ -3133,13 +3233,13 @@ HTTP W/ Auth - + True True TLS 0 True - rad_ssl + rad_ntf_ssl False @@ -3157,118 +3257,17 @@ HTTP W/ Auth - + True 0 - Password: + Security: - 4 - 5 + 5 + 6 GTK_FILL - - - True - True - False - - - 1 - 2 - 4 - 5 - - - - - True - 0 - Username: - - - 3 - 4 - GTK_FILL - - - - - True - True - - - 1 - 2 - 3 - 4 - - - - - True - 0 - Server: - - - 2 - 3 - GTK_FILL - GTK_FILL - - - - - True - True - - - 1 - 2 - 2 - 3 - - - - - True - 0 - Address: - - - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - True - - - 1 - 2 - 1 - 2 - - - - - True - True - Enable - 0 - True - - - 2 - GTK_FILL - GTK_FILL - - diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index cf78d9fd8..1cc906670 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -98,6 +98,17 @@ DEFAULT_PREFS = { "choose_directory_dialog_path": deluge.common.get_default_download_dir(), "show_new_releases": True, "signal_port": 40000, + "ntf_tray_blink": True, + "ntf_sound": False, + "ntf_sound_path": deluge.common.get_default_download_dir(), + "ntf_popup": False, + "ntf_email": False, + "ntf_email_add": "", + "ntf_username": "", + "ntf_pass": "", + "ntf_server": "", + "ntf_security": None, + "signal_port": 40000, "show_sidebar": True, "show_toolbar": True, "show_statusbar": True diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index cd5332374..9a1b8a781 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -267,7 +267,7 @@ class Preferences(component.Component): "combo_proxy_type": ("active", self.core_config["proxy_type"]), "txt_proxy_server": ("text", self.core_config["proxy_server"]), "txt_proxy_username": ("text", self.core_config["proxy_username"]), - "txt_proxy_password": ("text", self.core_config["proxy_password"]) + "txt_proxy_password": ("text", self.core_config["proxy_password"]), } # Change a few widgets if we're connected to a remote host @@ -416,7 +416,33 @@ class Preferences(component.Component): ## Other tab ## self.glade.get_widget("chk_show_new_releases").set_active( self.gtkui_config["show_new_releases"]) - + + ## Notification tab ## + self.glade.get_widget("chk_ntf_tray_blink").set_active( + self.gtkui_config["ntf_tray_blink"]) + self.glade.get_widget("chk_ntf_popup").set_active( + self.gtkui_config["ntf_popup"]) + self.glade.get_widget("chk_ntf_email").set_active( + self.gtkui_config["ntf_email"]) + self.glade.get_widget("chk_ntf_sound").set_active( + self.gtkui_config["ntf_sound"]) + self.glade.get_widget("combo_ntf_sound_path").set_filename( + self.gtkui_config["ntf_sound_path"]) + self.glade.get_widget("txt_ntf_email").set_text( + self.gtkui_config["ntf_email_add"]) + self.glade.get_widget("txt_ntf_server").set_text( + self.gtkui_config["ntf_server"]) + self.glade.get_widget("txt_ntf_username").set_text( + self.gtkui_config["ntf_username"]) + self.glade.get_widget("txt_ntf_pass").set_text( + self.gtkui_config["ntf_pass"]) + if not self.gtkui_config["ntf_security"]: + self.glade.get_widget("rad_ntf_none").set_active(True) + elif self.gtkui_config["ntf_security"] == 'SSL': + self.glade.get_widget("rad_ntf_none").set_active(True) + elif self.gtkui_config["ntf_security"] == 'TLS': + self.glade.get_widget("rad_ntf_tls").set_active(True) + ## Plugins tab ## all_plugins = self.all_plugins enabled_plugins = self.enabled_plugins @@ -558,6 +584,32 @@ class Preferences(component.Component): new_gtkui_config["tray_password"] = passhex new_gtkui_config["classic_mode"] = \ self.glade.get_widget("chk_classic_mode").get_active() + + ## Notification tab ## + new_gtkui_config["ntf_tray_blink"] = \ + self.glade.get_widget("chk_ntf_tray_blink").get_active() + new_gtkui_config["ntf_popup"] = \ + self.glade.get_widget("chk_ntf_popup").get_active() + new_gtkui_config["ntf_sound"] = \ + self.glade.get_widget("chk_ntf_sound").get_active() + new_gtkui_config["ntf_email"] = \ + self.glade.get_widget("chk_ntf_email").get_active() + new_gtkui_config["ntf_email_add"] = \ + self.glade.get_widget("txt_ntf_email").get_text() + new_gtkui_config["ntf_username"] = \ + self.glade.get_widget("txt_ntf_username").get_text() + new_gtkui_config["ntf_pass"] = \ + self.glade.get_widget("txt_ntf_pass").get_text() + new_gtkui_config["ntf_server"] = \ + self.glade.get_widget("txt_ntf_server").get_text() + new_gtkui_config["ntf_sound_path"] = \ + self.glade.get_widget("combo_ntf_sound_path").get_filename() + if self.glade.get_widget("rad_ntf_none").get_active(): + new_gtkui_config["ntf_security"] = None + elif self.glade.get_widget("rad_ntf_ssl").get_active(): + new_gtkui_config["ntf_security"] = 'SSL' + elif self.glade.get_widget("rad_ntf_tls").get_active(): + new_gtkui_config["ntf_security"] = 'TLS' ## Other tab ## new_gtkui_config["show_new_releases"] = \ @@ -584,7 +636,7 @@ class Preferences(component.Component): self.glade.get_widget("txt_proxy_password").get_text() new_core_config["proxy_server"] = \ self.glade.get_widget("txt_proxy_server").get_text() - + ## Queue tab ## new_core_config["queue_new_to_top"] = \ self.glade.get_widget("chk_queue_new_top").get_active()