Account labels become editable again

Fixes #60
This commit is contained in:
mailchuck 2015-10-19 17:22:37 +02:00
parent 6639a19126
commit 08dff8e118
No known key found for this signature in database
GPG Key ID: B6311FA753FBF089

View File

@ -3299,17 +3299,22 @@ class MyForm(QtGui.QMainWindow):
return False return False
# Group of functions for the Your Identities dialog box # Group of functions for the Your Identities dialog box
def getCurrentAccount(self): def getCurrentItem(self):
treeWidget = self.getCurrentTreeWidget() treeWidget = self.getCurrentTreeWidget()
#treeWidget = self.ui.treeWidgetYourIdentities
if treeWidget: if treeWidget:
currentItem = treeWidget.currentItem() currentItem = treeWidget.currentItem()
if currentItem: if currentItem:
account = currentItem.address return currentItem
return account return False
else:
# TODO need debug msg? def getCurrentAccount(self):
return False currentItem = self.getCurrentItem()
if currentItem:
account = currentItem.address
return account
else:
# TODO need debug msg?
return False
def getCurrentFolder(self): def getCurrentFolder(self):
treeWidget = self.getCurrentTreeWidget() treeWidget = self.getCurrentTreeWidget()
@ -3517,10 +3522,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: if (not isinstance(item, Ui_AddressWidget)) or item.type != 'normal' or not self.getCurrentTreeWidget() or self.getCurrentTreeWidget().currentItem() is None:
return return
# not visible # 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 return
# only currently selected item # only currently selected item
if item.address != self.getCurrentTreeWidget().currentItem().address: if item.address != self.getCurrentAccount():
return return
newLabel = str(item.text(0)) newLabel = str(item.text(0))