summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-09-18 17:12:13 -0400
committerKali Kaneko <kali@leap.se>2013-09-18 17:12:13 -0400
commit006f362af526e9283c698805100e54c18b2be390 (patch)
treed60ebf2b0720091ec08a53211ddba438fd19e713 /src
parent956878cd1c33d2a7325a9f627b99190a544a35b9 (diff)
parentc48ee72ba2e0b016cb6919a3197831ef4292056d (diff)
Merge remote-tracking branch 'ivan-github/feature/3792_systray-texts-improvements' into develop
Diffstat (limited to 'src')
-rw-r--r--src/leap/bitmask/gui/mainwindow.py39
-rw-r--r--src/leap/bitmask/gui/statuspanel.py26
2 files changed, 23 insertions, 42 deletions
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 1dbf39ef..37bbf1c4 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -251,30 +251,14 @@ class MainWindow(QtGui.QMainWindow):
self._systray = None
- self._action_eip_provider = QtGui.QAction(
- self.tr("No default provider"), self)
- self._action_eip_provider.setEnabled(False)
-
- self._action_eip_status = QtGui.QAction(
- self.tr("Encrypted Internet is OFF"),
- self)
- self._action_eip_status.setEnabled(False)
- self._status_panel.set_action_eip_status(
- self._action_eip_status)
-
- self._action_mail_status = QtGui.QAction(
- self.tr("Encrypted Mail is OFF"), self)
+ self._action_mail_status = QtGui.QAction(self.tr("Mail is OFF"), self)
self._action_mail_status.setEnabled(False)
- self._status_panel.set_action_mail_status(
- self._action_mail_status)
+ self._status_panel.set_action_mail_status(self._action_mail_status)
- self._action_eip_startstop = QtGui.QAction(
- self.tr("Turn OFF"), self)
- self._action_eip_startstop.triggered.connect(
- self._stop_eip)
+ self._action_eip_startstop = QtGui.QAction(self.tr("Turn ON"), self)
+ self._action_eip_startstop.triggered.connect(self._stop_eip)
self._action_eip_startstop.setEnabled(False)
- self._status_panel.set_action_eip_startstop(
- self._action_eip_startstop)
+ self._status_panel.set_action_eip_startstop(self._action_eip_startstop)
self._action_preferences = QtGui.QAction(self.tr("Preferences"), self)
self._action_preferences.triggered.connect(self._show_preferences)
@@ -594,8 +578,6 @@ class MainWindow(QtGui.QMainWindow):
"no default provider configured")
return
- self._action_eip_provider.setText(default_provider)
-
self._enabled_services = self._settings.get_enabled_services(
default_provider)
@@ -626,9 +608,11 @@ class MainWindow(QtGui.QMainWindow):
systrayMenu = QtGui.QMenu(self)
systrayMenu.addAction(self._action_visible)
systrayMenu.addSeparator()
- systrayMenu.addAction(self._action_eip_provider)
- systrayMenu.addAction(self._action_eip_status)
- systrayMenu.addAction(self._action_eip_startstop)
+
+ eip_menu = systrayMenu.addMenu(self.tr("Encrypted Internet is OFF"))
+ eip_menu.addAction(self._action_eip_startstop)
+ self._status_panel.set_eip_status_menu(eip_menu)
+
systrayMenu.addAction(self._action_mail_status)
systrayMenu.addSeparator()
systrayMenu.addAction(self._action_preferences)
@@ -1242,9 +1226,6 @@ class MainWindow(QtGui.QMainWindow):
provider = "%s@%s" % (self._logged_user, provider)
self._status_panel.set_provider(provider)
-
- self._action_eip_provider.setText(provider_config.get_domain())
-
self._status_panel.eip_started()
# XXX refactor into status_panel method?
diff --git a/src/leap/bitmask/gui/statuspanel.py b/src/leap/bitmask/gui/statuspanel.py
index 10e6bca3..39a8079f 100644
--- a/src/leap/bitmask/gui/statuspanel.py
+++ b/src/leap/bitmask/gui/statuspanel.py
@@ -130,7 +130,7 @@ class StatusPanelWidget(QtGui.QWidget):
QtGui.QWidget.__init__(self, parent)
self._systray = None
- self._action_eip_status = None
+ self._eip_status_menu = None
self.ui = Ui_StatusPanel()
self.ui.setupUi(self)
@@ -347,7 +347,7 @@ class StatusPanelWidget(QtGui.QWidget):
"""
status = self.tr("Encrypted Internet is {0}").format(self._eip_status)
status += '\n'
- status += self.tr("Encrypted Mail is {0}").format(self._mx_status)
+ status += self.tr("Mail is {0}").format(self._mx_status)
self._systray.setToolTip(status)
def set_action_eip_startstop(self, action_eip_startstop):
@@ -359,15 +359,15 @@ class StatusPanelWidget(QtGui.QWidget):
"""
self._action_eip_startstop = action_eip_startstop
- def set_action_eip_status(self, action_eip_status):
+ def set_eip_status_menu(self, eip_status_menu):
"""
- Sets the action_eip_status to use.
+ Sets the eip_status_menu to use.
- :param action_eip_status: action_eip_status to be used
- :type action_eip_status: QtGui.QAction
+ :param eip_status_menu: eip_status_menu to be used
+ :type eip_status_menu: QtGui.QMenu
"""
- leap_assert_type(action_eip_status, QtGui.QAction)
- self._action_eip_status = action_eip_status
+ leap_assert_type(eip_status_menu, QtGui.QMenu)
+ self._eip_status_menu = eip_status_menu
def set_action_mail_status(self, action_mail_status):
"""
@@ -550,7 +550,7 @@ class StatusPanelWidget(QtGui.QWidget):
"RECONNECTING", "ASSIGN_IP"):
selected_pixmap = self.CONNECTING_ICON
selected_pixmap_tray = self.CONNECTING_ICON_TRAY
- tray_message = self.tr("Turning ON")
+ tray_message = self.tr("Encrypted Internet is STARTING")
elif status in ("CONNECTED"):
tray_message = self.tr("Encrypted Internet is ON")
selected_pixmap = self.CONNECTED_ICON
@@ -558,14 +558,14 @@ class StatusPanelWidget(QtGui.QWidget):
self.set_icon(selected_pixmap)
self._systray.setIcon(QtGui.QIcon(selected_pixmap_tray))
- self._action_eip_status.setText(tray_message)
+ self._eip_status_menu.setTitle(tray_message)
def set_provider(self, provider):
self.ui.lblProvider.setText(provider)
def _set_mail_status(self, status, ready=False):
"""
- Sets the Encrypted Mail status in the label and in the tray icon.
+ Sets the Mail status in the label and in the tray icon.
:param status: the status text to display
:type status: unicode
@@ -575,13 +575,13 @@ class StatusPanelWidget(QtGui.QWidget):
self.ui.lblMailStatus.setText(status)
self._mx_status = self.tr('OFF')
- tray_status = self.tr('Encrypted Mail is OFF')
+ tray_status = self.tr('Mail is OFF')
icon = QtGui.QPixmap(self.MAIL_OFF_ICON)
if ready:
icon = QtGui.QPixmap(self.MAIL_ON_ICON)
self._mx_status = self.tr('ON')
- tray_status = self.tr('Encrypted Mail is ON')
+ tray_status = self.tr('Mail is ON')
self.ui.lblMailIcon.setPixmap(icon)
self._action_mail_status.setText(tray_status)