tqt history list: fix sort order of fiat columns - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 4a7ce238fd312d5ed78fdcce92beec7f2f37ebb4 DIR parent d4d5e32c91788115c754b933a1e8e6e0338fb196 HTML Author: SomberNight <somber.night@protonmail.com> Date: Tue, 27 Nov 2018 21:32:55 +0100 qt history list: fix sort order of fiat columns Diffstat: M electrum/gui/qt/history_list.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- DIR diff --git a/electrum/gui/qt/history_list.py b/electrum/gui/qt/history_list.py t@@ -266,7 +266,6 @@ class HistoryList(MyTreeWidget, AcceptFileDragDrop): item = SortableTreeWidgetItem(entry) item.setIcon(0, icon) item.setToolTip(0, str(conf) + " confirmation" + ("s" if conf != 1 else "")) - item.setData(0, SortableTreeWidgetItem.DataRole, (status, conf)) if has_invoice: item.setIcon(3, self.icon_cache.get(":icons/seal")) for i in range(len(entry)): t@@ -279,6 +278,15 @@ class HistoryList(MyTreeWidget, AcceptFileDragDrop): item.setForeground(4, red_brush) if fiat_value is not None and not tx_item['fiat_default']: item.setForeground(6, blue_brush) + # sort orders + item.setData(0, SortableTreeWidgetItem.DataRole, (status, conf)) + item.setData(4, SortableTreeWidgetItem.DataRole, value_sat) + item.setData(5, SortableTreeWidgetItem.DataRole, balance) + if fiat_value is not None: + item.setData(6, SortableTreeWidgetItem.DataRole, fiat_value) + if value_sat < 0: + item.setData(7, SortableTreeWidgetItem.DataRole, tx_item['acquisition_price'].value) + item.setData(8, SortableTreeWidgetItem.DataRole, tx_item['capital_gain'].value) if tx_hash: item.setData(0, self.TX_HASH_ROLE, tx_hash) item.setData(0, self.TX_VALUE_ROLE, value_sat)