From 40d46e951fa31861790bca8b55768984322efe3e Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sat, 7 Apr 2012 20:23:08 +0200 Subject: [PATCH] edit labels --- client/electrum4a.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/client/electrum4a.py b/client/electrum4a.py index 1aca942dc..a5a32cd99 100755 --- a/client/electrum4a.py +++ b/client/electrum4a.py @@ -47,13 +47,17 @@ def modal_question(q,msg): return response.get('which') == 'positive' def edit_label(addr): - droid.dialogCreateAlert('edit label') + droid.dialogCreateInput('Edit label','',wallet.labels.get(addr)) droid.dialogSetPositiveButtonText('OK') droid.dialogSetNegativeButtonText('Cancel') droid.dialogShow() response = droid.dialogGetResponse().result droid.dialogDismiss() - + if response.get('which') == 'positive': + wallet.labels[addr] = response.get('value') + wallet.update_tx_history() + wallet.save() + droid.fullSetProperty("labelTextView", "text", wallet.labels.get(addr)) def select_from_contacts(): title = 'Contacts:' @@ -201,7 +205,15 @@ def qr_layout(addr): android:antialias="false" android:src="file:///sdcard/sl4a/qrcode.bmp" /> - """%addr) + + + + """%(addr,wallet.labels.get(addr,''))) payto_layout = make_layout("""