#9125 NORM Not Tri: activity.close() does not properly closet the activity
Zarro Boogs per Child
bugtracker at laptop.org
Tue Dec 16 13:47:57 EST 2008
#9125: activity.close() does not properly closet the activity
----------------------+-----------------------------------------------------
Reporter: HuskyDev | Owner: marco
Type: defect | Status: new
Priority: normal | Milestone: Not Triaged
Component: sugar | Version: not specified
Keywords: | Next_action: never set
Verified: 0 | Deployment_affected:
Blockedby: | Blocking:
----------------------+-----------------------------------------------------
While trying to implement code in [http://xo.orderedpixels.com Classroom
Presenter for the XO] that will close the activity after catching an OS
(or other internal) error, I discovered that the activity.close() method,
which should accomplish quitting the activity, does not function properly.
This on Sugar 8.2.1, build 767.
Attached is a screenshot of the activity after the activity.close() method
is called. The gray box in the middle is a dialog box that was just
destroyed.
Also attached is an olpc-logs file, which should include my activity's log
file as it was right after activity.close() was invoked.
'''Relevant code ([http://xo.orderedpixels.com/svn/ link to source]):'''
''shared.py''
{{{
if self.__shared_activity is None:
utils.run_dialog("Error: Activity Joining/Sharing Failed",
"The activity could not join/share. Activity will
close. Please restart.")
self.__arbiter.do_close_activity();
return;
}}}
''utils.py''
{{{
def run_dialog(header, msg):
"""Pops up a blocking dialog box with 'msg'"""
dialog = gtk.Dialog(str(header), None, gtk.DIALOG_MODAL,
(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
hbox = gtk.HBox(False, 12)
hbox.set_border_width(12)
dialog.vbox.pack_start(hbox, True, True, 0)
hbox.show()
label = gtk.Label(str(msg))
hbox.pack_start(label, False, False, 0)
label.show()
dialog.run()
dialog.destroy()
}}}
''arbiter.py''
{{{
def do_close_activity(self):
self.__activity.close() # sugar: closes activity
}}}
--
Ticket URL: <http://dev.laptop.org/ticket/9125>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system
More information about the Bugs
mailing list