Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Commit

Permalink
follow-up c3fd7db: editable_columns is now a set
Browse files Browse the repository at this point in the history
  • Loading branch information
SomberNight committed Feb 16, 2018
1 parent c3fd7db commit c4d3167
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions gui/qt/history_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ def __init__(self, parent=None):
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):
Expand Down
4 changes: 3 additions & 1 deletion gui/qt/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ def __init__(self, parent, create_menu, headers, stretch_column=None,
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)
Expand Down

0 comments on commit c4d3167

Please sign in to comment.