Browse Source

qt: minor fixes

283
ThomasV 9 years ago
parent
commit
f7293694cc
  1. 11
      gui/qt/address_list.py
  2. 7
      gui/qt/history_list.py
  3. 10
      gui/qt/main_window.py

11
gui/qt/address_list.py

@ -109,6 +109,8 @@ class AddressList(MyTreeWidget):
selected = self.selectedItems() selected = self.selectedItems()
multi_select = len(selected) > 1 multi_select = len(selected) > 1
addrs = [unicode(item.text(0)) for item in selected] addrs = [unicode(item.text(0)) for item in selected]
if not addrs:
return
if not multi_select: if not multi_select:
item = self.itemAt(position) item = self.itemAt(position)
col = self.currentColumn() col = self.currentColumn()
@ -155,3 +157,12 @@ class AddressList(MyTreeWidget):
run_hook('receive_menu', menu, addrs, self.wallet) run_hook('receive_menu', menu, addrs, self.wallet)
menu.exec_(self.viewport().mapToGlobal(position)) menu.exec_(self.viewport().mapToGlobal(position))
def create_account_menu(self, position, k, item):
menu = QMenu()
exp = item.isExpanded()
menu.addAction(_("Minimize") if exp else _("Maximize"), lambda: self.parent.account_set_expanded(item, k, not exp))
menu.addAction(_("Rename"), lambda: self.parent.edit_account_label(k))
if self.wallet.seed_version > 4:
menu.addAction(_("View details"), lambda: self.parent.show_account_details(k))
menu.exec_(self.viewport().mapToGlobal(position))

7
gui/qt/history_list.py

@ -73,16 +73,17 @@ class HistoryList(MyTreeWidget):
current_tx = item.data(0, Qt.UserRole).toString() if item else None current_tx = item.data(0, Qt.UserRole).toString() if item else None
self.clear() self.clear()
run_hook('history_tab_update_begin') run_hook('history_tab_update_begin')
for tx in h: for h_item in h:
tx_hash, conf, value, timestamp, balance = tx tx_hash, conf, value, timestamp, balance = h_item
if conf is None and timestamp is None: if conf is None and timestamp is None:
continue # skip history in offline mode continue # skip history in offline mode
icon, time_str = self.get_icon(conf, timestamp) icon, time_str = self.get_icon(conf, timestamp)
v_str = self.parent.format_amount(value, True, whitespaces=True) v_str = self.parent.format_amount(value, True, whitespaces=True)
balance_str = self.parent.format_amount(balance, whitespaces=True) balance_str = self.parent.format_amount(balance, whitespaces=True)
label = self.wallet.get_label(tx_hash) label = self.wallet.get_label(tx_hash)
entry = ['', tx_hash, time_str, label, v_str, balance_str] entry = ['', tx_hash, time_str, label, v_str, balance_str]
run_hook('history_tab_update', tx, entry) run_hook('history_tab_update', h_item, entry)
item = QTreeWidgetItem(entry) item = QTreeWidgetItem(entry)
item.setIcon(0, icon) item.setIcon(0, icon)
for i in range(len(entry)): for i in range(len(entry)):

10
gui/qt/main_window.py

@ -1450,16 +1450,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
item.setExpanded(b) item.setExpanded(b)
self.accounts_expanded[k] = b self.accounts_expanded[k] = b
def create_account_menu(self, position, k, item):
menu = QMenu()
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))
menu.exec_(self.address_list.viewport().mapToGlobal(position))
def get_coins(self): def get_coins(self):
if self.pay_from: if self.pay_from:
return self.pay_from return self.pay_from

Loading…
Cancel
Save