Expose the buttons contained by the activity toolbar.

This commit is contained in:
Tomeu Vizoso 2007-05-03 16:30:32 +02:00
parent 1f60139e09
commit 694e30aa76

View File

@ -44,26 +44,18 @@ class ActivityToolbar(gtk.Toolbar):
activity.connect('shared', self._activity_shared_cb) activity.connect('shared', self._activity_shared_cb)
activity.connect('joined', self._activity_shared_cb) activity.connect('joined', self._activity_shared_cb)
button = ToolButton('window-close') self.close = ToolButton('window-close')
button.connect('clicked', self._close_button_clicked_cb) self.insert(self.close, -1)
self.insert(button, -1) self.close.show()
button.show()
self._share_button = ToolButton('stock-share-mesh') self.share = ToolButton('stock-share-mesh')
self._share_button.connect('clicked', self._share_button_clicked_cb) self.insert(self.share, -1)
self.insert(self._share_button, -1)
if activity.get_shared(): if activity.get_shared():
self._share_button.set_sensitive(False) self.share.set_sensitive(False)
self._share_button.show() self.share.show()
def _close_button_clicked_cb(self, button):
self.emit('close-clicked')
def _share_button_clicked_cb(self, button):
self.emit('share-clicked')
def _activity_shared_cb(self, activity): def _activity_shared_cb(self, activity):
self._share_button.set_sensitive(False) self.share.set_sensitive(False)
class EditToolbar(gtk.Toolbar): class EditToolbar(gtk.Toolbar):
def __init__(self): def __init__(self):
@ -216,8 +208,8 @@ class Activity(Window, gtk.Container):
def set_toolbox(self, toolbox): def set_toolbox(self, toolbox):
Window.set_toolbox(self, toolbox) Window.set_toolbox(self, toolbox)
act_toolbar = toolbox.get_activity_toolbar() act_toolbar = toolbox.get_activity_toolbar()
act_toolbar.connect('share-clicked', self._handle_share_cb) act_toolbar.share.connect('clicked', self._handle_share_cb)
act_toolbar.connect('close-clicked', self._handle_close_cb) act_toolbar.close.connect('clicked', self._handle_close_cb)
def get_bundle_path(): def get_bundle_path():
"""Return the bundle path for the current process' bundle """Return the bundle path for the current process' bundle