Able to change the visibility of the toolbar and infopane.

This commit is contained in:
Andrew Resch 2007-10-24 07:40:59 +00:00
parent 40e1376bc4
commit 57ff5be823
4 changed files with 571 additions and 554 deletions

File diff suppressed because it is too large Load diff

View file

@ -157,11 +157,13 @@ class MenuBar(component.Component):
component.get("TorrentView").get_selected_torrents())
## View Menu ##
def on_menuitem_toolbar_toggled(self, data=None):
def on_menuitem_toolbar_toggled(self, value):
log.debug("on_menuitem_toolbar_toggled")
component.get("ToolBar").visible(value.get_active())
def on_menuitem_infopane_toggled(self, data=None):
def on_menuitem_infopane_toggled(self, value):
log.debug("on_menuitem_infopane_toggled")
component.get("TorrentDetails").visible(value.get_active())
## Help Menu ##
def on_menuitem_about_activate(self, data=None):

View file

@ -57,6 +57,12 @@ class ToolBar(component.Component):
self.on_toolbutton_connectionmanager_clicked
})
def visible(self, visible):
if visible:
self.toolbar.show()
else:
self.toolbar.hide()
def add_toolbutton(self, callback, label=None, image=None, stock=None,
tooltip=None):
"""Adds a toolbutton to the toolbar"""

View file

@ -73,6 +73,13 @@ class TorrentDetails(component.Component):
self.eta = glade.get_widget("summary_eta")
self.torrent_path = glade.get_widget("summary_torrent_path")
def visible(self, visible):
if visible:
self.notebook.show()
else:
self.notebook.hide()
self.window.vpaned.set_position(-1)
def stop(self):
self.clear()