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 10:10:22 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2008-06-07 10:10:22 (GMT)
commite623294eaab90af4549e730c1bf038ac29a2682b (patch)
treecb6e14fcf32bb4ec8e87449d94863f9842b3f7dc /src
parent438e2df989ced05dbeecba8fc45f166342ab2545 (diff)
Shell service notify launch status directly to the model.
The shell view listen to the model.
Diffstat (limited to 'src')
-rw-r--r--src/model/homemodel.py6
-rw-r--r--src/shellservice.py6
-rw-r--r--src/view/Shell.py20
3 files changed, 14 insertions, 18 deletions
diff --git a/src/model/homemodel.py b/src/model/homemodel.py
index cae961e..fa7a635 100644
--- a/src/model/homemodel.py
+++ b/src/model/homemodel.py
@@ -224,7 +224,7 @@ class HomeModel(gobject.GObject):
else:
logging.error('Model for window %d does not exist.' % xid)
- def notify_activity_launch(self, activity_id, service_name):
+ def notify_launch(self, activity_id, service_name):
registry = activity.get_registry()
activity_info = registry.get_activity(service_name)
if not activity_info:
@@ -241,7 +241,7 @@ class HomeModel(gobject.GObject):
# Now just check whether an activity has a window after ~90sec
gobject.timeout_add(90000, self._check_activity_launched, activity_id)
- def notify_activity_launch_failed(self, activity_id):
+ def notify_launch_failed(self, activity_id):
home_activity = self._get_activity_by_id(activity_id)
if home_activity:
logging.debug("Activity %s (%s) launch failed" % \
@@ -259,5 +259,5 @@ class HomeModel(gobject.GObject):
if home_activity and home_activity.props.launching:
logging.debug('Activity %s still launching, assuming it failed...'
% activity_id)
- self.notify_activity_launch_failed(activity_id)
+ self.notify_launch_failed(activity_id)
return False
diff --git a/src/shellservice.py b/src/shellservice.py
index 3d90779..706f2f2 100644
--- a/src/shellservice.py
+++ b/src/shellservice.py
@@ -79,12 +79,14 @@ class ShellService(dbus.service.Object):
@dbus.service.method(_DBUS_SHELL_IFACE,
in_signature="ss", out_signature="")
def NotifyLaunch(self, bundle_id, activity_id):
- self._shell.notify_launch(bundle_id, activity_id)
+ home = self._shell.get_model().get_home()
+ home.notify_launch(activity_id, bundle_id)
@dbus.service.method(_DBUS_SHELL_IFACE,
in_signature="s", out_signature="")
def NotifyLaunchFailure(self, activity_id):
- self._shell.notify_launch_failure(activity_id)
+ home = self._shell.get_model().get_home()
+ home.notify_launch_failed(activity_id)
@dbus.service.signal(_DBUS_OWNER_IFACE, signature="s")
def ColorChanged(self, color):
diff --git a/src/view/Shell.py b/src/view/Shell.py
index 9fdd928..41f83a3 100644
--- a/src/view/Shell.py
+++ b/src/view/Shell.py
@@ -66,7 +66,8 @@ class Shell(gobject.GObject):
self._home_window.show()
home_model = self._model.get_home()
- home_model.connect('launch-completed', self._launch_completed_cb)
+ home_model.connect('launch-started', self.__launch_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 +93,11 @@ class Shell(gobject.GObject):
if registry.get_activity('org.laptop.JournalActivity'):
self.start_activity('org.laptop.JournalActivity')
- def _launch_completed_cb(self, home_model, home_activity):
+ def __launch_started_cb(self, home_model, home_activity):
+ # Zoom to Home for launch feedback
+ self.set_zoom_level(shellmodel.ShellModel.ZOOM_HOME)
+
+ 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:
@@ -141,17 +146,6 @@ class Shell(gobject.GObject):
handle = ActivityHandle(activity_id)
activityfactory.create(bundle_id, handle)
- def notify_launch(self, bundle_id, activity_id):
- # Zoom to Home for launch feedback
- self.set_zoom_level(shellmodel.ShellModel.ZOOM_HOME)
-
- home_model = self._model.get_home()
- home_model.notify_activity_launch(activity_id, bundle_id)
-
- def notify_launch_failure(self, activity_id):
- home_model = self._model.get_home()
- home_model.notify_activity_launch_failed(activity_id)
-
def start_activity(self, activity_type):
if activity_type in self._activities_starting:
logging.debug("This activity is still launching.")