From d2e4d068d41b528637ba477ea2682cfa7565de99 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Tue, 26 Mar 2019 18:42:21 +0200 Subject: [PATCH] Added the same "Send message to this address" item to subscription context menu and ordered the menus in the same way. --- src/bitmessageqt/__init__.py | 10 ++++++---- src/bitmessageqt/bitmessageui.py | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 73cb9369..a645166f 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -355,8 +355,6 @@ class MyForm(settingsmixin.SMainWindow): self.on_context_menuAddressBook) def init_subscriptions_popup_menu(self, connectSignal=True): - # Popup menu for the Subscriptions page - self.ui.subscriptionsContextMenuToolbar = QtGui.QToolBar() # Actions self.actionsubscriptionsNew = self.ui.subscriptionsContextMenuToolbar.addAction( _translate("MainWindow", "New"), self.on_action_SubscriptionsNew) @@ -375,6 +373,9 @@ class MyForm(settingsmixin.SMainWindow): self.actionsubscriptionsSetAvatar = self.ui.subscriptionsContextMenuToolbar.addAction( _translate("MainWindow", "Set avatar..."), self.on_action_TreeWidgetSetAvatar) + self.actionsubscriptionsSend = self.ui.addressContextMenuToolbar.addAction( + _translate("MainWindow", "Send message to this address"), + self.on_action_Send) self.ui.treeWidgetSubscriptions.setContextMenuPolicy( QtCore.Qt.CustomContextMenu) if connectSignal: @@ -3501,6 +3502,7 @@ class MyForm(settingsmixin.SMainWindow): self.popMenuSubscriptions.addAction(self.actionsubscriptionsSetAvatar) self.popMenuSubscriptions.addSeparator() self.popMenuSubscriptions.addAction(self.actionsubscriptionsClipboard) + self.popMenuSubscriptions.addAction(self.actionsubscriptionsSend) self.popMenuSubscriptions.addSeparator() # preloaded gui.menu plugins with prefix 'address' for plugin in self.menu_plugins['address']: @@ -3943,13 +3945,13 @@ class MyForm(settingsmixin.SMainWindow): self.popMenu.addAction(self.actionNew) self.popMenu.addAction(self.actionDelete) self.popMenu.addSeparator() - self.popMenu.addAction(self.actionClipboard) - self.popMenu.addSeparator() if currentItem.isEnabled: self.popMenu.addAction(self.actionDisable) else: self.popMenu.addAction(self.actionEnable) self.popMenu.addAction(self.actionSetAvatar) + self.popMenu.addSeparator() + self.popMenu.addAction(self.actionClipboard) self.popMenu.addAction(self.actionSend) self.popMenu.addSeparator() # preloaded gui.menu plugins with prefix 'address' diff --git a/src/bitmessageqt/bitmessageui.py b/src/bitmessageqt/bitmessageui.py index af995065..30d054d0 100644 --- a/src/bitmessageqt/bitmessageui.py +++ b/src/bitmessageqt/bitmessageui.py @@ -656,6 +656,8 @@ class Ui_MainWindow(object): self.sentContextMenuToolbar = QtGui.QToolBar() # Popup menu actions container for chans tree self.addressContextMenuToolbar = QtGui.QToolBar() + # Popup menu actions container for subscriptions tree + self.subscriptionsContextMenuToolbar = QtGui.QToolBar() def updateNetworkSwitchMenuLabel(self, dontconnect=None): if dontconnect is None: