Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ActivityHost.py
blob: 540d1e247ed7e0259f94fe7aa0582998bf72333b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import gtk
import dbus

from sugar.activity import Activity
from PeopleWindow import PeopleWindow

class ActivityHost:
	def __init__(self, shell, xid):
		self._shell = shell
		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._default_type = self._activity.get_default_type()
		self._window = gtk.gdk.window_foreign_new(xid)
		self._people_window = PeopleWindow(shell, self)

	def get_id(self):
		return self._id

	def share(self):
		self._people_window.share()
		self._activity.share()

	def get_shared(self):
		return self._activity.get_shared()

	def get_default_type(self):
		return self._default_type

	def show_people(self):
		self.show_dialog(self._people_window)

	def show_dialog(self, dialog):
		dialog.show()
		dialog.window.set_transient_for(self._window)