X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=gui%2Fqt%2Fmain_window.py;h=f1657738fdb946b845a76fea72370923516845be;hb=503fd99cdb1256341ad6f2c1f504b2d6851035bd;hp=96da319a56d032367d2341c28a82d9399f46ab71;hpb=4e1068b34307786642045dfa1122d8429d73202d;p=electrum-nvc.git diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 96da319..f165773 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1264,14 +1264,28 @@ class ElectrumWindow(QMainWindow): msg += '\n\nOutputs:\n' + '\n'.join(map(lambda x: x[0] + ' ' + self.format_amount(x[1])+ self.base_unit(), pr.get_outputs())) QMessageBox.information(self, 'Invoice', msg , 'OK') + def do_pay_invoice(self, key): + from electrum.paymentrequest import PaymentRequest + domain, memo, value, status, tx_hash = self.invoices[key] + pr = PaymentRequest(self.config) + pr.read_file(key) + pr.domain = domain + pr.verify() + self.gui_object.payment_request = pr + self.prepare_for_payment_request() + self.payment_request_ok() + def create_invoice_menu(self, position): item = self.invoices_list.itemAt(position) if not item: return k = self.invoices_list.indexOfTopLevelItem(item) key = self.invoices.keys()[k] + domain, memo, value, status, tx_hash = self.invoices[key] menu = QMenu() menu.addAction(_("Details"), lambda: self.show_invoice(key)) + if status == PR_UNPAID: + menu.addAction(_("Pay Now"), lambda: self.do_pay_invoice(key)) menu.addAction(_("Delete"), lambda: self.delete_invoice(key)) menu.exec_(self.invoices_list.viewport().mapToGlobal(position))