Quiet Mode (i.e. turn off notification) in tray menu

This commit is contained in:
Dmitri Bogomolov 2017-10-12 00:26:14 +03:00
parent 4c9006a632
commit 9dae77dd2b
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -864,6 +864,12 @@ class MyForm(settingsmixin.SMainWindow):
self.actionShow.setChecked(False)
self.appIndicatorShowOrHideWindow()
def appIndicatorSwitchQuietMode(self):
BMConfigParser().set(
'bitmessagesettings', 'showtraynotifications',
str(not self.actionQuiet.isChecked())
)
# application indicator show or hide
"""# application indicator show or hide
def appIndicatorShowBitmessage(self):
@ -1157,6 +1163,14 @@ class MyForm(settingsmixin.SMainWindow):
if not sys.platform[0:3] == 'win':
m.addAction(self.actionShow)
# quiet mode
self.actionQuiet = QtGui.QAction(_translate(
"MainWindow", "Quiet Mode"), m, checkable=True)
self.actionQuiet.setChecked(not BMConfigParser().getboolean(
'bitmessagesettings', 'showtraynotifications'))
self.actionQuiet.triggered.connect(self.appIndicatorSwitchQuietMode)
m.addAction(self.actionQuiet)
# Send
actionSend = QtGui.QAction(_translate(
"MainWindow", "Send"), m, checkable=False)