diff --git a/ChangeLog b/ChangeLog index d46c8c2fb..9f831d46e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ Deluge 0.9.04 - "1.0.0_RC4" (In Development) * Fix new release check * Display 'total_wanted' instead of 'total_size' in Size column * Fix displaying of torrents when language is not English + * Fix the view options to be persistent between sessions Deluge 0.9.03 - "1.0.0_RC3" (21 July 2008) Core: diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 09213387f..cf78d9fd8 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -97,7 +97,10 @@ DEFAULT_PREFS = { "autoadd_location": "", "choose_directory_dialog_path": deluge.common.get_default_download_dir(), "show_new_releases": True, - "signal_port": 40000 + "signal_port": 40000, + "show_sidebar": True, + "show_toolbar": True, + "show_statusbar": True } class GtkUI: diff --git a/deluge/ui/gtkui/menubar.py b/deluge/ui/gtkui/menubar.py index 68b2a8043..f395d5edd 100644 --- a/deluge/ui/gtkui/menubar.py +++ b/deluge/ui/gtkui/menubar.py @@ -101,6 +101,13 @@ class MenuBar(component.Component): # Attach the torrent_menu to the Torrent file menu self.menu_torrent.set_submenu(self.torrentmenu) + self.window.main_glade.get_widget("menuitem_toolbar").set_active( + self.config["show_toolbar"]) + self.window.main_glade.get_widget("menuitem_labels").set_active( + self.config["show_sidebar"]) + self.window.main_glade.get_widget("menuitem_statusbar").set_active( + self.config["show_statusbar"]) + ### Connect Signals ### self.window.main_glade.signal_autoconnect({ ## File Menu diff --git a/deluge/ui/gtkui/sidebar.py b/deluge/ui/gtkui/sidebar.py index 0db5857ca..654e4181f 100644 --- a/deluge/ui/gtkui/sidebar.py +++ b/deluge/ui/gtkui/sidebar.py @@ -36,6 +36,7 @@ import gtk.glade import deluge.component as component import deluge.common +from deluge.configmanager import ConfigManager from deluge.log import LOG as log class SideBar(component.Component): @@ -47,7 +48,8 @@ class SideBar(component.Component): self.hpaned = glade.get_widget("hpaned") self.scrolled = glade.get_widget("scrolledwindow_sidebar") self.is_visible = True - + self.config = ConfigManager("gtkui.conf") + # Create the liststore # state str, str that's visible, icon self.liststore = gtk.ListStore(str, str, gtk.gdk.Pixbuf) @@ -89,6 +91,9 @@ class SideBar(component.Component): # Select the 'All' label on init self.label_view.get_selection().select_iter( self.liststore.get_iter_first()) + + # Hide if necessary + self.visible(self.config["show_sidebar"]) def visible(self, visible): if visible: @@ -98,7 +103,8 @@ class SideBar(component.Component): self.hpaned.set_position(-1) self.is_visible = visible - + self.config["show_sidebar"] = visible + def on_selection_changed(self, selection): try: (model, row) = self.label_view.get_selection().get_selected() diff --git a/deluge/ui/gtkui/statusbar.py b/deluge/ui/gtkui/statusbar.py index 31443ee6e..035b43abd 100644 --- a/deluge/ui/gtkui/statusbar.py +++ b/deluge/ui/gtkui/statusbar.py @@ -135,6 +135,9 @@ class StatusBar(component.Component): callback=self._on_notconnected_item_clicked) # Show the not connected status bar self.show_not_connected() + + # Hide if necessary + self.visible(self.config["show_statusbar"]) def start(self): # Add in images and labels @@ -197,7 +200,9 @@ class StatusBar(component.Component): self.statusbar.show() else: self.statusbar.hide() - + + self.config["show_statusbar"] = visible + def show_not_connected(self): self.hbox.pack_start( self.not_connected_item.get_eventbox(), expand=False, fill=False) diff --git a/deluge/ui/gtkui/toolbar.py b/deluge/ui/gtkui/toolbar.py index 88fea9b8c..be8e7f8b0 100644 --- a/deluge/ui/gtkui/toolbar.py +++ b/deluge/ui/gtkui/toolbar.py @@ -78,6 +78,9 @@ class ToolBar(component.Component): if self.config["classic_mode"]: self.window.main_glade.get_widget("toolbutton_connectionmanager").hide() + + # Hide if necessary + self.visible(self.config["show_toolbar"]) def start(self): for widget in self.change_sensitivity: @@ -94,6 +97,8 @@ class ToolBar(component.Component): else: self.toolbar.hide() + self.config["show_toolbar"] = visible + def add_toolbutton(self, callback, label=None, image=None, stock=None, tooltip=None): """Adds a toolbutton to the toolbar"""