diff options
author | kali <kali@leap.se> | 2012-09-20 03:57:05 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-09-20 03:57:05 +0900 |
commit | cbd474e49e12e5fc0677dafe331b9c5ab3a2539a (patch) | |
tree | bd758d48564294a7d80509bcc77c9dfcbd511b1d /src/leap/baseapp/systray.py | |
parent | db704eecf513fcc48365844523557d6edab28293 (diff) |
start hidden, and toggle details window from menu
Diffstat (limited to 'src/leap/baseapp/systray.py')
-rw-r--r-- | src/leap/baseapp/systray.py | 24 |
1 files changed, 15 insertions, 9 deletions
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<br>" - "(version <b>%s</b>)<br>" - "<a href='https://leap.se/'>" - "https://leap.se</a>" % VERSION) + flavor = BRANDING.get('short_name', None) + content = ("LEAP client<br>" + "(version <b>%s</b>)<br>" % VERSION) + if flavor: + content = content + ('<br>Flavor: <i>%s</i><br>' % flavor) + content = content + ( + "<br><a href='https://leap.se/'>" + "https://leap.se</a>") + QtGui.QMessageBox.about(self, "About", content) def setConnWidget(self, icon_name): oldlayout = self.statusIconBox.layout() |