[meld] Simplify column visibility handling
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Simplify column visibility handling
- Date: Tue, 8 Jan 2013 19:43:22 +0000 (UTC)
commit 0bf581ec3200aa7869c4d3422593a64d32714dd8
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Jan 6 07:03:01 2013 +1000
Simplify column visibility handling
meld/dirdiff.py | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 499c419..cf32a36 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -1272,20 +1272,19 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
return gtk.RESPONSE_OK
def update_treeview_columns(self, columns):
- """Adjusts visibility and order or columns, second arg
- as in create_treeview_columns"""
+ """Update the visibility and order of columns"""
for i in range(3):
- num_visible_cols = 1
+ extra_cols = False
last_column = self.treeview[i].get_column(0)
for line in columns:
- column_name, column_visibility = line.rsplit(" ", 1)
- column_visibility = bool(int(column_visibility))
- num_visible_cols = num_visible_cols + int(column_visibility)
+ 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(column_visibility)
+ 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(num_visible_cols != 1)
+ self.treeview[i].set_headers_visible(extra_cols)
def create_treeview_columns(self, columns):
"""Creates the columns properly, second argument is a string
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]