diff options
author | Kali Kaneko <kali@leap.se> | 2015-07-20 15:08:09 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-07-20 19:15:21 -0400 |
commit | 6188c4f9c5d7ebf9aad1673ad6d08d6d9541afbb (patch) | |
tree | 734f07bf77faadb6f4bd1fc36503bb61a9f5e258 /src | |
parent | bc6c85b14452684c19a215ba7974924e7f1fd3af (diff) |
[refactor] minor reordering of events registration
Also, do not raise assertionerror, log warning instead.
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/bitmask/gui/mail_status.py | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index b5d1df81..bd7e549c 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -71,27 +71,23 @@ class MailStatusWidget(QtGui.QWidget): register(event=catalog.KEYMANAGER_LOOKING_FOR_KEY, callback=self._mail_handle_keymanager_events) - register(event=catalog.KEYMANAGER_KEY_FOUND, callback=self._mail_handle_keymanager_events) - - # register(event=catalog.KEYMANAGER_KEY_NOT_FOUND, - # callback=self._mail_handle_keymanager_events) - + register(event=catalog.KEYMANAGER_KEY_NOT_FOUND, + callback=self._mail_handle_keymanager_events) register(event=catalog.KEYMANAGER_STARTED_KEY_GENERATION, callback=self._mail_handle_keymanager_events) - register(event=catalog.KEYMANAGER_FINISHED_KEY_GENERATION, callback=self._mail_handle_keymanager_events) - register(event=catalog.KEYMANAGER_DONE_UPLOADING_KEYS, callback=self._mail_handle_keymanager_events) register(event=catalog.SOLEDAD_DONE_DOWNLOADING_KEYS, callback=self._mail_handle_soledad_events) - register(event=catalog.SOLEDAD_DONE_UPLOADING_KEYS, callback=self._mail_handle_soledad_events) + register(event=catalog.SOLEDAD_INVALID_AUTH_TOKEN, + callback=self.set_soledad_invalid_auth_token) register(event=catalog.MAIL_UNREAD_MESSAGES, callback=self._mail_handle_imap_events) @@ -100,9 +96,6 @@ class MailStatusWidget(QtGui.QWidget): register(event=catalog.SMTP_SERVICE_STARTED, callback=self._mail_handle_imap_events) - register(event=catalog.SOLEDAD_INVALID_AUTH_TOKEN, - callback=self.set_soledad_invalid_auth_token) - self._soledad_event.connect( self._mail_handle_soledad_events_slot) self._imap_event.connect( @@ -296,8 +289,9 @@ class MailStatusWidget(QtGui.QWidget): ext_status = self.tr("Initial sync in progress, please wait...") elif event == catalog.KEYMANAGER_KEY_FOUND: ext_status = self.tr("Found key! Starting mail...") - # elif event == catalog.KEYMANAGER_KEY_NOT_FOUND: - # ext_status = self.tr("Key not found!") + elif event == catalog.KEYMANAGER_KEY_NOT_FOUND: + ext_status = self.tr( + "Key not found...") elif event == catalog.KEYMANAGER_STARTED_KEY_GENERATION: ext_status = self.tr( "Generating new key, this may take a few minutes.") @@ -306,10 +300,7 @@ class MailStatusWidget(QtGui.QWidget): elif event == catalog.KEYMANAGER_DONE_UPLOADING_KEYS: ext_status = self.tr("Starting mail...") else: - leap_assert(False, - "Don't know how to handle this state: %s" - % (event)) - + logger.warning("don't know to to handle %s" % (event,)) self._set_mail_status(ext_status, ready=1) def _mail_handle_smtp_events(self, event): |