From 371493c85421628e6c19b7809e4c1f23a09d9db0 Mon Sep 17 00:00:00 2001
From: Vincent Texier <vit@free.fr>
Date: Sat, 14 Feb 2015 22:07:47 +0100
Subject: [PATCH] Fix bug transactions tableheader units not refreshed

Fix bug refresh_block
---
 src/cutecoin/gui/currency_tab.py |  2 +-
 src/cutecoin/models/txhistory.py | 11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/cutecoin/gui/currency_tab.py b/src/cutecoin/gui/currency_tab.py
index a3491e86..16984dc8 100644
--- a/src/cutecoin/gui/currency_tab.py
+++ b/src/cutecoin/gui/currency_tab.py
@@ -180,7 +180,7 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
         sig_validity = self.community.get_parameters()['sigValidity']
         warning_expiration_time = int(sig_validity / 3)
         will_expire_soon = (current_time > expiration_date - warning_expiration_time)
-        text = "Connected : Block {0}".format(block_number['number'])
+        text = "Connected : Block {0}".format(block_number)
         self.status_label.setText(text)
 
         if will_expire_soon:
diff --git a/src/cutecoin/models/txhistory.py b/src/cutecoin/models/txhistory.py
index 93253641..62e52b8e 100644
--- a/src/cutecoin/models/txhistory.py
+++ b/src/cutecoin/models/txhistory.py
@@ -138,8 +138,8 @@ class HistoryTableModel(QAbstractTableModel):
         self.column_headers = (
             'Date',
             'UID/Public key',
-            'Payment\n({:})'.format(self.account.diff_ref_name(self.community.short_currency)),
-            'Deposit\n({:})'.format(self.account.diff_ref_name(self.community.short_currency)),
+            'Payment',
+            'Deposit',
             'Comment',
             'State'
         )
@@ -156,6 +156,12 @@ class HistoryTableModel(QAbstractTableModel):
 
     def headerData(self, section, orientation, role):
         if role == Qt.DisplayRole:
+            if self.column_types[section] == 'payment' or self.column_types[section] == 'deposit':
+                return '{:}\n({:})'.format(
+                    self.column_headers[section],
+                    self.account.diff_ref_name(self.community.short_currency)
+                )
+
             return self.column_headers[section]
 
     def data_received(self, transfer):
@@ -210,3 +216,4 @@ class HistoryTableModel(QAbstractTableModel):
 
     def flags(self, index):
         return Qt.ItemIsSelectable | Qt.ItemIsEnabled
+
-- 
GitLab