Browse Source

code cleanup

283
ThomasV 10 years ago
parent
commit
98b361f328
  1. 6
      gui/qt/main_window.py
  2. 4
      gui/qt/util.py

6
gui/qt/main_window.py

@ -1414,10 +1414,8 @@ class ElectrumWindow(QMainWindow):
def create_account_menu(self, position, k, item):
menu = QMenu()
if item.isExpanded():
menu.addAction(_("Minimize"), lambda: self.account_set_expanded(item, k, False))
else:
menu.addAction(_("Maximize"), lambda: self.account_set_expanded(item, k, True))
exp = item.isExpanded()
menu.addAction(_("Minimize") if exp else _("Maximize"), lambda: self.account_set_expanded(item, k, not exp))
menu.addAction(_("Rename"), lambda: self.edit_account_label(k))
if self.wallet.seed_version > 4:
menu.addAction(_("View details"), lambda: self.show_account_details(k))

4
gui/qt/util.py

@ -210,9 +210,9 @@ class MyTreeWidget(QTreeWidget):
def __init__(self, parent):
QTreeWidget.__init__(self, parent)
self.setContextMenuPolicy(Qt.CustomContextMenu)
self.connect(self, SIGNAL('itemActivated(QTreeWidgetItem*, int)'), self.itemactivated)
self.itemActivated.connect(self.on_activated)
def itemactivated(self, item):
def on_activated(self, item):
if not item: return
for i in range(0,self.viewport().height()/5):
if self.itemAt(QPoint(0,i*5)) == item:

Loading…
Cancel
Save