From d083c53e1b0c1c6470086fe87514afd1204b6c07 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Mon, 5 Feb 2018 16:40:43 +0200 Subject: [PATCH] New button "Clear" on tab "Send" to clear all fields (#919) --- src/bitmessageqt/__init__.py | 9 ++++++++- src/bitmessageqt/bitmessageui.py | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 76940ec0..51d26388 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -147,6 +147,8 @@ class MyForm(settingsmixin.SMainWindow): "clicked()"), self.click_pushButtonAddSubscription) QtCore.QObject.connect(self.ui.pushButtonTTL, QtCore.SIGNAL( "clicked()"), self.click_pushButtonTTL) + QtCore.QObject.connect(self.ui.pushButtonClear, QtCore.SIGNAL( + "clicked()"), self.click_pushButtonClear) QtCore.QObject.connect(self.ui.pushButtonSend, QtCore.SIGNAL( "clicked()"), self.click_pushButtonSend) QtCore.QObject.connect(self.ui.pushButtonFetchNamecoinID, QtCore.SIGNAL( @@ -1840,7 +1842,6 @@ class MyForm(settingsmixin.SMainWindow): def rerenderSubscriptions(self): self.rerenderTabTreeSubscriptions() - def click_pushButtonTTL(self): QtGui.QMessageBox.information(self, 'Time To Live', _translate( "MainWindow", """The TTL, or Time-To-Live is the length of time that the network will hold the message. @@ -1848,6 +1849,12 @@ class MyForm(settingsmixin.SMainWindow): will resend the message automatically. The longer the Time-To-Live, the more work your computer must do to send the message. A Time-To-Live of four or five days is often appropriate."""), QtGui.QMessageBox.Ok) + def click_pushButtonClear(self): + self.ui.lineEditSubject.setText("") + self.ui.lineEditTo.setText("") + self.ui.textEditMessage.setText("") + self.ui.comboBoxSendFrom.setCurrentIndex(0) + def click_pushButtonSend(self): encoding = 3 if QtGui.QApplication.queryKeyboardModifiers() & QtCore.Qt.ShiftModifier else 2 diff --git a/src/bitmessageqt/bitmessageui.py b/src/bitmessageqt/bitmessageui.py index f5d28a7f..cb3578c0 100644 --- a/src/bitmessageqt/bitmessageui.py +++ b/src/bitmessageqt/bitmessageui.py @@ -337,6 +337,9 @@ class Ui_MainWindow(object): self.labelHumanFriendlyTTLDescription.setMinimumSize(QtCore.QSize(45, 0)) self.labelHumanFriendlyTTLDescription.setObjectName(_fromUtf8("labelHumanFriendlyTTLDescription")) self.horizontalLayout_5.addWidget(self.labelHumanFriendlyTTLDescription, 1, QtCore.Qt.AlignLeft) + self.pushButtonClear = QtGui.QPushButton(self.send) + self.pushButtonClear.setObjectName(_fromUtf8("pushButtonClear")) + self.horizontalLayout_5.addWidget(self.pushButtonClear, 0, QtCore.Qt.AlignRight) self.pushButtonSend = QtGui.QPushButton(self.send) self.pushButtonSend.setObjectName(_fromUtf8("pushButtonSend")) self.horizontalLayout_5.addWidget(self.pushButtonSend, 0, QtCore.Qt.AlignRight) @@ -701,6 +704,7 @@ class Ui_MainWindow(object): except: pass self.labelHumanFriendlyTTLDescription.setText(_translate("MainWindow", "%n hour(s)", None, QtCore.QCoreApplication.CodecForTr, hours)) + self.pushButtonClear.setText(_translate("MainWindow", "Clear", None)) self.pushButtonSend.setText(_translate("MainWindow", "Send", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send", None)) self.treeWidgetSubscriptions.headerItem().setText(0, _translate("MainWindow", "Subscriptions", None)) -- 2.45.1