From 9dae77dd2bc5c4104fdb5b9a53bd6f8ec151b0fc Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Thu, 12 Oct 2017 00:26:14 +0300 Subject: [PATCH] Quiet Mode (i.e. turn off notification) in tray menu --- src/bitmessageqt/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index bb90bb47..0cedf8c7 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -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)