summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/mainwindow.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-04-11 10:08:39 -0300
committerTomás Touceda <chiiph@leap.se>2014-04-11 10:08:39 -0300
commit1d8010100490afdb016d5c45ec95fe332377e045 (patch)
tree23743f4413e8651b5412cf127cc02c59a873635f /src/leap/bitmask/gui/mainwindow.py
parent3dd0620c2966f8a1b918e76244641aa8b3a85664 (diff)
parent65bbc9ac87092053a8079d4d7d88cac4df5fbc36 (diff)
Merge remote-tracking branch 'refs/remotes/ivan/feature/4990_start-hidden-flag' into develop
Diffstat (limited to 'src/leap/bitmask/gui/mainwindow.py')
-rw-r--r--src/leap/bitmask/gui/mainwindow.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index f097faca..9d0f9145 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -124,7 +124,8 @@ class MainWindow(QtGui.QMainWindow):
def __init__(self, quit_callback,
openvpn_verb=1,
- bypass_checks=False):
+ bypass_checks=False,
+ start_hidden=False):
"""
Constructor for the client main window
@@ -136,6 +137,9 @@ class MainWindow(QtGui.QMainWindow):
first round of checks for CA
certificates at bootstrap
:type bypass_checks: bool
+ :param start_hidden: Set to true if the app should not show the window
+ but just the tray.
+ :type start_hidden: bool
"""
QtGui.QMainWindow.__init__(self)
@@ -342,6 +346,7 @@ class MainWindow(QtGui.QMainWindow):
self._logger_window = None
self._bypass_checks = bypass_checks
+ self._start_hidden = start_hidden
# We initialize Soledad and Keymanager instances as
# transparent proxies, so we can pass the reference freely
@@ -666,9 +671,11 @@ class MainWindow(QtGui.QMainWindow):
providers = self._settings.get_configured_providers()
self._login_widget.set_providers(providers)
self._show_systray()
- self.show()
- if IS_MAC:
- self.raise_()
+
+ if not self._start_hidden:
+ self.show()
+ if IS_MAC:
+ self.raise_()
self._hide_unsupported_services()
@@ -787,6 +794,12 @@ class MainWindow(QtGui.QMainWindow):
self._mail_status.set_systray(self._systray)
self._eip_status.set_systray(self._systray)
+ hello = lambda: self._systray.showMessage(
+ self.tr('Hello!'),
+ self.tr('Bitmask has started in the tray.'))
+ # we wait for the systray to be ready
+ reactor.callLater(1, hello)
+
def _tray_activated(self, reason=None):
"""
SLOT