From cbd474e49e12e5fc0677dafe331b9c5ab3a2539a Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 20 Sep 2012 03:57:05 +0900 Subject: start hidden, and toggle details window from menu --- src/leap/app.py | 3 ++- src/leap/baseapp/eip.py | 2 +- src/leap/baseapp/systray.py | 24 +++++++++++++++--------- 3 files changed, 18 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/leap/app.py b/src/leap/app.py index c0d83042..fe88a002 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -60,7 +60,8 @@ def main(): QApplication.setQuitOnLastWindowClosed(False) window = LeapWindow(opts) - window.show() + if debug: + window.show() sys.exit(app.exec_()) if __name__ == "__main__": diff --git a/src/leap/baseapp/eip.py b/src/leap/baseapp/eip.py index 6c147cb4..6d6b79cb 100644 --- a/src/leap/baseapp/eip.py +++ b/src/leap/baseapp/eip.py @@ -152,7 +152,7 @@ class EIPConductorAppMixin(object): # from openvpn manager) if not self.eip_service_started: - # there is a race condition + # there is a race condition # going on here. Depending on how long we take # to init the qt app, the management socket # is not ready yet. diff --git a/src/leap/baseapp/systray.py b/src/leap/baseapp/systray.py index dd872de0..f98bfa76 100644 --- a/src/leap/baseapp/systray.py +++ b/src/leap/baseapp/systray.py @@ -3,6 +3,7 @@ import logging from PyQt4 import QtCore from PyQt4 import QtGui +from leap import __branding as BRANDING from leap import __version__ as VERSION from leap.gui import mainwindow_rc @@ -138,18 +139,23 @@ class StatusAwareTrayIconMixin(object): triggered=self.cleanupAndQuit) def detailsWin(self): - logger.debug('details win toggle') - # XXX toggle main window visibility - # if visible: self.hide - # if hidden: self.show + visible = self.isVisible() + if visible: + self.hide() + else: + self.show() def about(self): # move to widget - QtGui.QMessageBox.about(self, "About", - "LEAP client
" - "(version %s)
" - "" - "https://leap.se" % VERSION) + flavor = BRANDING.get('short_name', None) + content = ("LEAP client
" + "(version %s)
" % VERSION) + if flavor: + content = content + ('
Flavor: %s
' % flavor) + content = content + ( + "
" + "https://leap.se") + QtGui.QMessageBox.about(self, "About", content) def setConnWidget(self, icon_name): oldlayout = self.statusIconBox.layout() -- cgit v1.2.3