Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/model
diff options
context:
space:
mode:
Diffstat (limited to 'shell/model')
-rw-r--r--shell/model/homeactivity.py22
-rw-r--r--shell/model/homemodel.py18
2 files changed, 14 insertions, 26 deletions
diff --git a/shell/model/homeactivity.py b/shell/model/homeactivity.py
index 3358bf3..f79bcc8 100644
--- a/shell/model/homeactivity.py
+++ b/shell/model/homeactivity.py
@@ -24,6 +24,10 @@ from sugar.graphics.xocolor import XoColor
from sugar.presence import presenceservice
from sugar import profile
+_SERVICE_NAME = "org.laptop.Activity"
+_SERVICE_PATH = "/org/laptop/Activity"
+_SERVICE_INTERFACE = "org.laptop.Activity"
+
class HomeActivity(gobject.GObject):
"""Activity which appears in the "Home View" of the Sugar shell
@@ -70,9 +74,6 @@ class HomeActivity(gobject.GObject):
self._window = window
self._xid = window.get_xid()
- def set_service(self, service):
- self._service = service
-
def get_service(self):
"""Retrieve the application's sugar introspection service
@@ -80,7 +81,16 @@ class HomeActivity(gobject.GObject):
such a service, so the return value will be None in
those cases.
"""
- return self._service
+ bus = dbus.SessionBus()
+ try:
+ service = dbus.Interface(
+ bus.get_object(_SERVICE_NAME + self._activity_id,
+ _SERVICE_PATH + "/" + self._activity_id),
+ _SERVICE_INTERFACE)
+ except dbus.DBusException:
+ service = None
+
+ return service
def get_title(self):
"""Retrieve the application's root window's suggested title"""
@@ -142,10 +152,6 @@ class HomeActivity(gobject.GObject):
else:
return None
- def get_shared(self):
- """Return whether this activity is using Presence service sharing"""
- return self._service.get_shared()
-
def get_launch_time(self):
"""Return the time at which the activity was first launched
diff --git a/shell/model/homemodel.py b/shell/model/homemodel.py
index ba0a781..e935f66 100644
--- a/shell/model/homemodel.py
+++ b/shell/model/homemodel.py
@@ -25,10 +25,6 @@ from sugar import wm
from model.homeactivity import HomeActivity
from model import bundleregistry
-_SERVICE_NAME = "org.laptop.Activity"
-_SERVICE_PATH = "/org/laptop/Activity"
-_SERVICE_INTERFACE = "org.laptop.Activity"
-
class HomeModel(gobject.GObject):
"""Model of the "Home" view (activity management)
@@ -105,8 +101,6 @@ class HomeModel(gobject.GObject):
activity = HomeActivity(bundle, activity_id)
self._add_activity(activity)
- service = self._get_activity_service(activity_id)
- activity.set_service(service)
activity.set_window(window)
activity.props.launching = False
@@ -166,18 +160,6 @@ class HomeModel(gobject.GObject):
self.emit('active-activity-changed', self._current_activity)
- def _get_activity_service(self, activity_id):
- bus = dbus.SessionBus()
- try:
- service = dbus.Interface(
- bus.get_object(_SERVICE_NAME + activity_id,
- _SERVICE_PATH + "/" + activity_id),
- _SERVICE_INTERFACE)
- except dbus.DBusException:
- service = None
-
- return service
-
def _add_activity(self, activity):
self._activities.append(activity)
self.emit('activity-added', activity)