From e5afffff50a746ebf3df3d8cacaf094e3f6e08c1 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 30 Oct 2015 13:03:05 -0300 Subject: [feat] add ui message to help new mail users Add a UI message for the user to know where to go next. This message goes away after 60 seconds or right after a MUA logs in. - Resolves: #7552 --- src/leap/bitmask/gui/mail_status.py | 17 ++++++ src/leap/bitmask/gui/ui/mail_status.ui | 105 ++++++++++++++++++++------------- 2 files changed, 82 insertions(+), 40 deletions(-) (limited to 'src/leap/bitmask/gui') diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index eebae49b..8b4329d7 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -58,6 +58,8 @@ class MailStatusWidget(QtGui.QWidget): self.ui = Ui_MailStatusWidget() self.ui.setupUi(self) + self.ui.lblMailReadyHelp.setVisible(False) + # set systray tooltip status self._mx_status = "" self._service_name = get_service_display_name(MX_SERVICE) @@ -103,6 +105,8 @@ class MailStatusWidget(QtGui.QWidget): callback=self._mail_handle_imap_events) register(event=catalog.SMTP_SERVICE_STARTED, callback=self._mail_handle_imap_events) + register(event=catalog.IMAP_CLIENT_LOGIN, + callback=self._mail_handle_imap_events) self._soledad_event.connect( self._mail_handle_soledad_events_slot) @@ -415,6 +419,10 @@ class MailStatusWidget(QtGui.QWidget): self._show_unread_mails() elif event == catalog.IMAP_SERVICE_STARTED: self._imap_started = True + elif event == catalog.IMAP_CLIENT_LOGIN: + # If a MUA has logged in then we don't need to show this. + self._hide_mail_ready_help() + if ext_status is not None: self._set_mail_status(ext_status, ready=1) @@ -483,6 +491,15 @@ class MailStatusWidget(QtGui.QWidget): """ self._set_mail_status(self.tr("ON"), 2) + # this help message will hide when the MUA connects + self.ui.lblMailReadyHelp.setVisible(True) + + def _hide_mail_ready_help(self): + """ + Hide the mail help message on the UI. + """ + self.ui.lblMailReadyHelp.setVisible(False) + def mail_state_disabled(self): """ Display the correct UI for the disabled state. diff --git a/src/leap/bitmask/gui/ui/mail_status.ui b/src/leap/bitmask/gui/ui/mail_status.ui index 6fd63aec..8e8f1848 100644 --- a/src/leap/bitmask/gui/ui/mail_status.ui +++ b/src/leap/bitmask/gui/ui/mail_status.ui @@ -6,12 +6,12 @@ 0 0 - 400 - 79 + 417 + 185 - + 0 0 @@ -23,9 +23,9 @@ 0 - + - + Qt::Horizontal @@ -38,17 +38,20 @@ - - - - color: rgb(80, 80, 80); + + + + + 0 + 0 + - You must login to use encrypted email. + Email - + @@ -67,47 +70,69 @@ - - - - - 0 - 0 - + + + + false + + + background-color: #e0efd8; +padding: 10px; + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 - Email + Congratulations! You are ready to use Bitmask to encrypt your email. Go to <a href="https://bitmask.net/en/help/email">https://bitmask.net/en/help/email</a> for instructions on how to set up your mail client. + + + Qt::AutoText + + + false + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + 0 + + + -1 - - - Qt::Vertical + + + - - QSizePolicy::Fixed + + :/images/black/32/email.png - - - 0 - 5 - + + + + + + color: rgb(80, 80, 80); - + + You must login to use encrypted email. + + - - - - - - - :/images/black/32/email.png - - - -- cgit v1.2.3