electrum

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

commit 7f3fc232a0e86eec6740cc1d7b16b81abfb9bf1e
parent 1b7cd02bce6dbdb6ab7cd8957536b35cb411b126
Author: ThomasV <thomasv@gitorious>
Date:   Thu, 23 Apr 2015 09:32:50 +0200

minor fixes for receive tab

Diffstat:
Mgui/qt/main_window.py | 16+++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -700,17 +700,21 @@ class ElectrumWindow(QMainWindow): menu.exec_(self.receive_list.viewport().mapToGlobal(position)) def save_payment_request(self): - now = int(time.time()) addr = str(self.receive_address_e.text()) amount = self.receive_amount_e.get_amount() message = unicode(self.receive_message_e.text()) - i = self.expires_combo.currentIndex() - expiration = map(lambda x: x[1], expiration_values)[i] if not message and not amount: QMessageBox.warning(self, _('Error'), _('No message or amount'), _('OK')) return - self.receive_requests = self.wallet.storage.get('receive_requests2',{}) - self.receive_requests[addr] = {'time':now, 'amount':amount, 'expiration':expiration} + self.receive_requests = self.wallet.storage.get('receive_requests2', {}) + if addr in self.receive_requests: + self.receive_requests[addr]['amount'] = amount + else: + now = int(time.time()) + i = self.expires_combo.currentIndex() + expiration = map(lambda x: x[1], expiration_values)[i] + self.receive_requests[addr] = {'time':now, 'amount':amount, 'expiration':expiration} + self.wallet.storage.put('receive_requests2', self.receive_requests) self.wallet.set_label(addr, message) self.update_receive_tab() @@ -776,6 +780,8 @@ class ElectrumWindow(QMainWindow): self.receive_address_e.setText(addr) self.receive_message_e.setText('') self.receive_amount_e.setAmount(None) + self.expires_label.hide() + self.expires_combo.show() def toggle_qr_window(self): import qrwindow