diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-06-07 09:48:57 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-06-07 09:48:57 (GMT) |
commit | 438e2df989ced05dbeecba8fc45f166342ab2545 (patch) | |
tree | 9020084cbfac9b74da82ee60dcbaa851cbef19bc /src/model | |
parent | d0ba3b63ec337793c9d6446810e055ebd18f22c8 (diff) |
Refactor and complete launching status signals.
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/homemodel.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/model/homemodel.py b/src/model/homemodel.py index 1a42969..cae961e 100644 --- a/src/model/homemodel.py +++ b/src/model/homemodel.py @@ -42,14 +42,20 @@ class HomeModel(gobject.GObject): 'activity-added': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([gobject.TYPE_PYOBJECT])), - 'activity-started': (gobject.SIGNAL_RUN_FIRST, - gobject.TYPE_NONE, - ([gobject.TYPE_PYOBJECT])), 'activity-removed': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([gobject.TYPE_PYOBJECT])), 'active-activity-changed': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, + ([gobject.TYPE_PYOBJECT])), + 'launch-started': (gobject.SIGNAL_RUN_FIRST, + gobject.TYPE_NONE, + ([gobject.TYPE_PYOBJECT])), + 'launch-completed': (gobject.SIGNAL_RUN_FIRST, + gobject.TYPE_NONE, + ([gobject.TYPE_PYOBJECT])), + 'launch-failed': (gobject.SIGNAL_RUN_FIRST, + gobject.TYPE_NONE, ([gobject.TYPE_PYOBJECT])) } @@ -151,7 +157,7 @@ class HomeModel(gobject.GObject): home_activity.set_window(window) home_activity.props.launching = False - self.emit('activity-started', home_activity) + self.emit('launch-completed', home_activity) if self._active_activity is None: self._set_active_activity(home_activity) @@ -229,6 +235,8 @@ class HomeModel(gobject.GObject): home_activity.props.launching = True self._add_activity(home_activity) + self.emit('launch-started', home_activity) + # FIXME: better learn about finishing processes by receiving a signal. # Now just check whether an activity has a window after ~90sec gobject.timeout_add(90000, self._check_activity_launched, activity_id) @@ -244,6 +252,8 @@ class HomeModel(gobject.GObject): logging.error('Model for activity id %s does not exist.' % activity_id) + self.emit('launch-failed', home_activity) + def _check_activity_launched(self, activity_id): home_activity = self._get_activity_by_id(activity_id) if home_activity and home_activity.props.launching: |