summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/mail_status.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-10-18 09:34:47 -0300
committerTomás Touceda <chiiph@leap.se>2013-10-18 09:34:47 -0300
commita06b5719f028e619a4b3800fb346ed3c984e4d25 (patch)
treeb177a28201d647731797efb25c19fd9b3a311c9a /src/leap/bitmask/gui/mail_status.py
parent932dcf596177b93c0b0f9e876be74be314fb6037 (diff)
parentf673b84a9a9b0fea3f6bbfefbb38cbd3d311cf3c (diff)
Merge branch 'release-0.3.5'
Diffstat (limited to 'src/leap/bitmask/gui/mail_status.py')
-rw-r--r--src/leap/bitmask/gui/mail_status.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py
index ab9052d7..83533666 100644
--- a/src/leap/bitmask/gui/mail_status.py
+++ b/src/leap/bitmask/gui/mail_status.py
@@ -35,7 +35,6 @@ class MailStatusWidget(QtGui.QWidget):
"""
Status widget that displays the state of the LEAP Mail service
"""
- eip_connection_connected = QtCore.Signal()
_soledad_event = QtCore.Signal(object)
_smtp_event = QtCore.Signal(object)
_imap_event = QtCore.Signal(object)
@@ -193,6 +192,17 @@ class MailStatusWidget(QtGui.QWidget):
leap_assert_type(action_mail_status, QtGui.QAction)
self._action_mail_status = action_mail_status
+ def set_soledad_failed(self):
+ """
+ SLOT
+ TRIGGER:
+ SoledadBootstrapper.soledad_failed
+
+ This method is called whenever soledad has a failure.
+ """
+ msg = self.tr("There was an unexpected problem with Soledad.")
+ self._set_mail_status(msg, ready=-1)
+
def _set_mail_status(self, status, ready=0):
"""
Sets the Mail status in the label and in the tray icon.
@@ -377,8 +387,11 @@ class MailStatusWidget(QtGui.QWidget):
self._set_mail_status(self.tr("Failed"))
elif req.event == proto.IMAP_UNREAD_MAIL:
if self._smtp_started and self._imap_started:
- self._set_mail_status(self.tr("%s Unread Emails") %
- (req.content), ready=2)
+ if req.content != "0":
+ self._set_mail_status(self.tr("%s Unread Emails") %
+ (req.content,), ready=2)
+ else:
+ self._set_mail_status("", ready=2)
else:
leap_assert(False, # XXX ???
"Don't know how to handle this state: %s"