Added the same "Send message to this address" item to subscription

context menu and ordered the menus in the same way.
This commit is contained in:
Dmitri Bogomolov 2019-03-26 18:42:21 +02:00
parent 34ceb98d34
commit d2e4d068d4
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
2 changed files with 8 additions and 4 deletions

View File

@ -355,8 +355,6 @@ class MyForm(settingsmixin.SMainWindow):
self.on_context_menuAddressBook) self.on_context_menuAddressBook)
def init_subscriptions_popup_menu(self, connectSignal=True): def init_subscriptions_popup_menu(self, connectSignal=True):
# Popup menu for the Subscriptions page
self.ui.subscriptionsContextMenuToolbar = QtGui.QToolBar()
# Actions # Actions
self.actionsubscriptionsNew = self.ui.subscriptionsContextMenuToolbar.addAction( self.actionsubscriptionsNew = self.ui.subscriptionsContextMenuToolbar.addAction(
_translate("MainWindow", "New"), self.on_action_SubscriptionsNew) _translate("MainWindow", "New"), self.on_action_SubscriptionsNew)
@ -375,6 +373,9 @@ class MyForm(settingsmixin.SMainWindow):
self.actionsubscriptionsSetAvatar = self.ui.subscriptionsContextMenuToolbar.addAction( self.actionsubscriptionsSetAvatar = self.ui.subscriptionsContextMenuToolbar.addAction(
_translate("MainWindow", "Set avatar..."), _translate("MainWindow", "Set avatar..."),
self.on_action_TreeWidgetSetAvatar) 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( self.ui.treeWidgetSubscriptions.setContextMenuPolicy(
QtCore.Qt.CustomContextMenu) QtCore.Qt.CustomContextMenu)
if connectSignal: if connectSignal:
@ -3501,6 +3502,7 @@ class MyForm(settingsmixin.SMainWindow):
self.popMenuSubscriptions.addAction(self.actionsubscriptionsSetAvatar) self.popMenuSubscriptions.addAction(self.actionsubscriptionsSetAvatar)
self.popMenuSubscriptions.addSeparator() self.popMenuSubscriptions.addSeparator()
self.popMenuSubscriptions.addAction(self.actionsubscriptionsClipboard) self.popMenuSubscriptions.addAction(self.actionsubscriptionsClipboard)
self.popMenuSubscriptions.addAction(self.actionsubscriptionsSend)
self.popMenuSubscriptions.addSeparator() self.popMenuSubscriptions.addSeparator()
# preloaded gui.menu plugins with prefix 'address' # preloaded gui.menu plugins with prefix 'address'
for plugin in self.menu_plugins['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.actionNew)
self.popMenu.addAction(self.actionDelete) self.popMenu.addAction(self.actionDelete)
self.popMenu.addSeparator() self.popMenu.addSeparator()
self.popMenu.addAction(self.actionClipboard)
self.popMenu.addSeparator()
if currentItem.isEnabled: if currentItem.isEnabled:
self.popMenu.addAction(self.actionDisable) self.popMenu.addAction(self.actionDisable)
else: else:
self.popMenu.addAction(self.actionEnable) self.popMenu.addAction(self.actionEnable)
self.popMenu.addAction(self.actionSetAvatar) self.popMenu.addAction(self.actionSetAvatar)
self.popMenu.addSeparator()
self.popMenu.addAction(self.actionClipboard)
self.popMenu.addAction(self.actionSend) self.popMenu.addAction(self.actionSend)
self.popMenu.addSeparator() self.popMenu.addSeparator()
# preloaded gui.menu plugins with prefix 'address' # preloaded gui.menu plugins with prefix 'address'

View File

@ -656,6 +656,8 @@ class Ui_MainWindow(object):
self.sentContextMenuToolbar = QtGui.QToolBar() self.sentContextMenuToolbar = QtGui.QToolBar()
# Popup menu actions container for chans tree # Popup menu actions container for chans tree
self.addressContextMenuToolbar = QtGui.QToolBar() self.addressContextMenuToolbar = QtGui.QToolBar()
# Popup menu actions container for subscriptions tree
self.subscriptionsContextMenuToolbar = QtGui.QToolBar()
def updateNetworkSwitchMenuLabel(self, dontconnect=None): def updateNetworkSwitchMenuLabel(self, dontconnect=None):
if dontconnect is None: if dontconnect is None: