diff --git a/deluge/ui/gtkui/filtertreeview.py b/deluge/ui/gtkui/filtertreeview.py index aae194b38..0978d86d3 100644 --- a/deluge/ui/gtkui/filtertreeview.py +++ b/deluge/ui/gtkui/filtertreeview.py @@ -128,7 +128,6 @@ class FilterTreeView(component.Component): self.create_model_filter() #init..... - self.hpaned.set_position(170) self.label_view.connect("button-press-event", self.on_button_press_event) #colors using current theme. diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 113c09292..17ebd2bda 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -113,8 +113,9 @@ DEFAULT_PREFS = { "show_sidebar": True, "show_toolbar": True, "show_statusbar": True, - "sidebar_show_zero":False, - "sidebar_show_trackers":False + "sidebar_show_zero": False, + "sidebar_show_trackers": False, + "sidebar_position": 170 } class GtkUI: @@ -247,6 +248,8 @@ class GtkUI: client.shutdown() except: pass + + self.config.save() try: gtk.main_quit() except RuntimeError: diff --git a/deluge/ui/gtkui/sidebar.py b/deluge/ui/gtkui/sidebar.py index ebab48d4e..abc2e96e7 100644 --- a/deluge/ui/gtkui/sidebar.py +++ b/deluge/ui/gtkui/sidebar.py @@ -51,9 +51,8 @@ class SideBar(component.Component): glade = self.window.main_glade self.notebook = glade.get_widget("sidebar_notebook") self.hpaned = glade.get_widget("hpaned") - self.is_visible = True self.config = ConfigManager("gtkui.conf") - self.hpaned_position = self.hpaned.get_position() + #self.hpaned_position = self.hpaned.get_position() # Tabs holds references to the Tab widgets by their name self.tabs = {} @@ -61,18 +60,21 @@ class SideBar(component.Component): # Hide if necessary self.visible(self.config["show_sidebar"]) + def shutdown(self): + log.debug("hpaned.position: %s", self.hpaned.get_position()) + self.config["sidebar_position"] = self.hpaned.get_position() + def visible(self, visible): if visible: - if self.hpaned_position: - self.hpaned.set_position(self.hpaned_position) + if self.config["sidebar_position"]: + self.hpaned.set_position(self.config["sidebar_position"]) self.notebook.show() else: self.notebook.hide() # Store the position for restoring upon show() - self.hpaned_position = self.hpaned.get_position() + self.config["sidebar_position"] = self.hpaned.get_position() self.hpaned.set_position(-1) - self.is_visible = visible self.config["show_sidebar"] = visible def add_tab(self, widget, tab_name, label):