commit c4d31674abec59b8fddbbd480dfe9d96c9cca9e8
parent c3fd7db3107cf0dc64c68b6a069fac4aec148db5
Author: SomberNight <somber.night@protonmail.com>
Date: Fri, 16 Feb 2018 16:12:08 +0100
follow-up c3fd7db3107cf0dc64c68b6a069fac4aec148db5: editable_columns is now a set
Diffstat:
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/gui/qt/history_list.py b/gui/qt/history_list.py
@@ -58,15 +58,15 @@ class HistoryList(MyTreeWidget, AcceptFileDragDrop):
self.setColumnHidden(1, True)
def refresh_headers(self):
- headers = ['', '', _('Date'), _('Description') , _('Amount'), _('Balance')]
+ headers = ['', '', _('Date'), _('Description'), _('Amount'), _('Balance')]
fx = self.parent.fx
if fx and fx.show_history():
headers.extend(['%s '%fx.ccy + _('Value')])
headers.extend(['%s '%fx.ccy + _('Acquisition price')])
headers.extend(['%s '%fx.ccy + _('Capital Gains')])
- fiat_value_column = 6
- if fiat_value_column not in self.editable_columns:
- self.editable_columns.extend([fiat_value_column])
+ self.editable_columns |= {6}
+ else:
+ self.editable_columns -= {6}
self.update_headers(headers)
def get_domain(self):
diff --git a/gui/qt/util.py b/gui/qt/util.py
@@ -389,7 +389,9 @@ class MyTreeWidget(QTreeWidget):
self.editor = None
self.pending_update = False
if editable_columns is None:
- editable_columns = [stretch_column]
+ editable_columns = {stretch_column}
+ else:
+ editable_columns = set(editable_columns)
self.editable_columns = editable_columns
self.setItemDelegate(ElectrumItemDelegate(self))
self.itemDoubleClicked.connect(self.on_doubleclick)