Bug 552971 - Add a hide-header option to list dialog
This commit is contained in:
parent
171e59e3ea
commit
8e190dbb1f
16
src/option.c
16
src/option.c
@ -74,6 +74,7 @@ static gboolean zenity_list_checklist;
|
|||||||
static gboolean zenity_list_radiolist;
|
static gboolean zenity_list_radiolist;
|
||||||
static gchar *zenity_list_print_column;
|
static gchar *zenity_list_print_column;
|
||||||
static gchar *zenity_list_hide_column;
|
static gchar *zenity_list_hide_column;
|
||||||
|
static gchar *zenity_list_hide_header;
|
||||||
|
|
||||||
/* Notification Dialog Options */
|
/* Notification Dialog Options */
|
||||||
static gboolean zenity_notification_active;
|
static gboolean zenity_notification_active;
|
||||||
@ -502,6 +503,15 @@ static GOptionEntry list_options[] = {
|
|||||||
N_("Hide a specific column"),
|
N_("Hide a specific column"),
|
||||||
N_("NUMBER")
|
N_("NUMBER")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"hide-header",
|
||||||
|
'\0',
|
||||||
|
G_OPTION_FLAG_NOALIAS,
|
||||||
|
G_OPTION_ARG_NONE,
|
||||||
|
&zenity_list_hide_header,
|
||||||
|
N_("Hides the column headers"),
|
||||||
|
NULL
|
||||||
|
},
|
||||||
{
|
{
|
||||||
NULL
|
NULL
|
||||||
}
|
}
|
||||||
@ -1010,6 +1020,7 @@ zenity_list_pre_callback (GOptionContext *context,
|
|||||||
zenity_list_columns = NULL;
|
zenity_list_columns = NULL;
|
||||||
zenity_list_checklist = FALSE;
|
zenity_list_checklist = FALSE;
|
||||||
zenity_list_radiolist = FALSE;
|
zenity_list_radiolist = FALSE;
|
||||||
|
zenity_list_hide_header = FALSE;
|
||||||
zenity_list_print_column = NULL;
|
zenity_list_print_column = NULL;
|
||||||
zenity_list_hide_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->editable = zenity_general_editable;
|
||||||
results->tree_data->print_column = zenity_list_print_column;
|
results->tree_data->print_column = zenity_list_print_column;
|
||||||
results->tree_data->hide_column = zenity_list_hide_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;
|
results->tree_data->separator = zenity_general_separator;
|
||||||
} else {
|
} else {
|
||||||
if (zenity_list_columns)
|
if (zenity_list_columns)
|
||||||
@ -1315,6 +1327,10 @@ zenity_list_post_callback (GOptionContext *context,
|
|||||||
if (zenity_list_hide_column)
|
if (zenity_list_hide_column)
|
||||||
zenity_option_error (zenity_option_get_name (list_options, &zenity_list_hide_column),
|
zenity_option_error (zenity_option_get_name (list_options, &zenity_list_hide_column),
|
||||||
ERROR_SUPPORT);
|
ERROR_SUPPORT);
|
||||||
|
|
||||||
|
if (zenity_list_hide_header)
|
||||||
|
zenity_option_error (zenity_option_get_name (list_options, &zenity_list_hide_header),
|
||||||
|
ERROR_SUPPORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -480,6 +480,9 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
|
|||||||
|
|
||||||
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree_view), TRUE);
|
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->radiobox || tree_data->checkbox) {
|
||||||
if (tree_data->data && *tree_data->data)
|
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);
|
zenity_tree_fill_entries (GTK_TREE_VIEW (tree_view), tree_data->data, n_columns, TRUE, tree_data->editable);
|
||||||
|
@ -111,6 +111,7 @@ typedef struct {
|
|||||||
GSList *columns;
|
GSList *columns;
|
||||||
gboolean checkbox;
|
gboolean checkbox;
|
||||||
gboolean radiobox;
|
gboolean radiobox;
|
||||||
|
gboolean hide_header;
|
||||||
gchar *separator;
|
gchar *separator;
|
||||||
gboolean multi;
|
gboolean multi;
|
||||||
gboolean editable;
|
gboolean editable;
|
||||||
|
Reference in New Issue
Block a user