From 9fa0790c2be829bcd652a49ed9c6e52989dcbfe7 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 15 May 2007 11:23:46 +0200 Subject: [PATCH] Do not assume we are packing an ActivityToolbox inside the activity --- build-snapshot.sh | 2 +- sugar/activity/activity.py | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/build-snapshot.sh b/build-snapshot.sh index b31280c5..7376c781 100755 --- a/build-snapshot.sh +++ b/build-snapshot.sh @@ -1,6 +1,6 @@ VERSION=0.63 DATE=`date +%Y%m%d` -RELEASE=2.80 +RELEASE=2.82 TARBALL=sugar-$VERSION-$RELEASE.${DATE}git.tar.bz2 rm sugar-$VERSION.tar.bz2 diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py index 6f811257..85355f4a 100644 --- a/sugar/activity/activity.py +++ b/sugar/activity/activity.py @@ -35,11 +35,6 @@ from sugar.datastore import datastore from sugar import profile class ActivityToolbar(gtk.Toolbar): - __gsignals__ = { - 'share-clicked': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([])), - 'close-clicked': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([])) - } - def __init__(self, activity): gtk.Toolbar.__init__(self) @@ -63,6 +58,7 @@ class ActivityToolbar(gtk.Toolbar): separator.show() self.share = ToolButton('stock-share-mesh') + self.share.connect('clicked', self._share_clicked_cb) self.insert(self.share, -1) if activity.get_shared(): self.share.set_sensitive(False) @@ -74,9 +70,16 @@ class ActivityToolbar(gtk.Toolbar): separator.show() self.close = ToolButton('window-close') + self.close.connect('clicked', self._close_clicked_cb) self.insert(self.close, -1) self.close.show() + def _share_clicked_cb(self, button): + self._activity.share() + + def _close_clicked_cb(self, button): + self._activity.close() + def _jobject_updated_cb(self, jobject): self.title.set_text(jobject['title']) @@ -294,7 +297,7 @@ class Activity(Window, gtk.Container): if self._shared_activity: self._shared_activity.leave() - def _handle_close_cb(self, toolbar): + def close(self): if self.jobject: try: self.save() @@ -303,15 +306,6 @@ class Activity(Window, gtk.Container): raise self.destroy() - def _handle_share_cb(self, toolbar): - self.share() - - def set_toolbox(self, toolbox): - Window.set_toolbox(self, toolbox) - act_toolbar = toolbox.get_activity_toolbar() - act_toolbar.share.connect('clicked', self._handle_share_cb) - act_toolbar.close.connect('clicked', self._handle_close_cb) - def get_bundle_name(): """Return the bundle name for the current process' bundle """