Forgot to commit changes... This breaks one-to-one chat,
I'm going to fix it.
This commit is contained in:
+3
-15
@@ -2,7 +2,6 @@ import pygtk
|
||||
pygtk.require('2.0')
|
||||
import gtk
|
||||
import pango
|
||||
import dbus
|
||||
import cgi
|
||||
import xml.sax.saxutils
|
||||
import gobject
|
||||
@@ -10,6 +9,7 @@ import socket
|
||||
|
||||
from google import google
|
||||
from sugar.presence.PresenceService import PresenceService
|
||||
from sugar.activity import Activity
|
||||
|
||||
from gettext import gettext as _
|
||||
|
||||
@@ -150,24 +150,12 @@ class ActivitiesView(gtk.TreeView):
|
||||
self._owner = owner
|
||||
|
||||
def _row_activated_cb(self, treeview, path, column):
|
||||
bus = dbus.SessionBus()
|
||||
proxy_obj = bus.get_object('com.redhat.Sugar.Browser', '/com/redhat/Sugar/Browser')
|
||||
browser_shell = dbus.Interface(proxy_obj, 'com.redhat.Sugar.BrowserShell')
|
||||
|
||||
model = self.get_model()
|
||||
address = model.get_value(model.get_iter(path), _COLUMN_ADDRESS)
|
||||
service = model.get_value(model.get_iter(path), _COLUMN_SERVICE)
|
||||
|
||||
print 'Activated row %s' % address
|
||||
|
||||
if service is None:
|
||||
browser_shell.open_browser(address)
|
||||
else:
|
||||
if not self._owner:
|
||||
raise RuntimeError("We don't have an owner yet!")
|
||||
serialized_service = service.serialize(self._owner)
|
||||
browser_shell.open_browser(address, serialized_service)
|
||||
|
||||
Activity.create('com.redhat.Sugar.BrowserActivity', service, [ address ])
|
||||
|
||||
class StartPage(gtk.HBox):
|
||||
def __init__(self, ac_signal_object):
|
||||
gtk.HBox.__init__(self)
|
||||
|
||||
@@ -8,6 +8,7 @@ import gtk
|
||||
|
||||
from shell import Shell
|
||||
from sugar import env
|
||||
from sugar.activity import Activity
|
||||
|
||||
class Session:
|
||||
def __init__(self):
|
||||
@@ -42,20 +43,21 @@ class Session:
|
||||
def _run_activity(self, activity_dir):
|
||||
env.add_to_python_path(activity_dir)
|
||||
|
||||
activities = []
|
||||
for filename in os.listdir(activity_dir):
|
||||
if filename.endswith(".activity"):
|
||||
path = os.path.join(activity_dir, filename)
|
||||
cp = ConfigParser()
|
||||
cp.read([path])
|
||||
python_class = cp.get('Activity', "python_class")
|
||||
activities.append(python_class)
|
||||
|
||||
for activity in activities:
|
||||
args = [ 'python', '-m', activity ]
|
||||
pid = os.spawnvp(os.P_NOWAIT, 'python', args)
|
||||
self._activity_processes[activity] = pid
|
||||
|
||||
activity_name = cp.get('Activity', "name")
|
||||
activity_class = cp.get('Activity', "class")
|
||||
|
||||
args = [ 'python', '-m', 'sugar/activity/Activity' ]
|
||||
args.append(activity_name)
|
||||
args.append(activity_class)
|
||||
pid = os.spawnvp(os.P_NOWAIT, 'python', args)
|
||||
self._activity_processes[activity_name] = pid
|
||||
|
||||
def _shell_close_cb(self, shell):
|
||||
self.shutdown()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user