show and hide the toolbar

This commit is contained in:
Zach Tibbitts 2007-02-21 05:29:47 +00:00
parent 1e35cca89f
commit d32dc83f14
2 changed files with 23 additions and 4 deletions

View File

@ -5,8 +5,6 @@
<widget class="GtkWindow" id="main_window">
<property name="visible">True</property>
<property name="title">Deluge</property>
<property name="default_width">650</property>
<property name="default_height">639</property>
<signal name="destroy" handler="quit"/>
<signal name="destroy_event" handler="quit"/>
<signal name="delete_event" handler="delete"/>
@ -18,7 +16,6 @@
<child>
<widget class="GtkVPaned" id="vpaned1">
<property name="visible">True</property>
<property name="position">190</property>
<property name="position_set">True</property>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow1">
@ -696,10 +693,19 @@
<child>
<widget class="GtkMenu" id="menu1">
<property name="visible">True</property>
<child>
<widget class="GtkCheckMenuItem" id="chk_toolbar">
<property name="visible">True</property>
<property name="label" translatable="yes">Toolbar</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="toggled" handler="toolbar_toggle"/>
</widget>
</child>
<child>
<widget class="GtkCheckMenuItem" id="chk_infopane">
<property name="visible">True</property>
<property name="label" translatable="yes">Show Details Pane</property>
<property name="label" translatable="yes">Details</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="toggled" handler="infopane_toggle"/>

View File

@ -139,6 +139,7 @@ class DelugeGTK:
"pref_clicked": self.show_pref_dialog,
"plugins_clicked": self.show_plugin_dialog,
## View Menu
"toolbar_toggle": self.toolbar_toggle,
"infopane_toggle": self.infopane_toggle,
"size_toggle": self.size_toggle,
"status_toggle": self.status_toggle,
@ -781,6 +782,16 @@ class DelugeGTK:
if torrent is not None:
self.manager.queue_up(torrent)
def toolbar_toggle(self, widget):
if widget.get_active():
self.wtree.get_widget("tb_left").show()
self.wtree.get_widget("tb_middle").show()
self.wtree.get_widget("tb_right").show()
else:
self.wtree.get_widget("tb_left").hide()
self.wtree.get_widget("tb_middle").hide()
self.wtree.get_widget("tb_right").hide()
def infopane_toggle(self, widget):
if widget.get_active():
self.wtree.get_widget("torrent_info").show()
@ -814,6 +825,7 @@ class DelugeGTK:
def load_window_settings(self):
self.wtree.get_widget("chk_infopane").set_active(self.config.get("show_infopane", bool))
self.wtree.get_widget("chk_toolbar").set_active(self.config.get("show_toolbar", bool))
self.wtree.get_widget("chk_size").set_active(self.config.get("show_size", bool))
self.wtree.get_widget("chk_status").set_active(self.config.get("show_status", bool))
self.wtree.get_widget("chk_seed").set_active(self.config.get("show_seeders", bool))
@ -825,6 +837,7 @@ class DelugeGTK:
def save_window_settings(self):
self.config.set("show_infopane", self.wtree.get_widget("chk_infopane").get_active())
self.config.set("show_toolbar", self.wtree.get_widget("chk_toolbar").get_active())
self.config.set("show_size", self.size_column.get_visible())
self.config.set("show_status", self.status_column.get_visible())
self.config.set("show_seeders", self.seed_column.get_visible())