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

This commit is contained in:
Bryce Harrington 2009-08-10 04:10:53 +01:00 committed by Lucas Rocha
parent 171e59e3ea
commit 8e190dbb1f
3 changed files with 20 additions and 0 deletions

View File

@ -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;

View File

@ -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);

View File

@ -111,6 +111,7 @@ typedef struct {
GSList *columns;
gboolean checkbox;
gboolean radiobox;
gboolean hide_header;
gchar *separator;
gboolean multi;
gboolean editable;