diff --git a/amsn2/core/amsn.py b/amsn2/core/amsn.py index 24c2e4fa..c29abce1 100644 --- a/amsn2/core/amsn.py +++ b/amsn2/core/amsn.py @@ -67,19 +67,17 @@ def __init__(self, options): self._gui = None self._loop = None self._main = None + self._account = None self.loadUI(self._options.front_end) self._backend_manager = aMSNBackendManager(self) self._account_manager = aMSNAccountManager(self, options) - self._account = None self._theme_manager = aMSNThemeManager(self) self._contactlist_manager = aMSNContactListManager(self) self._oim_manager = aMSNOIMManager(self) self._conversation_manager = aMSNConversationManager(self) self._personalinfo_manager = aMSNPersonalInfoManager(self) - - # TODO: redirect the logs somewhere, something like ctrl-s ctrl-d for amsn-0.9x logging.basicConfig(level=logging.WARNING) @@ -105,6 +103,9 @@ def loadUI(self, ui_name): self._gui_name = ui_name self._gui = gui.GUIManager(self, self._gui_name) + if not self._gui.gui: + print "Unable to load UI %s" %(self._gui_name,) + self.quit() self._loop = self._gui.gui.aMSNMainLoop(self) self._main = self._gui.gui.aMSNMainWindow(self) self._skin_manager = self._gui.gui.SkinManager(self) @@ -211,10 +212,12 @@ def timerAdd(self, delay, func): self._loop.timerAdd(delay, func) def quit(self): - if self._account is not None: + if self._account: self._account.signOut() - self._loop.quit() + if self._loop: + self._loop.quit() logging.shutdown() + exit(0) # TODO: move to UImanager def addContact(self):