[zenity] Bug 552971 - Add a hide-header option to list dialog



commit 8e190dbb1f39eae31210f7d4c97a4c5ebb496907
Author: Bryce Harrington <bryce canonical com>
Date:   Mon Aug 10 04:10:53 2009 +0100

    Bug 552971 - Add a hide-header option to list dialog

 src/option.c |   16 ++++++++++++++++
 src/tree.c   |    3 +++
 src/zenity.h |    1 +
 3 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/option.c b/src/option.c
index 1bc2eaf..58ea538 100644
--- a/src/option.c
+++ b/src/option.c
@@ -74,6 +74,7 @@ static gboolean zenity_list_checklist;
 static gboolean zenity_list_radiolist;
 static gchar   *zenity_list_print_column;
 static gchar   *zenity_list_hide_column;
+static gchar   *zenity_list_hide_header;
 
 /* Notification Dialog Options */
 static gboolean zenity_notification_active;
@@ -502,6 +503,15 @@ static GOptionEntry list_options[] = {
     N_("Hide a specific column"),
     N_("NUMBER")
   },
+  {
+    "hide-header",
+    '\0',
+    G_OPTION_FLAG_NOALIAS,
+    G_OPTION_ARG_NONE,
+    &zenity_list_hide_header,
+    N_("Hides the column headers"),
+    NULL
+  },
   { 
     NULL 
   } 
@@ -1010,6 +1020,7 @@ zenity_list_pre_callback (GOptionContext *context,
   zenity_list_columns = NULL;
   zenity_list_checklist = FALSE;
   zenity_list_radiolist = FALSE;
+  zenity_list_hide_header = FALSE;
   zenity_list_print_column = NULL;
   zenity_list_hide_column = NULL;
 
@@ -1294,6 +1305,7 @@ zenity_list_post_callback (GOptionContext *context,
     results->tree_data->editable = zenity_general_editable;
     results->tree_data->print_column = zenity_list_print_column;
     results->tree_data->hide_column = zenity_list_hide_column;
+    results->tree_data->hide_header = zenity_list_hide_header;
     results->tree_data->separator = zenity_general_separator;
   } else {
     if (zenity_list_columns)
@@ -1315,6 +1327,10 @@ zenity_list_post_callback (GOptionContext *context,
     if (zenity_list_hide_column)
       zenity_option_error (zenity_option_get_name (list_options, &zenity_list_hide_column),
                            ERROR_SUPPORT);
+
+    if (zenity_list_hide_header)
+      zenity_option_error (zenity_option_get_name (list_options, &zenity_list_hide_header),
+                           ERROR_SUPPORT);
   }
     
   return TRUE;
diff --git a/src/tree.c b/src/tree.c
index da2cf47..f0fc187 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -480,6 +480,9 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
 
   gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree_view), TRUE);
 
+  if (tree_data->hide_header)
+    gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), FALSE);
+
   if (tree_data->radiobox || tree_data->checkbox) {
     if (tree_data->data && *tree_data->data)
       zenity_tree_fill_entries (GTK_TREE_VIEW (tree_view), tree_data->data, n_columns, TRUE, tree_data->editable);
diff --git a/src/zenity.h b/src/zenity.h
index 3248ad3..fa65b0c 100644
--- a/src/zenity.h
+++ b/src/zenity.h
@@ -111,6 +111,7 @@ typedef struct {
   GSList       *columns;
   gboolean      checkbox;
   gboolean      radiobox;
+  gboolean      hide_header;
   gchar        *separator;
   gboolean      multi;
   gboolean      editable;



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