Misc shell activity launch fixes

also switch to home screen when launching an activity so we can
get feedback on launch status
This commit is contained in:
Dan Williams 2007-01-08 17:05:55 -05:00
parent 39e116433c
commit 946a8f1b42

View File

@ -183,6 +183,8 @@ class Shell(gobject.GObject):
self._hosts[activity_host.get_xid()] = activity_host self._hosts[activity_host.get_xid()] = activity_host
def _activity_removed_cb(self, home_model, home_activity): def _activity_removed_cb(self, home_model, home_activity):
if not home_activity.get_launched():
return
xid = home_activity.get_xid() xid = home_activity.get_xid()
if self._hosts.has_key(xid): if self._hosts.has_key(xid):
self._hosts[xid].destroy() self._hosts[xid].destroy()
@ -277,7 +279,7 @@ class Shell(gobject.GObject):
def _start_error_cb(self, handler, err, home_model, activity_id, activity_type): def _start_error_cb(self, handler, err, home_model, activity_id, activity_type):
logging.error("Couldn't launch activity %s (%s):\n%s" % (activity_id, activity_type, err)) logging.error("Couldn't launch activity %s (%s):\n%s" % (activity_id, activity_type, err))
home_mode.notify_activity_launch_failed(activity_id) home_model.notify_activity_launch_failed(activity_id)
def start_activity(self, activity_type): def start_activity(self, activity_type):
logging.debug('Shell.start_activity') logging.debug('Shell.start_activity')
@ -294,6 +296,9 @@ class Shell(gobject.GObject):
handler.connect('success', self._start_success_cb, act_id, activity_type) handler.connect('success', self._start_success_cb, act_id, activity_type)
handler.connect('error', self._start_error_cb, home_model, act_id, activity_type) handler.connect('error', self._start_error_cb, home_model, act_id, activity_type)
# Zoom to Home for launch feedback
self.set_zoom_level(sugar.ZOOM_HOME)
def set_zoom_level(self, level): def set_zoom_level(self, level):
if level == sugar.ZOOM_ACTIVITY: if level == sugar.ZOOM_ACTIVITY:
self._screen.toggle_showing_desktop(False) self._screen.toggle_showing_desktop(False)