tpayment request: show status with help button - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 26d133c20aacabe895f51abe45f02960bf74fce1 DIR parent fd2228feabadf9b3650e2376df573507a6d8e447 HTML Author: ThomasV <thomasv@gitorious> Date: Thu, 5 Jun 2014 17:40:58 +0200 payment request: show status with help button Diffstat: M gui/qt/main_window.py | 12 +++++++++--- M gui/qt/paytoedit.py | 3 ++- M gui/qt/util.py | 10 +++++++++- M lib/paymentrequest.py | 2 +- 4 files changed, 21 insertions(+), 6 deletions(-) --- DIR diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py t@@ -891,9 +891,13 @@ class ElectrumWindow(QMainWindow): return True def payment_request_ok(self): - self.payto_e.setText(self.gui_object.payment_request.domain) - self.amount_e.setText(self.format_amount(self.gui_object.payment_request.get_amount())) - self.message_e.setText(self.gui_object.payment_request.memo) + pr = self.gui_object.payment_request + self.payto_help.show() + self.payto_help.set_alt(pr.status) + self.payto_e.setGreen() + self.payto_e.setText(pr.domain) + self.amount_e.setText(self.format_amount(pr.get_amount())) + self.message_e.setText(pr.memo) def payment_request_error(self): self.do_clear() t@@ -927,6 +931,8 @@ class ElectrumWindow(QMainWindow): for h in [self.payto_help, self.amount_help, self.message_help]: h.show() + self.payto_help.set_alt(None) + self.set_pay_from([]) self.update_status() DIR diff --git a/gui/qt/paytoedit.py b/gui/qt/paytoedit.py t@@ -41,7 +41,6 @@ class PayToEdit(QTextEdit): self.setMaximumHeight(27) self.c = None - def lock_amount(self): self.amount_edit.setFrozen(True) t@@ -52,6 +51,8 @@ class PayToEdit(QTextEdit): self.setReadOnly(b) self.setStyleSheet(frozen_style if b else normal_style) + def setGreen(self): + self.setStyleSheet("QWidget { background-color:#00ff00;}") def parse_address_and_amount(self, line): x, y = line.split(',') DIR diff --git a/gui/qt/util.py b/gui/qt/util.py t@@ -55,9 +55,17 @@ class EnterButton(QPushButton): class HelpButton(QPushButton): def __init__(self, text): QPushButton.__init__(self, '?') + self.help_text = text + self.alt_text = None self.setFocusPolicy(Qt.NoFocus) self.setFixedWidth(20) - self.clicked.connect(lambda: QMessageBox.information(self, 'Help', text, 'OK') ) + self.clicked.connect(lambda: QMessageBox.information(self, 'Help', self.get_text(), 'OK') ) + + def get_text(self): + return self.alt_text if self.alt_text else self.help_text + + def set_alt(self, t): + self.alt_text = t DIR diff --git a/lib/paymentrequest.py b/lib/paymentrequest.py t@@ -184,7 +184,7 @@ class PaymentRequest: self.memo = pay_det.memo if CA_match: - print 'Signed By Trusted CA: ', CA_OU + self.status = 'Signed by Trusted CA:\n' + CA_OU print "payment url", pay_det.payment_url return True