From 71e4c29419494b948967d572f0f13152039cb4e5 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Wed, 20 Mar 2019 18:36:32 +0200 Subject: [PATCH] "Send message to this chan" item in chan context menu (closes #1445) --- src/bitmessageqt/__init__.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 0d4cebb3..2129c171 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -304,6 +304,9 @@ class MyForm(settingsmixin.SMainWindow): _translate( "MainWindow", "Copy address to clipboard"), self.on_action_Clipboard) + self.actionSend = self.ui.addressContextMenuToolbar.addAction( + _translate("MainWindow", "Send message to this chan"), + self.on_action_Send) self.actionSpecialAddressBehavior = self.ui.addressContextMenuToolbar.addAction( _translate( "MainWindow", "Special address behavior..."), @@ -1872,7 +1875,7 @@ class MyForm(settingsmixin.SMainWindow): def click_pushButtonClear(self): self.ui.lineEditSubject.setText("") self.ui.lineEditTo.setText("") - self.ui.textEditMessage.setText("") + self.ui.textEditMessage.reset() self.ui.comboBoxSendFrom.setCurrentIndex(0) def click_pushButtonSend(self): @@ -2085,10 +2088,7 @@ class MyForm(settingsmixin.SMainWindow): toAddress, toLabel, fromAddress, subject, message, ackdata) queues.workerQueue.put(('sendmessage', toAddress)) - self.ui.comboBoxSendFrom.setCurrentIndex(0) - self.ui.lineEditTo.setText('') - self.ui.lineEditSubject.setText('') - self.ui.textEditMessage.reset() + self.click_pushButtonClear() if self.replyFromTab is not None: self.ui.tabWidget.setCurrentIndex(self.replyFromTab) self.replyFromTab = None @@ -2609,6 +2609,13 @@ class MyForm(settingsmixin.SMainWindow): except: pass + def on_action_Send(self): + self.click_pushButtonClear() + self.ui.lineEditTo.setText(self.getCurrentAccount()) + self.ui.tabWidget.setCurrentIndex( + self.ui.tabWidget.indexOf(self.ui.send) + ) + def on_action_SpecialAddressBehaviorDialog(self): dialogs.SpecialAddressBehaviorDialog(self, BMConfigParser()) @@ -3953,6 +3960,7 @@ class MyForm(settingsmixin.SMainWindow): else: self.popMenu.addAction(self.actionEnable) self.popMenu.addAction(self.actionSetAvatar) + self.popMenu.addAction(self.actionSend) self.popMenu.addSeparator() # preloaded gui.menu plugins with prefix 'address' for plugin in self.menu_plugins['address']: