[Sugar-devel] Fwd: Fw: Re: #3013 UNSP: toolbar error

James Cameron quozl at laptop.org
Thu Aug 4 19:49:32 EDT 2011


On Thu, Aug 04, 2011 at 09:50:13AM -0500, James Simmons wrote:
> We have a stack trace.  See below.

I've found the cause of the regresssion.  It did not affect 0.84.12, but
does affect current versions of 0.84.

It was a patch 0ba47d0 for #1948.

In ActivityToolbar.__init__() the references to self.title are protected
by a check for activity.metadata.

In __stop_clicked_cb(), the newly added references to self.title are not
protected in the same way.

So any activity that uses your documented and published method for
avoiding the creation of a journal entry ... which is also the supported
method in Sugar ... will fail in the way you describe.

For compatibility with Sugar 0.84.13 and later, the method will need a
workaround.  I suggest connecting a replacement __stop_clicked_cb
function to the 'clicked' signal of the stop button, and in place of the
current toolkit code, just call activity.close().

The fix to Sugar Toolkit seems straightforward:

diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py
index 6f204b3..09450f7 100644
--- a/src/sugar/activity/activity.py
+++ b/src/sugar/activity/activity.py
@@ -178,9 +178,10 @@ class ActivityToolbar(gtk.Toolbar):
         self._activity.copy()
 
     def __stop_clicked_cb(self, button):
-        if self._focus_out_hid is not None:
-            self.title.disconnect(self._focus_out_hid)
-        self._update_title(self.title.get_text())
+        if self._activity.metadata:
+            if self._focus_out_hid is not None:
+                self.title.disconnect(self._focus_out_hid)
+            self._update_title(self.title.get_text())
         self._activity.close()
 
     def __jobject_updated_cb(self, jobject):

... but that won't fix the deployed laptops.

-- 
James Cameron
http://quozl.linux.org.au/


More information about the Sugar-devel mailing list