Commit 569ee2b4 authored by Dan Pascu's avatar Dan Pascu

Modified how sipsimple is started

parent ae59a3de
...@@ -129,17 +129,19 @@ class Blink(QApplication): ...@@ -129,17 +129,19 @@ class Blink(QApplication):
session_manager = SessionManager() session_manager = SessionManager()
session_manager.initialize(self.main_window, self.main_window.session_model) session_manager.initialize(self.main_window, self.main_window.session_model)
notification_center = NotificationCenter()
notification_center.add_observer(self, sender=self.sip_application)
branding.setup(self) branding.setup(self)
def run(self): def run(self):
from blink.util import call_in_gui_thread as call_later self.first_run = not os.path.exists(ApplicationData.get('config'))
call_later(self._initialize_sipsimple) # initialize sipsimple after the qt event loop is started self.sip_application.start(FileStorage(ApplicationData.directory))
self.exec_() self.exec_()
self.update_manager.shutdown() self.update_manager.shutdown()
self.sip_application.stop() self.sip_application.stop()
self.sip_application.thread.join() self.sip_application.thread.join()
log_manager = LogManager() self.log_manager.stop()
log_manager.stop()
def fetch_account(self): def fetch_account(self):
filename = os.path.expanduser('~/.blink_account') filename = os.path.expanduser('~/.blink_account')
...@@ -255,11 +257,4 @@ class Blink(QApplication): ...@@ -255,11 +257,4 @@ class Blink(QApplication):
def _NH_SIPApplicationDidEnd(self, notification): def _NH_SIPApplicationDidEnd(self, notification):
self.presence_manager.stop() self.presence_manager.stop()
def _initialize_sipsimple(self):
if not os.path.exists(ApplicationData.get('config')):
self.first_run = True
notification_center = NotificationCenter()
notification_center.add_observer(self, sender=self.sip_application)
self.sip_application.start(FileStorage(ApplicationData.directory))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment