Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[CORE] exit when we can't load the UI

  • Loading branch information...
commit 10ac7bd56e3856f34039f7bf4ebadd7e7c8c6b3f 1 parent e8e4639
@billiob billiob authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 amsn2/core/amsn.py
View
13 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):
Please sign in to comment.
Something went wrong with that request. Please try again.