electrum

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

commit d2447ef309115c491fa4a4372c9c0c446f986be3
parent 477bd49577154079f6711713e86b49e6d39a134b
Author: ThomasV <thomasv@gitorious>
Date:   Sat,  9 Jun 2012 18:06:01 +0200

check item existence

Diffstat:
Mlib/gui_qt.py | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/gui_qt.py b/lib/gui_qt.py @@ -259,6 +259,7 @@ class ElectrumWindow(QMainWindow): def create_history_menu(self, position): self.history_list.selectedIndexes() item = self.history_list.currentItem() + if not item: return menu = QMenu() menu.addAction(_("Details"), lambda: self.tx_details(item,2)) menu.addAction(_("Edit description"), lambda: self.tx_label_clicked(item,2)) @@ -690,12 +691,13 @@ class ElectrumWindow(QMainWindow): # fixme: this function apparently has a side effect. # if it is not called the menu pops up several times self.contacts_list.selectedIndexes() + item = self.contacts_list.currentItem() + if not item: return addr = self.get_current_addr(False) menu = QMenu() menu.addAction(_("Pay to"), lambda: self.payto(addr)) menu.addAction(_("Copy to Clipboard"), lambda: self.app.clipboard().setText(addr)) menu.addAction(_("View QR code"),lambda: self.show_address_qrcode(addr)) - item = self.contacts_list.currentItem() label = unicode( item.text(1) ) if label not in self.wallet.aliases.keys(): menu.addAction(_("Edit label"), lambda: self.edit_label(False))