From 059f113d954de419e0ad9e0c8b48e33134b52b03 Mon Sep 17 00:00:00 2001 From: mailchuck Date: Mon, 19 Oct 2015 17:22:37 +0200 Subject: [PATCH] Account labels become editable again Fixes #60 --- src/bitmessageqt/__init__.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index b896b879..539a3523 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -3301,17 +3301,22 @@ class MyForm(QtGui.QMainWindow): return False # Group of functions for the Your Identities dialog box - def getCurrentAccount(self): + def getCurrentItem(self): treeWidget = self.getCurrentTreeWidget() - #treeWidget = self.ui.treeWidgetYourIdentities if treeWidget: currentItem = treeWidget.currentItem() if currentItem: - account = currentItem.address - return account - else: - # TODO need debug msg? - return False + return currentItem + return False + + def getCurrentAccount(self): + currentItem = self.getCurrentItem() + if currentItem: + account = currentItem.address + return account + else: + # TODO need debug msg? + return False def getCurrentFolder(self): treeWidget = self.getCurrentTreeWidget() @@ -3519,10 +3524,10 @@ class MyForm(QtGui.QMainWindow): if (not isinstance(item, Ui_AddressWidget)) or item.type != 'normal' or not self.getCurrentTreeWidget() or self.getCurrentTreeWidget().currentItem() is None: return # not visible - if (not self.getCurrentAccount()) or (not isinstance (self.getCurrentAccount(), Ui_AddressWidget)): + if (not self.getCurrentItem()) or (not isinstance (self.getCurrentItem(), Ui_AddressWidget)): return # only currently selected item - if item.address != self.getCurrentTreeWidget().currentItem().address: + if item.address != self.getCurrentAccount(): return newLabel = str(item.text(0))