From f4cda9baaf77348661246dc3fc886f4ade29fcb8 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Tue, 12 Jun 2007 03:42:40 +0000 Subject: [PATCH] The window vpane position is now saved. Re-ordered default preferences to be alphabetical. --- glade/delugegtk.glade | 1 - src/interface.py | 4 +++- src/pref.py | 19 ++++++++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/glade/delugegtk.glade b/glade/delugegtk.glade index d6403cd40..9ee9a33a6 100644 --- a/glade/delugegtk.glade +++ b/glade/delugegtk.glade @@ -32,7 +32,6 @@ - False False diff --git a/src/interface.py b/src/interface.py index 2907a7cce..2d335d947 100644 --- a/src/interface.py +++ b/src/interface.py @@ -66,7 +66,7 @@ class DelugeGTK: self.window.set_icon_from_file(common.get_pixmap("deluge32.png")) self.notebook = self.wtree.get_widget("torrent_info") self.statusbar = self.wtree.get_widget("statusbar") - + ## Construct the Interface try: self.build_tray_icon() @@ -1040,6 +1040,7 @@ class DelugeGTK: self.wtree.get_widget("chk_upload").set_active(self.config.get("show_ul", bool, default=True)) self.wtree.get_widget("chk_eta").set_active(self.config.get("show_eta", bool, default=True)) self.wtree.get_widget("chk_ratio").set_active(self.config.get("show_share", bool, default=True)) + self.wtree.get_widget("vpaned1").set_position(self.config.get("window_height") - self.config.get("window_pane_position")) def save_window_settings(self): self.config.set("show_infopane", self.wtree.get_widget("chk_infopane").get_active()) @@ -1052,6 +1053,7 @@ class DelugeGTK: self.config.set("show_ul", self.ul_column.get_visible()) self.config.set("show_eta", self.eta_column.get_visible()) self.config.set("show_share", self.share_column.get_visible()) + self.config.set("window_pane_position", self.config.get("window_height") - self.vpane.get_position()) def window_configure_event(self, widget, event): if self.config.get("window_maximized") == False: diff --git a/src/pref.py b/src/pref.py index 97d71b1b2..cfb2d1a1d 100644 --- a/src/pref.py +++ b/src/pref.py @@ -27,23 +27,21 @@ import pickle import common DEFAULT_PREFS = { - "encin_state" : common.EncState.enabled, - "encout_state" : common.EncState.enabled, - "enclevel_type" : common.EncLevel.both, - "pref_rc4" : True, "auto_end_seeding" : False, "auto_seed_ratio" : -1, "close_to_tray" : False, - "lock_tray" : False, - "tray_passwd" : "", "default_download_path" : "", "dht_connections" : 80, "enable_dht" : True, "enable_system_tray" : True, "enabled_plugins" : "", + "encin_state" : common.EncState.enabled, + "encout_state" : common.EncState.enabled, + "enclevel_type" : common.EncLevel.both, "end_seed_ratio" : 0.0, "gui_update_interval" : 1.0, "listen_on" : [6881,6889], + "lock_tray" : False, "max_active_torrents" : -1, "max_connections" : 80, "max_download_rate" : -1.0, @@ -53,7 +51,8 @@ DEFAULT_PREFS = { "max_number_uploads" : -1.0, "max_upload_rate" : -1.0, "max_upload_rate_bps" : -1.0, - "max_uploads" : 2, + "max_uploads" : 2, + "pref_rc4" : True, "queue_seeds_to_bottom" : False, "show_dl" : True, "show_eta" : True, @@ -65,13 +64,15 @@ DEFAULT_PREFS = { "show_status" : True, "show_toolbar" : True, "show_ul" : True, + "tray_passwd" : "", "use_compact_storage" : False, "use_default_dir" : False, "window_height" : 480, + "window_maximized" : False, + "window_pane_position" : -1, "window_width" : 640, "window_x_pos" : 0, - "window_y_pos" : 0, - "window_maximized" : False + "window_y_pos" : 0 } class Preferences: def __init__(self, filename=None, global_defaults=True, defaults=None):