commit 8c55bbd1f31f67fd9a104f2cdca4fe508753b68a
parent 2a80f6877808181d27cc5a80d31458b88f3b4d17
Author: ThomasV <thomasv@electrum.org>
Date: Thu, 12 Oct 2017 18:44:02 +0200
Merge pull request #3030 from achow101/tray-menu-fix
Modify tray context menu instead of creating a new one
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/gui/qt/__init__.py b/gui/qt/__init__.py
@@ -114,8 +114,12 @@ class ElectrumGui:
def build_tray_menu(self):
# Avoid immediate GC of old menu when window closed via its action
- self.old_menu = self.tray.contextMenu()
- m = QMenu()
+ if self.tray.contextMenu() is None:
+ m = QMenu()
+ self.tray.setContextMenu(m)
+ else:
+ m = self.tray.contextMenu()
+ m.clear()
for window in self.windows:
submenu = m.addMenu(window.wallet.basename())
submenu.addAction(_("Show/Hide"), window.show_or_hide)
@@ -123,7 +127,6 @@ class ElectrumGui:
m.addAction(_("Dark/Light"), self.toggle_tray_icon)
m.addSeparator()
m.addAction(_("Exit Electrum"), self.close)
- self.tray.setContextMenu(m)
def tray_icon(self):
if self.dark_icon: