1
0

simplify get_label

This commit is contained in:
ThomasV
2015-12-15 12:52:30 +01:00
parent 2990b1e865
commit 9d3162b1a1
10 changed files with 12 additions and 42 deletions

View File

@@ -74,7 +74,7 @@ class HistoryWidget(MyTreeWidget):
icon, time_str = self.get_icon(conf, timestamp)
v_str = self.parent.format_amount(value, True, whitespaces=True)
balance_str = self.parent.format_amount(balance, whitespaces=True)
label, is_default_label = self.wallet.get_label(tx_hash)
label = self.wallet.get_label(tx_hash)
entry = ['', tx_hash, time_str, label, v_str, balance_str]
run_hook('history_tab_update', tx, entry)
item = QTreeWidgetItem(entry)
@@ -88,8 +88,6 @@ class HistoryWidget(MyTreeWidget):
item.setForeground(4, QBrush(QColor("#BC1E1E")))
if tx_hash:
item.setData(0, Qt.UserRole, tx_hash)
if is_default_label:
item.setForeground(3, QBrush(QColor('grey')))
self.insertTopLevelItem(0, item)
if current_tx == tx_hash:
self.setCurrentItem(item)

View File

@@ -2435,7 +2435,7 @@ class ElectrumWindow(QMainWindow, PrintError):
value_string = '--'
if tx_hash:
label, is_default_label = wallet.get_label(tx_hash)
label = wallet.get_label(tx_hash)
label = label.encode('utf-8')
else:
label = ""

View File

@@ -173,7 +173,7 @@ class TxDialog(QDialog):
status = _("Signed")
if tx_hash in self.wallet.transactions.keys():
desc, is_default = self.wallet.get_label(tx_hash)
desc = self.wallet.get_label(tx_hash)
conf, timestamp = self.wallet.get_confirmations(tx_hash)
if timestamp:
time_str = datetime.datetime.fromtimestamp(timestamp).isoformat(' ')[:-3]

View File

@@ -383,12 +383,6 @@ class MyTreeWidget(QTreeWidget):
key = str(item.data(0, Qt.UserRole).toString())
text = unicode(item.text(column))
self.parent.wallet.set_label(key, text)
if text:
item.setForeground(column, QBrush(QColor('black')))
else:
text = self.parent.wallet.get_default_label(key)
item.setText(column, text)
item.setForeground(column, QBrush(QColor('gray')))
self.parent.history_list.update()
self.parent.update_completions()