electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 38e7d8ebe5212324f27454028adbfc02540e2f88
parent 36cee628493b9bb07ab1d2d09eaae1ae428e1569
Author: ThomasV <thomasv@gitorious>
Date:   Fri, 13 Jun 2014 16:39:07 +0200

show color if payment request has expired

Diffstat:
Mgui/qt/main_window.py | 11++++++++++-
Mgui/qt/paytoedit.py | 5++++-
Mlib/paymentrequest.py | 4----
3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -808,6 +808,11 @@ class ElectrumWindow(QMainWindow): def read_send_tab(self): + + if self.payment_request and self.payment_request.has_expired(): + QMessageBox.warning(self, _('Error'), _('Payment request has expired'), _('OK')) + return + label = unicode( self.message_e.text() ) if self.payment_request: @@ -976,7 +981,11 @@ class ElectrumWindow(QMainWindow): self.payto_help.show() self.payto_help.set_alt(lambda: self.show_pr_details(pr)) - self.payto_e.setGreen() + if not pr.has_expired(): + self.payto_e.setGreen() + else: + self.payto_e.setExpired() + self.payto_e.setText(pr.domain) self.amount_e.setText(self.format_amount(pr.get_amount())) self.message_e.setText(pr.get_memo()) diff --git a/gui/qt/paytoedit.py b/gui/qt/paytoedit.py @@ -56,8 +56,11 @@ class PayToEdit(QTextEdit): def setGreen(self): self.is_pr = True - self.setStyleSheet("QWidget { background-color:#00ff00;}") + self.setStyleSheet("QWidget { background-color:#80ff80;}") + def setExpired(self): + self.is_pr = True + self.setStyleSheet("QWidget { background-color:#ffcccc;}") def parse_address_and_amount(self, line): x, y = line.split(',') diff --git a/lib/paymentrequest.py b/lib/paymentrequest.py @@ -251,10 +251,6 @@ class PaymentRequest: self.payment_url = self.details.payment_url - if self.has_expired(): - self.error = "ERROR: Payment Request has Expired." - return False - return True def has_expired(self):