[meld] Reorder preference handling to be more consistent



commit 1b99cca0d7f4a58edab71e4416cc7c610bf17116
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Jan 6 07:08:03 2013 +1000

    Reorder preference handling to be more consistent

 meld/dirdiff.py |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 8d6c6dd..ae52764 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -370,6 +370,25 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
         for diffmap in self.diffmap:
             diffmap.queue_draw()
 
+    def on_preference_changed(self, key, value):
+        if key == "dirdiff_columns":
+            self.update_treeview_columns(value)
+
+    def update_treeview_columns(self, columns):
+        """Update the visibility and order of columns"""
+        for i in range(3):
+            extra_cols = False
+            last_column = self.treeview[i].get_column(0)
+            for line in columns:
+                column_name, visible = line.rsplit(" ", 1)
+                visible = bool(int(visible))
+                extra_cols = extra_cols or visible
+                current_column = self.columns_dict[i][column_name]
+                current_column.set_visible(visible)
+                self.treeview[i].move_column_after(current_column, last_column)
+                last_column = current_column
+            self.treeview[i].set_headers_visible(extra_cols)
+
     def on_custom_filter_menu_toggled(self, item):
         if item.get_active():
             self.custom_popup.connect("deactivate",
@@ -1305,22 +1324,3 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
             app.disconnect(h)
 
         return gtk.RESPONSE_OK
-
-    def update_treeview_columns(self, columns):
-        """Update the visibility and order of columns"""
-        for i in range(3):
-            extra_cols = False
-            last_column = self.treeview[i].get_column(0)
-            for line in columns:
-                column_name, visible = line.rsplit(" ", 1)
-                visible = bool(int(visible))
-                extra_cols = extra_cols or visible
-                current_column = self.columns_dict[i][column_name]
-                current_column.set_visible(visible)
-                self.treeview[i].move_column_after(current_column, last_column)
-                last_column = current_column
-            self.treeview[i].set_headers_visible(extra_cols)
-
-    def on_preference_changed(self, key, value):
-        if key == "dirdiff_columns":
-            self.update_treeview_columns(value)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]