Format
This commit is contained in:
parent
6cf0447c3b
commit
dc72103c6a
14
src/option.c
14
src/option.c
@ -513,11 +513,8 @@ zenity_create_context (void) {
|
|||||||
tmp_ctx = g_option_context_new (NULL);
|
tmp_ctx = g_option_context_new (NULL);
|
||||||
|
|
||||||
/* Adds general option entries */
|
/* Adds general option entries */
|
||||||
a_group = g_option_group_new ("general",
|
a_group = g_option_group_new (
|
||||||
"General options",
|
"general", "General options", "Show general options", NULL, NULL);
|
||||||
"Show general options",
|
|
||||||
NULL,
|
|
||||||
NULL);
|
|
||||||
g_option_group_add_entries (a_group, general_options);
|
g_option_group_add_entries (a_group, general_options);
|
||||||
g_option_group_set_parse_hooks (
|
g_option_group_set_parse_hooks (
|
||||||
a_group, zenity_general_pre_callback, zenity_general_post_callback);
|
a_group, zenity_general_pre_callback, zenity_general_post_callback);
|
||||||
@ -525,11 +522,8 @@ zenity_create_context (void) {
|
|||||||
g_option_context_add_group (tmp_ctx, a_group);
|
g_option_context_add_group (tmp_ctx, a_group);
|
||||||
|
|
||||||
/* Adds entry option entries */
|
/* Adds entry option entries */
|
||||||
a_group = g_option_group_new ("entry",
|
a_group = g_option_group_new (
|
||||||
"Text entry options",
|
"entry", "Text entry options", "Show text entry options", NULL, NULL);
|
||||||
"Show text entry options",
|
|
||||||
NULL,
|
|
||||||
NULL);
|
|
||||||
g_option_group_add_entries (a_group, entry_options);
|
g_option_group_add_entries (a_group, entry_options);
|
||||||
g_option_group_set_parse_hooks (
|
g_option_group_set_parse_hooks (
|
||||||
a_group, zenity_entry_pre_callback, zenity_entry_post_callback);
|
a_group, zenity_entry_pre_callback, zenity_entry_post_callback);
|
||||||
|
@ -30,11 +30,7 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum {
|
typedef enum { MODE_ENTRY, MODE_LIST, MODE_LAST } ZenityDialogMode;
|
||||||
MODE_ENTRY,
|
|
||||||
MODE_LIST,
|
|
||||||
MODE_LAST
|
|
||||||
} ZenityDialogMode;
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ERROR_SYNTAX,
|
ERROR_SYNTAX,
|
||||||
|
28
src/tree.c
28
src/tree.c
@ -61,11 +61,8 @@ zenity_tree_dialog_untoggle (
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
check_or_radio_label_activated_cb (GtkTreeView *tree_view,
|
check_or_radio_label_activated_cb (GtkTreeView *tree_view, GtkTreePath *path,
|
||||||
GtkTreePath *path,
|
GtkTreeViewColumn *column, gpointer user_data) {
|
||||||
GtkTreeViewColumn *column,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
|
GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
gboolean value;
|
gboolean value;
|
||||||
@ -444,18 +441,15 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data) {
|
|||||||
|
|
||||||
tree_view = gtk_builder_get_object (builder, "zenity_tree_view");
|
tree_view = gtk_builder_get_object (builder, "zenity_tree_view");
|
||||||
|
|
||||||
if (tree_data->radiobox || tree_data->checkbox)
|
if (tree_data->radiobox || tree_data->checkbox) {
|
||||||
{
|
gtk_tree_view_set_activate_on_single_click (
|
||||||
gtk_tree_view_set_activate_on_single_click (GTK_TREE_VIEW(tree_view),
|
GTK_TREE_VIEW (tree_view), TRUE);
|
||||||
TRUE);
|
|
||||||
|
|
||||||
g_signal_connect (tree_view,
|
g_signal_connect (tree_view,
|
||||||
"row-activated",
|
"row-activated",
|
||||||
G_CALLBACK (check_or_radio_label_activated_cb),
|
G_CALLBACK (check_or_radio_label_activated_cb),
|
||||||
data);
|
data);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
g_signal_connect (tree_view,
|
g_signal_connect (tree_view,
|
||||||
"row-activated",
|
"row-activated",
|
||||||
G_CALLBACK (zenity_tree_row_activated),
|
G_CALLBACK (zenity_tree_row_activated),
|
||||||
@ -489,14 +483,11 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data) {
|
|||||||
|
|
||||||
gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (model));
|
gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (model));
|
||||||
|
|
||||||
if (tree_data->radiobox || tree_data->checkbox)
|
if (tree_data->radiobox || tree_data->checkbox) {
|
||||||
{
|
|
||||||
gtk_tree_selection_set_mode (
|
gtk_tree_selection_set_mode (
|
||||||
gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
|
gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
|
||||||
GTK_SELECTION_SINGLE);
|
GTK_SELECTION_SINGLE);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
if (tree_data->multi)
|
if (tree_data->multi)
|
||||||
gtk_tree_selection_set_mode (
|
gtk_tree_selection_set_mode (
|
||||||
gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
|
gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
|
||||||
@ -641,8 +632,7 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data) {
|
|||||||
* despite it not containing any user readable text.
|
* despite it not containing any user readable text.
|
||||||
* Set it to second column instead if it exists. */
|
* Set it to second column instead if it exists. */
|
||||||
if (tree_data->imagebox && n_columns > 1) {
|
if (tree_data->imagebox && n_columns > 1) {
|
||||||
gtk_tree_view_set_search_column (GTK_TREE_VIEW (tree_view),
|
gtk_tree_view_set_search_column (GTK_TREE_VIEW (tree_view), 1);
|
||||||
1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
zenity_util_show_dialog (dialog, data->attach);
|
zenity_util_show_dialog (dialog, data->attach);
|
||||||
|
@ -81,8 +81,7 @@ zenity_util_load_ui_file (const gchar *root_widget, ...) {
|
|||||||
g_strfreev (objects);
|
g_strfreev (objects);
|
||||||
|
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
g_warning ("Could not load ui data: %s",
|
g_warning ("Could not load ui data: %s", error->message);
|
||||||
error->message);
|
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
g_object_unref (builder);
|
g_object_unref (builder);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
0
utils/format.sh
Normal file → Executable file
0
utils/format.sh
Normal file → Executable file
Reference in New Issue
Block a user