Add a start method to the activity module, for initialization.

This commit is contained in:
Marco Pesenti Gritti 2006-09-26 22:12:18 +02:00
parent 5d78b148ff
commit 72d43fde28
2 changed files with 8 additions and 6 deletions

View File

@ -17,11 +17,6 @@ class BrowserActivity(Activity):
def __init__(self):
Activity.__init__(self)
gtkmozembed.push_startup()
gtkmozembed.set_profile_path(env.get_profile_path(), 'gecko')
gecko.startup()
self._share_service = None
self._model_service = None
self._notif_service = None
@ -132,3 +127,8 @@ class BrowserActivity(Activity):
def _destroy_cb(self, window):
if self._model:
self._model.shutdown()
def start():
gtkmozembed.set_profile_path(env.get_profile_path(), 'gecko')
gtkmozembed.push_startup()
gecko.startup()

View File

@ -29,7 +29,9 @@ class ActivityFactory(dbus.service.Object):
module = __import__(module_name)
for comp in module_name.split('.')[1:]:
module = getattr(module, comp)
if hasattr(module, 'start'):
module.start()
self._class = getattr(module, class_name)
bus = dbus.SessionBus()