Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ActivityHost.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-07-20 09:34:06 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-07-20 09:34:06 (GMT)
commit87cb115aa0155291d2473537a3fa2da1400c174f (patch)
tree674da5aa0e2ca7115de8ebf725ce04aba4591e3e /shell/ActivityHost.py
parent53947aaaf2db8aa7c5b0229f06730626666f870b (diff)
Abstract activity on the shell side into an ActivityHost object.
Comment out/fix more ps borkage.
Diffstat (limited to 'shell/ActivityHost.py')
-rw-r--r--shell/ActivityHost.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/shell/ActivityHost.py b/shell/ActivityHost.py
new file mode 100644
index 0000000..c9d6dcb
--- /dev/null
+++ b/shell/ActivityHost.py
@@ -0,0 +1,30 @@
+import gtk
+import dbus
+
+from sugar.activity import Activity
+
+class ActivityHost:
+ def __init__(self, xid):
+ self._xid = xid
+
+ bus = dbus.SessionBus()
+ service = Activity.ACTIVITY_SERVICE_NAME + "%s" % xid
+ path = Activity.ACTIVITY_SERVICE_PATH + "/%s" % xid
+ proxy_obj = bus.get_object(service, path)
+
+ self._activity = dbus.Interface(proxy_obj, 'com.redhat.Sugar.Activity')
+ self._id = self._activity.get_id()
+ self._window = gtk.gdk.window_foreign_new(xid)
+
+ def get_id(self):
+ return self._id
+
+ def publish(self):
+ self._activity.publish()
+
+ def get_shared(self):
+ return self._activity.get_shared()
+
+ def show_dialog(self, dialog):
+ dialog.show()
+ dialog.window.set_transient_for(self._window)