sugar-toolkit-gtk3/shell/ActivityHost.py

41 lines
1003 B
Python
Raw Normal View History

import gtk
import dbus
from sugar.activity import Activity
2006-07-26 12:57:54 +02:00
from PeopleWindow import PeopleWindow
class ActivityHost:
2006-07-26 12:57:54 +02:00
def __init__(self, shell, xid):
self._shell = shell
self._xid = xid
bus = dbus.SessionBus()
path = Activity.ACTIVITY_SERVICE_PATH + "/%s" % xid
proxy_obj = bus.get_object(Activity.ACTIVITY_SERVICE_NAME, path)
self._activity = dbus.Interface(proxy_obj, Activity.ACTIVITY_INTERFACE)
self._id = self._activity.get_id()
self._default_type = self._activity.get_default_type()
self._window = gtk.gdk.window_foreign_new(xid)
2006-07-26 12:57:54 +02:00
self._people_window = PeopleWindow(shell, self)
def get_id(self):
return self._id
2006-07-26 00:17:05 +02:00
def share(self):
2006-07-26 12:57:54 +02:00
self._people_window.share()
2006-07-26 00:17:05 +02:00
self._activity.share()
def get_shared(self):
return self._activity.get_shared()
def get_default_type(self):
return self._default_type
2006-07-26 12:57:54 +02:00
def show_people(self):
self.show_dialog(self._people_window)
def show_dialog(self, dialog):
dialog.show()
dialog.window.set_transient_for(self._window)