electrum

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

commit 522d4d7f91ffc23bb01cdab2e6bd4eddf0c42c66
parent 4faeaef91ecbcab7da330ab40d2a913b281dc7c7
Author: ThomasV <thomasv@gitorious>
Date:   Wed, 28 Nov 2012 22:52:35 +0100

do not display requested amount if zero. show menu item only if window is visible

Diffstat:
Mlib/gui_qt.py | 15+++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/lib/gui_qt.py b/lib/gui_qt.py @@ -838,6 +838,7 @@ class ElectrumWindow(QMainWindow): d = QDialog() d.setWindowTitle('Request payment') + d.setModal(1) vbox = QVBoxLayout() vbox.addWidget(QLabel(address)) @@ -879,13 +880,9 @@ class ElectrumWindow(QMainWindow): self.wallet.labels[address] = label self.update_receive_item(self.receive_list.currentItem()) - if self.qr_window: self.qr_window.set_content( address, label, amount ) - #print "raise" - #self.raise_() - #self.receive_list.currentItem().setFocus(True) - + def details_button_text(self): return _('Hide details') if self.detailed_view else _('Show details') @@ -926,8 +923,9 @@ class ElectrumWindow(QMainWindow): if not item: return addr = unicode(item.text(1)) menu = QMenu() - menu.addAction(_("Copy to Clipboard"), lambda: self.app.clipboard().setText(addr)) - menu.addAction(_("Request payment"), lambda: self.request_amount_dialog(addr)) + menu.addAction(_("Copy to clipboard"), lambda: self.app.clipboard().setText(addr)) + if self.qr_window and self.qr_window.isVisible(): + menu.addAction(_("Request amount"), lambda: self.request_amount_dialog(addr)) menu.addAction(_("Edit label"), lambda: self.edit_label(True)) menu.addAction(_("Sign message"), lambda: self.sign_message(addr)) @@ -995,7 +993,8 @@ class ElectrumWindow(QMainWindow): label = self.wallet.labels.get(address,'') item.setData(2,0,label) - amount_str = format_satoshis( self.wallet.requested_amounts.get(address,0) ) + amount = self.wallet.requested_amounts.get(address,None) + amount_str = format_satoshis( amount, False, self.wallet.num_zeros ) if amount is not None else "--" item.setData(3,0,amount_str) c, u = self.wallet.get_addr_balance(address)