Several fixes and cleanups
This commit is contained in:
@@ -5,18 +5,19 @@ from sugar.activity import Activity
|
||||
from PeopleWindow import PeopleWindow
|
||||
|
||||
class ActivityHost:
|
||||
def __init__(self, shell, xid):
|
||||
def __init__(self, shell, window):
|
||||
self._shell = shell
|
||||
self._xid = xid
|
||||
|
||||
|
||||
xid = window.get_xid()
|
||||
|
||||
bus = dbus.SessionBus()
|
||||
path = Activity.ACTIVITY_SERVICE_PATH + "/%s" % xid
|
||||
proxy_obj = bus.get_object(Activity.ACTIVITY_SERVICE_NAME, path)
|
||||
proxy_obj = bus.get_object(Activity.get_service_name(xid),
|
||||
Activity.get_object_path(xid))
|
||||
|
||||
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)
|
||||
self._window = gtk.gdk.window_foreign_new(window.get_xid())
|
||||
self._people_window = PeopleWindow(shell, self)
|
||||
|
||||
def get_id(self):
|
||||
|
||||
@@ -111,7 +111,7 @@ class PresenceView(gtk.VBox):
|
||||
if buddy:
|
||||
chat_service = buddy.get_service_of_type(BuddyChat.SERVICE_TYPE)
|
||||
activity = self._shell.start_activity('com.redhat.Sugar.ChatActivity')
|
||||
#activity.execute('start', [chat_service.object_path()])
|
||||
activity.execute('start', [chat_service.object_path()])
|
||||
|
||||
def __buddy_icon_changed_cb(self, buddy):
|
||||
it = self._get_iter_for_buddy(buddy)
|
||||
|
||||
+2
-2
@@ -17,6 +17,7 @@ from sugar.presence.PresenceService import PresenceService
|
||||
from ActivityHost import ActivityHost
|
||||
from ChatController import ChatController
|
||||
from sugar.activity import ActivityFactory
|
||||
from sugar.activity import Activity
|
||||
|
||||
class ShellDbusService(dbus.service.Object):
|
||||
def __init__(self, shell, bus_name):
|
||||
@@ -73,8 +74,7 @@ class Shell:
|
||||
|
||||
def __window_opened_cb(self, screen, window):
|
||||
if window.get_window_type() == wnck.WINDOW_NORMAL:
|
||||
xid = window.get_xid()
|
||||
self._hosts[xid] = ActivityHost(self, xid)
|
||||
self._hosts[window.get_xid()] = ActivityHost(self, window)
|
||||
|
||||
def __window_closed_cb(self, screen, window):
|
||||
if window.get_window_type() == wnck.WINDOW_NORMAL:
|
||||
|
||||
Reference in New Issue
Block a user