From 1899d12a134d7657a902bd9d4006098a98e02277 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Wed, 6 Nov 2013 15:20:44 -0300 Subject: Add hint about the duration of key generation. [Closes #3958] --- src/leap/bitmask/gui/mail_status.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/leap/bitmask/gui/mail_status.py') diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index c1e82d4d..d637fd52 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -296,7 +296,9 @@ class MailStatusWidget(QtGui.QWidget): # elif req.event == proto.KEYMANAGER_KEY_NOT_FOUND: # ext_status = self.tr("Key not found!") elif req.event == proto.KEYMANAGER_STARTED_KEY_GENERATION: - ext_status = self.tr("Generating new key, please wait...") + ext_status = self.tr( + "Generating new key, please wait... \n" + "(this may take up to 10 minutes depending on the machine)") elif req.event == proto.KEYMANAGER_FINISHED_KEY_GENERATION: ext_status = self.tr("Finished generating key!") elif req.event == proto.KEYMANAGER_DONE_UPLOADING_KEYS: -- cgit v1.2.3 From f3217d074ff20e6973ec382ad78100c77c6af081 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 8 Nov 2013 11:24:13 -0300 Subject: Use display service name instead of hardcode it. --- src/leap/bitmask/gui/mail_status.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/leap/bitmask/gui/mail_status.py') diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index d637fd52..2ca0fb0a 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -22,6 +22,7 @@ import logging from PySide import QtCore, QtGui from leap.bitmask.platform_init import IS_LINUX +from leap.bitmask.services import get_service_display_name, MX_SERVICE from leap.common.check import leap_assert, leap_assert_type from leap.common.events import register from leap.common.events import events_pb2 as proto @@ -58,6 +59,7 @@ class MailStatusWidget(QtGui.QWidget): # set systray tooltip status self._mx_status = "" + self._service_name = get_service_display_name(MX_SERVICE) # Set the Mail status icons self.CONNECTING_ICON = None @@ -213,7 +215,8 @@ class MailStatusWidget(QtGui.QWidget): icon = self.ERROR_ICON if ready == 0: self.ui.lblMailStatus.setText( - self.tr("You must be logged in to use encrypted email.")) + self.tr("You must be logged in to use {0}.").format( + self._service_name)) elif ready == 1: icon = self.CONNECTING_ICON self._mx_status = self.tr('Starting..') @@ -436,5 +439,6 @@ class MailStatusWidget(QtGui.QWidget): Displays the correct UI for the disabled state. """ self._disabled = True - self._set_mail_status( - self.tr("You must be logged in to use encrypted email."), -1) + status = self.tr("You must be logged in to use {0}.").format( + self._service_name) + self._set_mail_status(status, -1) -- cgit v1.2.3 From 6714b423a4ae879e23a82a60480387186e737ab1 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 7 Nov 2013 17:46:02 -0300 Subject: Use custom systray that ease the tooltip use. - Create a custom SysTray that allows us to set services tooltips independently. - Initialize tooltip with service name at start. - Update required service status on tooltip update. [Closes #3998] --- src/leap/bitmask/gui/mail_status.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/leap/bitmask/gui/mail_status.py') diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index 2ca0fb0a..e89fb376 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -152,29 +152,22 @@ class MailStatusWidget(QtGui.QWidget): def set_systray(self, systray): """ - Sets the systray object to use. + Sets the systray object to use and adds the service line for MX. :param systray: Systray object :type systray: QtGui.QSystemTrayIcon """ leap_assert_type(systray, QtGui.QSystemTrayIcon) self._systray = systray - self._systray.setToolTip(self.tr("All services are OFF")) + mx_status = self.tr("{0}: OFF").format(self._service_name) + self._systray.set_service_tooltip(MX_SERVICE, mx_status) def _update_systray_tooltip(self): """ - Updates the system tray icon tooltip using the eip and mx status. - """ - # TODO: Figure out how to handle this with the two status in different - # classes - # XXX right now we could connect the state transition signals of the - # two connection machines (EIP/Mail) to a class that keeps track of the - # state -- kali - # status = self.tr("Encrypted Internet: {0}").format(self._eip_status) - # status += '\n' - # status += self.tr("Mail is {0}").format(self._mx_status) - # self._systray.setToolTip(status) - pass + Updates the system tray tooltip using the mx status. + """ + mx_status = u"{0}: {1}".format(self._service_name, self._mx_status) + self._systray.set_service_tooltip(MX_SERVICE, mx_status) def set_action_mail_status(self, action_mail_status): """ -- cgit v1.2.3 From 6c5a431034cb423a69c8f58a16fbb39a37dec73c Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 8 Nov 2013 17:23:06 -0300 Subject: Check if we have a systray to use. This fixes a failure when we run the first run wizard and don't have a systray ready. --- src/leap/bitmask/gui/mail_status.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/leap/bitmask/gui/mail_status.py') diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index e89fb376..ec8d8f20 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -166,8 +166,9 @@ class MailStatusWidget(QtGui.QWidget): """ Updates the system tray tooltip using the mx status. """ - mx_status = u"{0}: {1}".format(self._service_name, self._mx_status) - self._systray.set_service_tooltip(MX_SERVICE, mx_status) + if self._systray is not None: + mx_status = u"{0}: {1}".format(self._service_name, self._mx_status) + self._systray.set_service_tooltip(MX_SERVICE, mx_status) def set_action_mail_status(self, action_mail_status): """ -- cgit v1.2.3 From e34674449f5423b07fed608f7c0d2a4e70e5ff4f Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 11 Nov 2013 11:54:49 -0300 Subject: Show a more generic message to the user. --- src/leap/bitmask/gui/mail_status.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/leap/bitmask/gui/mail_status.py') diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index ec8d8f20..3c933c9a 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -294,8 +294,7 @@ class MailStatusWidget(QtGui.QWidget): # ext_status = self.tr("Key not found!") elif req.event == proto.KEYMANAGER_STARTED_KEY_GENERATION: ext_status = self.tr( - "Generating new key, please wait... \n" - "(this may take up to 10 minutes depending on the machine)") + "Generating new key, this may take a few minutes.") elif req.event == proto.KEYMANAGER_FINISHED_KEY_GENERATION: ext_status = self.tr("Finished generating key!") elif req.event == proto.KEYMANAGER_DONE_UPLOADING_KEYS: -- cgit v1.2.3