This should fix one-to-one chat, can't test now though

This commit is contained in:
Marco Pesenti Gritti 2006-07-06 23:08:35 +02:00
parent fbb2621fff
commit 270bb8aaf6
2 changed files with 13 additions and 13 deletions

View File

@ -50,15 +50,7 @@ class ChatShellDbusService(dbus.service.Object):
def open_chat(self, serialized_service): def open_chat(self, serialized_service):
self._parent.open_chat(Service.deserialize(serialized_service)) self._parent.open_chat(Service.deserialize(serialized_service))
class ChatShell: class ChatListener:
instance = None
def get_instance():
if not ChatShell.instance:
ChatShell.instance = ChatShell()
return ChatShell.instance
get_instance = staticmethod(get_instance)
def __init__(self): def __init__(self):
ChatShellDbusService(self) ChatShellDbusService(self)
@ -104,7 +96,6 @@ class ChatShell:
chat.connect_to_shell() chat.connect_to_shell()
return False return False
chat_shell = ChatShell.get_instance() def start():
chat_shell.start() chat_listener = ChatListener()
chat_listener.start()
gtk.main()

View File

@ -42,6 +42,15 @@ class ActivityFactory(dbus.service.Object):
(fp, pathname, description) = imp.find_module(module_name) (fp, pathname, description) = imp.find_module(module_name)
module = imp.load_module(module_name, fp, pathname, description) module = imp.load_module(module_name, fp, pathname, description)
try:
start = getattr(module, 'start')
except:
start = None
if start:
start()
self._class = getattr(module, class_name) self._class = getattr(module, class_name)
bus = dbus.SessionBus() bus = dbus.SessionBus()