Do not assume we are packing an ActivityToolbox inside the activity

This commit is contained in:
Marco Pesenti Gritti 2007-05-15 11:23:46 +02:00
parent 871828f307
commit 9fa0790c2b
2 changed files with 10 additions and 16 deletions

View File

@ -1,6 +1,6 @@
VERSION=0.63 VERSION=0.63
DATE=`date +%Y%m%d` DATE=`date +%Y%m%d`
RELEASE=2.80 RELEASE=2.82
TARBALL=sugar-$VERSION-$RELEASE.${DATE}git.tar.bz2 TARBALL=sugar-$VERSION-$RELEASE.${DATE}git.tar.bz2
rm sugar-$VERSION.tar.bz2 rm sugar-$VERSION.tar.bz2

View File

@ -35,11 +35,6 @@ from sugar.datastore import datastore
from sugar import profile from sugar import profile
class ActivityToolbar(gtk.Toolbar): 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): def __init__(self, activity):
gtk.Toolbar.__init__(self) gtk.Toolbar.__init__(self)
@ -63,6 +58,7 @@ class ActivityToolbar(gtk.Toolbar):
separator.show() separator.show()
self.share = ToolButton('stock-share-mesh') self.share = ToolButton('stock-share-mesh')
self.share.connect('clicked', self._share_clicked_cb)
self.insert(self.share, -1) self.insert(self.share, -1)
if activity.get_shared(): if activity.get_shared():
self.share.set_sensitive(False) self.share.set_sensitive(False)
@ -74,9 +70,16 @@ class ActivityToolbar(gtk.Toolbar):
separator.show() separator.show()
self.close = ToolButton('window-close') self.close = ToolButton('window-close')
self.close.connect('clicked', self._close_clicked_cb)
self.insert(self.close, -1) self.insert(self.close, -1)
self.close.show() 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): def _jobject_updated_cb(self, jobject):
self.title.set_text(jobject['title']) self.title.set_text(jobject['title'])
@ -294,7 +297,7 @@ class Activity(Window, gtk.Container):
if self._shared_activity: if self._shared_activity:
self._shared_activity.leave() self._shared_activity.leave()
def _handle_close_cb(self, toolbar): def close(self):
if self.jobject: if self.jobject:
try: try:
self.save() self.save()
@ -303,15 +306,6 @@ class Activity(Window, gtk.Container):
raise raise
self.destroy() 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(): def get_bundle_name():
"""Return the bundle name for the current process' bundle """Return the bundle name for the current process' bundle
""" """