Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco 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)
commit438e2df989ced05dbeecba8fc45f166342ab2545 (patch)
tree9020084cbfac9b74da82ee60dcbaa851cbef19bc /src
parentd0ba3b63ec337793c9d6446810e055ebd18f22c8 (diff)
Refactor and complete launching status signals.
Diffstat (limited to 'src')
-rw-r--r--src/model/homemodel.py18
-rw-r--r--src/view/Shell.py4
2 files changed, 16 insertions, 6 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:
diff --git a/src/view/Shell.py b/src/view/Shell.py
index 6da4790..9fdd928 100644
--- a/src/view/Shell.py
+++ b/src/view/Shell.py
@@ -66,7 +66,7 @@ class Shell(gobject.GObject):
self._home_window.show()
home_model = self._model.get_home()
- home_model.connect('activity-started', self._activity_started_cb)
+ home_model.connect('launch-completed', self._launch_completed_cb)
home_model.connect('activity-removed', self._activity_removed_cb)
home_model.connect('active-activity-changed',
self._active_activity_changed_cb)
@@ -92,7 +92,7 @@ class Shell(gobject.GObject):
if registry.get_activity('org.laptop.JournalActivity'):
self.start_activity('org.laptop.JournalActivity')
- def _activity_started_cb(self, home_model, home_activity):
+ def _launch_completed_cb(self, home_model, home_activity):
activity_host = ActivityHost(home_activity)
self._hosts[activity_host.get_xid()] = activity_host
if home_activity.get_type() in self._activities_starting: