diff --git a/glade/delugegtk.glade b/glade/delugegtk.glade index 621f8ae9f..3d94e946b 100644 --- a/glade/delugegtk.glade +++ b/glade/delugegtk.glade @@ -16,122 +16,595 @@ 4 3 - + True - GTK_TOOLBAR_BOTH_HORIZ - False + 190 + True - + True - Add Torrent - Add Torrent - True - gtk-add - + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + + + True + True + True + True + False + + + - False + False + False - + True - Remove Torrent - Remove Torrent - True - gtk-remove - + True + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + + + True + + + True + 10 + 12 + 4 + + + + + + + + + + + + + + + + + + + + + True + + + 3 + 4 + 11 + 12 + + + + + True + 0 + <b>Estimated Time Remaining:</b> + True + + + 2 + 3 + 11 + 12 + + + + + True + 0 + + + 3 + 4 + 5 + 6 + + + + + True + 0 + + + 1 + 2 + 5 + 6 + + + + + True + 0 + <b>Peers:</b> + True + + + 2 + 3 + 5 + 6 + + + + + True + 0 + <b>Seeders:</b> + True + + + 5 + 6 + + + + + True + 0 + <b>Total Size:</b> + True + + + 2 + 3 + + + + + True + 0 + <b>Total Downloaded:</b> + True + + + 3 + 4 + + + + + True + 0 + <b>Downloaded this session:</b> + True + + + 7 + 8 + + + + + True + 0 + + + 1 + 2 + 2 + 3 + + + + + True + 0 + + + 1 + 2 + 3 + 4 + + + + + True + 0 + + + 1 + 2 + 7 + 8 + + + + + True + 0 + <b>Tracker:</b> + True + + + 8 + 9 + + + + + True + 0 + <b>Tracker Response:</b> + True + + + 9 + 10 + + + + + True + 0 + <b>Tracker Status:</b> + True + + + 10 + 11 + + + + + True + 0 + + + 1 + 2 + 10 + 11 + + + + + True + 0 + <b>Next Announce:</b> + True + + + 2 + 3 + 10 + 11 + + + + + True + 0 + + + 3 + 4 + 10 + 11 + + + + + True + 0 + <b>Pieces:</b> + True + + + 2 + 3 + 2 + 3 + + + + + True + 0 + <b>Total Uploaded:</b> + True + + + 2 + 3 + 3 + 4 + + + + + True + 0 + + + 3 + 4 + 2 + 3 + + + + + True + 0 + + + 3 + 4 + 3 + 4 + + + + + True + 0 + <b>Share Ratio:</b> + True + + + 2 + 3 + 6 + 7 + + + + + True + 0 + <b>Uploaded This Session:</b> + True + + + 2 + 3 + 7 + 8 + + + + + True + 0 + + + 3 + 4 + 6 + 7 + + + + + True + 0 + + + 3 + 4 + 7 + 8 + + + + + True + 0 + + + 1 + 4 + 8 + 9 + + + + + True + 0 + + + 1 + 4 + 9 + 10 + + + + + True + 0 + <b>Use compact storage allocation:</b> + True + + + 11 + 12 + + + + + True + 0 + + + 1 + 2 + 11 + 12 + + + + + True + 0 + <b>Download Rate:</b> + True + + + 4 + 5 + + + + + True + 0 + + + 1 + 2 + 4 + 5 + + + + + True + 0 + <b>Upload Rate:</b> + True + + + 2 + 3 + 4 + 5 + + + + + True + 0 + + + 3 + 4 + 4 + 5 + + + + + True + + + 4 + + + + + + + + + + False + + + + + True + Details + + + tab + False + False + + + + + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + + + True + + + + + 1 + False + + + + + True + Peers + + + tab + 1 + False + False + + + + + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + + + True + True + + + + + 2 + False + + + + + True + Files + + + tab + 2 + False + False + + - - False - - - - - True - Clear Finished Torrents - Clear Finished - True - gtk-clear - - - - False - - - - - True - Update Tracker - Update Tracker - True - gtk-refresh - - - - False - - - - - True - Queue Torrent Up - Move Up - True - gtk-go-up - - - - False - - - - - True - Queue Torrent Down - Move Down - True - gtk-go-down - - - - False - - 1 - 2 - - GTK_FILL - - - - - True - GTK_TOOLBAR_BOTH_HORIZ - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - True - GTK_TOOLBAR_BOTH_HORIZ - False - - - 2 3 - 1 - 2 - - GTK_FILL + 2 + 3 + + + + + True + + + 3 + 3 + 4 + @@ -224,7 +697,7 @@ True - + True Show Details Pane True @@ -241,7 +714,7 @@ True - + True Size True @@ -250,7 +723,7 @@ - + True Status True @@ -259,7 +732,7 @@ - + True Seeders True @@ -268,7 +741,7 @@ - + True Peers True @@ -277,7 +750,7 @@ - + True Download True @@ -286,7 +759,7 @@ - + True Upload True @@ -295,7 +768,7 @@ - + True Time Remaining True @@ -304,7 +777,7 @@ - + True Share Ratio True @@ -347,595 +820,122 @@ - + True + GTK_TOOLBAR_BOTH_HORIZ + False + 2 3 - 3 - 4 - + 1 + 2 + + GTK_FILL - + True - 190 - True + GTK_TOOLBAR_BOTH_HORIZ + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + True + GTK_TOOLBAR_BOTH_HORIZ + False - + True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - True - True - True - False - - - + Add Torrent + Add Torrent + True + gtk-add + - False - False + False - + True - True - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - - - True - 10 - 12 - 4 - - - - - - - - - - - - - - - - - - - - - True - - - 4 - - - - - - True - 0 - - - 3 - 4 - 4 - 5 - - - - - True - 0 - <b>Upload Rate:</b> - True - - - 2 - 3 - 4 - 5 - - - - - True - 0 - - - 1 - 2 - 4 - 5 - - - - - True - 0 - <b>Download Rate:</b> - True - - - 4 - 5 - - - - - True - 0 - - - 1 - 2 - 11 - 12 - - - - - True - 0 - <b>Use compact storage allocation:</b> - True - - - 11 - 12 - - - - - True - 0 - - - 1 - 4 - 9 - 10 - - - - - True - 0 - - - 1 - 4 - 8 - 9 - - - - - True - 0 - - - 3 - 4 - 7 - 8 - - - - - True - 0 - - - 3 - 4 - 6 - 7 - - - - - True - 0 - <b>Uploaded This Session:</b> - True - - - 2 - 3 - 7 - 8 - - - - - True - 0 - <b>Share Ratio:</b> - True - - - 2 - 3 - 6 - 7 - - - - - True - 0 - - - 3 - 4 - 3 - 4 - - - - - True - 0 - - - 3 - 4 - 2 - 3 - - - - - True - 0 - <b>Total Uploaded:</b> - True - - - 2 - 3 - 3 - 4 - - - - - True - 0 - <b>Pieces:</b> - True - - - 2 - 3 - 2 - 3 - - - - - True - 0 - - - 3 - 4 - 10 - 11 - - - - - True - 0 - <b>Next Announce:</b> - True - - - 2 - 3 - 10 - 11 - - - - - True - 0 - - - 1 - 2 - 10 - 11 - - - - - True - 0 - <b>Tracker Status:</b> - True - - - 10 - 11 - - - - - True - 0 - <b>Tracker Response:</b> - True - - - 9 - 10 - - - - - True - 0 - <b>Tracker:</b> - True - - - 8 - 9 - - - - - True - 0 - - - 1 - 2 - 7 - 8 - - - - - True - 0 - - - 1 - 2 - 3 - 4 - - - - - True - 0 - - - 1 - 2 - 2 - 3 - - - - - True - 0 - <b>Downloaded this session:</b> - True - - - 7 - 8 - - - - - True - 0 - <b>Total Downloaded:</b> - True - - - 3 - 4 - - - - - True - 0 - <b>Total Size:</b> - True - - - 2 - 3 - - - - - True - 0 - <b>Seeders:</b> - True - - - 5 - 6 - - - - - True - 0 - <b>Peers:</b> - True - - - 2 - 3 - 5 - 6 - - - - - True - 0 - - - 1 - 2 - 5 - 6 - - - - - True - 0 - - - 3 - 4 - 5 - 6 - - - - - True - 0 - <b>Estimated Time Remaining:</b> - True - - - 2 - 3 - 11 - 12 - - - - - True - - - 3 - 4 - 11 - 12 - - - - - - - - - False - - - - - True - Details - - - tab - False - False - - - - - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - - - - - 1 - False - - - - - True - Peers - - - tab - 1 - False - False - - - - - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - True - - - - - 2 - False - - - - - True - Files - - - tab - 2 - False - False - - + Remove Torrent + Remove Torrent + True + gtk-remove + + + False + + + + + True + Clear Finished Torrents + Clear Finished + True + gtk-clear + + + + False + + + + + True + Update Tracker + Update Tracker + True + gtk-refresh + + + + False + + + + + True + Queue Torrent Up + Move Up + True + gtk-go-up + + + + False + + + + + True + Queue Torrent Down + Move Down + True + gtk-go-down + + + + False + - 3 - 2 - 3 + 1 + 2 + + GTK_FILL diff --git a/src/delugegtk.py b/src/delugegtk.py index 4563d474c..df896a807 100755 --- a/src/delugegtk.py +++ b/src/delugegtk.py @@ -78,7 +78,7 @@ class DelugeGTK(dbus.service.Object): self.window.hide() self.toolbar = self.wtree.get_widget("tb_middle") if(self.window): - self.window.connect("destroy", self.quit) + self.window.connect("destroy", self.close_clicked) self.window.set_title('%s %s'%(dcommon.PROGRAM_NAME, dcommon.PROGRAM_VERSION)) self.window.set_icon_from_file(dcommon.get_pixmap("deluge32.png")) @@ -97,6 +97,11 @@ class DelugeGTK(dbus.service.Object): self.apply_prefs() + try: + self.load_window_settings() + except KeyError: + pass + enable_plugins = self.pref.get('enabled_plugins').split(';') print enable_plugins for plugin in enable_plugins: @@ -111,7 +116,7 @@ class DelugeGTK(dbus.service.Object): "add_torrent": self.add_torrent_clicked, "add_torrent_url": self.add_torrent_url_clicked, "remove_torrent" : self.remove_torrent_clicked, - "menu_quit": self.quit, + "menu_quit": self.close_clicked, ## Edit Menu "pref_clicked": self.show_pref_dialog, "plugins_clicked": self.show_plugin_dialog, @@ -147,7 +152,7 @@ class DelugeGTK(dbus.service.Object): "clear_finished": self.clear_finished, "preferences": self.show_pref_dialog, "plugins": self.show_plugin_dialog, - "quit": self.quit, + "quit": self.close_clicked, } tray_glade.signal_autoconnect(dic) self.tray.connect("popup-menu", self.tray_popup, None) @@ -707,12 +712,35 @@ class DelugeGTK(dbus.service.Object): def share_toggle(self, obj): self.share_column.set_visible(obj.get_active()) - def quit(self, obj=None): + def close_clicked(self, obj=None): self.shutdown() + + def load_window_settings(self): + self.wtree.get_widget("chk_infopane").set_active(self.pref.get("show_infopane", bool)) + self.wtree.get_widget("chk_size").set_active(self.pref.get("show_size", bool)) + self.wtree.get_widget("chk_status").set_active(self.pref.get("show_status", bool)) + self.wtree.get_widget("chk_seed").set_active(self.pref.get("show_seeders", bool)) + self.wtree.get_widget("chk_peer").set_active(self.pref.get("show_peers", bool)) + self.wtree.get_widget("chk_download").set_active(self.pref.get("show_dl", bool)) + self.wtree.get_widget("chk_upload").set_active(self.pref.get("show_ul", bool)) + self.wtree.get_widget("chk_eta").set_active(self.pref.get("show_eta", bool)) + self.wtree.get_widget("chk_ratio").set_active(self.pref.get("show_share", bool)) + + def save_window_settings(self): + self.pref.set("show_infopane", self.wtree.get_widget("chk_infopane").get_active()) + self.pref.set("show_size", self.size_column.get_visible()) + self.pref.set("show_status", self.status_column.get_visible()) + self.pref.set("show_seeders", self.seed_column.get_visible()) + self.pref.set("show_peers", self.peer_column.get_visible()) + self.pref.set("show_dl", self.dl_column.get_visible()) + self.pref.set("show_ul", self.ul_column.get_visible()) + self.pref.set("show_eta", self.eta_column.get_visible()) + self.pref.set("show_share", self.share_column.get_visible()) def shutdown(self): enabled_plugins = ';'.join(self.plugins.get_enabled_plugins()) self.pref.set('enabled_plugins', enabled_plugins) + self.save_window_settings() self.pref.save_to_file(self.conf_file) self.plugins.shutdown_all_plugins() self.manager.quit()