Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/jarabe/view/service.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/jarabe/view/service.py')
-rw-r--r--src/jarabe/view/service.py69
1 files changed, 14 insertions, 55 deletions
diff --git a/src/jarabe/view/service.py b/src/jarabe/view/service.py
index fbcc961..29e46b2 100644
--- a/src/jarabe/view/service.py
+++ b/src/jarabe/view/service.py
@@ -1,4 +1,5 @@
# Copyright (C) 2006-2007 Red Hat, Inc.
+# Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,13 +21,13 @@ import dbus
import gtk
from jarabe.model import shell
-from jarabe.model import owner
from jarabe.model import bundleregistry
-_DBUS_SERVICE = "org.laptop.Shell"
-_DBUS_SHELL_IFACE = "org.laptop.Shell"
-_DBUS_OWNER_IFACE = "org.laptop.Shell.Owner"
-_DBUS_PATH = "/org/laptop/Shell"
+
+_DBUS_SERVICE = 'org.laptop.Shell'
+_DBUS_SHELL_IFACE = 'org.laptop.Shell'
+_DBUS_PATH = '/org/laptop/Shell'
+
class UIService(dbus.service.Object):
"""Provides d-bus service to script the shell's operations
@@ -54,17 +55,8 @@ class UIService(dbus.service.Object):
self._shell_model = shell.get_model()
- def start(self):
- owner_model = owner.get_model()
- owner_model.connect('nick-changed', self._owner_nick_changed_cb)
- owner_model.connect('icon-changed', self._owner_icon_changed_cb)
- owner_model.connect('color-changed', self._owner_color_changed_cb)
-
- self._shell_model.connect('active-activity-changed',
- self._cur_activity_changed_cb)
-
@dbus.service.method(_DBUS_SHELL_IFACE,
- in_signature="s", out_signature="s")
+ in_signature='s', out_signature='s')
def GetBundlePath(self, bundle_id):
bundle = bundleregistry.get_registry().get_bundle(bundle_id)
if bundle:
@@ -73,59 +65,26 @@ class UIService(dbus.service.Object):
return ''
@dbus.service.method(_DBUS_SHELL_IFACE,
- in_signature="s", out_signature="b")
+ in_signature='s', out_signature='b')
def ActivateActivity(self, activity_id):
- """Switch to the window related to this activity_id and return a boolean
- indicating if there is a real (ie. not a launcher window) activity
- already open.
+ """Switch to the window related to this activity_id and return a
+ boolean indicating if there is a real (ie. not a launcher window)
+ activity already open.
"""
activity = self._shell_model.get_activity_by_id(activity_id)
if activity is not None and activity.get_window() is not None:
activity.get_window().activate(gtk.get_current_event_time())
- return not activity.props.launching
+ return self._shell_model.get_launcher(activity_id) is None
return False
@dbus.service.method(_DBUS_SHELL_IFACE,
- in_signature="ss", out_signature="")
+ in_signature='ss', out_signature='')
def NotifyLaunch(self, bundle_id, activity_id):
shell.get_model().notify_launch(activity_id, bundle_id)
@dbus.service.method(_DBUS_SHELL_IFACE,
- in_signature="s", out_signature="")
+ in_signature='s', out_signature='')
def NotifyLaunchFailure(self, activity_id):
shell.get_model().notify_launch_failed(activity_id)
-
- @dbus.service.signal(_DBUS_OWNER_IFACE, signature="s")
- def ColorChanged(self, color):
- pass
-
- def _owner_color_changed_cb(self, new_color):
- self.ColorChanged(new_color.to_string())
-
- @dbus.service.signal(_DBUS_OWNER_IFACE, signature="s")
- def NickChanged(self, nick):
- pass
-
- def _owner_nick_changed_cb(self, new_nick):
- self.NickChanged(new_nick)
-
- @dbus.service.signal(_DBUS_OWNER_IFACE, signature="ay")
- def IconChanged(self, icon_data):
- pass
-
- def _owner_icon_changed_cb(self, new_icon):
- self.IconChanged(dbus.ByteArray(new_icon))
-
- @dbus.service.signal(_DBUS_OWNER_IFACE, signature="s")
- def CurrentActivityChanged(self, activity_id):
- pass
-
- def _cur_activity_changed_cb(self, shell_model, new_activity):
- new_id = ""
- if new_activity:
- new_id = new_activity.get_activity_id()
- if new_id:
- self.CurrentActivityChanged(new_id)
-