startintray works correctly in Ubuntu (issue #144)

This commit is contained in:
fuzzgun 2013-05-13 11:51:48 +01:00
parent a81876072e
commit 47e7795903
1 changed files with 9 additions and 10 deletions

View File

@ -536,7 +536,7 @@ class MyForm(QtGui.QMainWindow):
# show bitmessage # show bitmessage
self.actionShow = QtGui.QAction('Show Bitmessage',m,checkable=True) self.actionShow = QtGui.QAction('Show Bitmessage',m,checkable=True)
self.actionShow.setChecked(True) self.actionShow.setChecked(not shared.config.getboolean('bitmessagesettings', 'startintray'))
self.actionShow.triggered.connect(self.appIndicatorShowBitmessage) self.actionShow.triggered.connect(self.appIndicatorShowBitmessage)
m.addAction(self.actionShow) m.addAction(self.actionShow)
@ -740,7 +740,6 @@ class MyForm(QtGui.QMainWindow):
if self.windowState() & QtCore.Qt.WindowMinimized: if self.windowState() & QtCore.Qt.WindowMinimized:
self.hide() self.hide()
self.trayIcon.show() self.trayIcon.show()
#self.hidden = True
if 'win32' in sys.platform or 'win64' in sys.platform: if 'win32' in sys.platform or 'win64' in sys.platform:
self.setWindowFlags(Qt.ToolTip) self.setWindowFlags(Qt.ToolTip)
elif event.oldState() & QtCore.Qt.WindowMinimized: elif event.oldState() & QtCore.Qt.WindowMinimized:
@ -2209,15 +2208,15 @@ def run():
app = QtGui.QApplication(sys.argv) app = QtGui.QApplication(sys.argv)
app.setStyleSheet("QStatusBar::item { border: 0px solid black }") app.setStyleSheet("QStatusBar::item { border: 0px solid black }")
myapp = MyForm() myapp = MyForm()
myapp.show()
if shared.config.getboolean('bitmessagesettings', 'startintray'): if shared.config.getboolean('bitmessagesettings', 'startintray'):
myapp.hide() if not myapp.isUbuntu():
myapp.trayIcon.show() myapp.trayIcon.show()
#self.hidden = True if 'win32' in sys.platform or 'win64' in sys.platform:
#self.setWindowState(self.windowState() & QtCore.Qt.WindowMinimized) myapp.setWindowFlags(Qt.ToolTip)
#self.hide() else:
if 'win32' in sys.platform or 'win64' in sys.platform: myapp.show()
myapp.setWindowFlags(Qt.ToolTip)
myapp.appIndicatorInit(app) myapp.appIndicatorInit(app)
myapp.ubuntuMessagingMenuInit() myapp.ubuntuMessagingMenuInit()
myapp.notifierInit() myapp.notifierInit()