trying to fix column_widths
authorecdsa <ecdsa@github>
Sat, 13 Apr 2013 16:15:55 +0000 (18:15 +0200)
committerecdsa <ecdsa@github>
Sat, 13 Apr 2013 16:15:55 +0000 (18:15 +0200)
gui/gui_classic.py

index fb37c53..e5031df 100644 (file)
@@ -254,8 +254,7 @@ def text_dialog(parent, title, label, ok_label):
 
 
 
-default_column_widths = { "history":[40,140,350,140], "contacts":[350,330], 
-       "receive":[[370],[370,200,130]] }
+default_column_widths = { "history":[40,140,350,140], "contacts":[350,330], "receive":[[370], [370,200,130]] }
 
 class ElectrumWindow(QMainWindow):
 
@@ -965,6 +964,8 @@ class ElectrumWindow(QMainWindow):
         for i in range(self.contacts_list.columnCount() - 1):
             self.column_widths["contacts"].append(self.contacts_list.columnWidth(i))
 
+        self.config.set_key("column_widths", self.column_widths, True)
+
 
     def create_contacts_tab(self):
         l,w,hbox = self.create_list_tab([_('Address'), _('Label'), _('Tx')])
@@ -1084,12 +1085,8 @@ class ElectrumWindow(QMainWindow):
         l.clear()
         l.setColumnHidden(2, not self.expert_mode)
         l.setColumnHidden(3, not self.expert_mode)
-        if not self.expert_mode:
-            width = self.column_widths['receive'][0][0]
-            l.setColumnWidth(0, width)
-        else:
-            for i,width in enumerate(self.column_widths['receive'][self.expert_mode]):
-                l.setColumnWidth(i, width)        
+        for i,width in enumerate(self.column_widths['receive'][self.expert_mode]):
+            l.setColumnWidth(i, width)
 
         if self.current_account is None:
             account_items = self.wallet.accounts.items()
@@ -2283,7 +2280,6 @@ class ElectrumWindow(QMainWindow):
         g = self.geometry()
         self.config.set_key("winpos-qt", [g.left(),g.top(),g.width(),g.height()], True)
         self.save_column_widths()
-        self.config.set_key("column_widths", self.column_widths, True)
         self.config.set_key("console-history",self.console.history[-50:])
         event.accept()