Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/model/homeactivity.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-02-21 16:28:49 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-02-21 16:28:49 (GMT)
commitf5b13b716e86f18d0d9c624b9381d9d721b4c892 (patch)
treeca73eb7aa869e15e80fc9331e1d6f9198b043e0c /shell/model/homeactivity.py
parentc05b179675afd326ca80540cd55cfd1900e2970f (diff)
Do not expose the service names from Activity.
This create quite a bit of duplication, but I have to start somewhere cleaning this mess :/
Diffstat (limited to 'shell/model/homeactivity.py')
-rw-r--r--shell/model/homeactivity.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/shell/model/homeactivity.py b/shell/model/homeactivity.py
index aff4ee5..4b5a1e3 100644
--- a/shell/model/homeactivity.py
+++ b/shell/model/homeactivity.py
@@ -15,14 +15,18 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import time
-import gobject
import logging
+import gobject
+import dbus
+
from sugar.graphics.iconcolor import IconColor
from sugar.presence import PresenceService
-from sugar.activity import Activity
from sugar import profile
+_ACTIVITY_SERVICE_NAME = "org.laptop.Activity"
+_ACTIVITY_SERVICE_PATH = "/org/laptop/Activity"
+
class HomeActivity(gobject.GObject):
__gsignals__ = {
'launch-timeout': (gobject.SIGNAL_RUN_FIRST,
@@ -69,7 +73,10 @@ class HomeActivity(gobject.GObject):
self._window = window
self._xid = window.get_xid()
- self._service = Activity.get_service(window.get_xid())
+
+ bus = dbus.SessionBus()
+ self._service = bus.get_object(_ACTIVITY_SERVICE_NAME + '%d' % self._xid,
+ _ACTIVITY_SERVICE_PATH + "/%s" % self._xid)
# verify id and type details
act_id = self._service.get_id()
@@ -79,6 +86,9 @@ class HomeActivity(gobject.GObject):
if act_type != self._type:
raise RuntimeError("Activity's real type (%s) didn't match expected (%s)." % (act_type, self._type))
+ def get_service(self):
+ return self._service
+
def get_title(self):
if not self._launched:
raise RuntimeError("Activity is still launching.")