This commit is contained in:
TheBrokenRail 2022-03-10 22:37:39 -05:00
parent 6cf0447c3b
commit dc72103c6a
6 changed files with 86 additions and 107 deletions

View File

@ -513,11 +513,8 @@ zenity_create_context (void) {
tmp_ctx = g_option_context_new (NULL);
/* Adds general option entries */
a_group = g_option_group_new ("general",
"General options",
"Show general options",
NULL,
NULL);
a_group = g_option_group_new (
"general", "General options", "Show general options", NULL, NULL);
g_option_group_add_entries (a_group, general_options);
g_option_group_set_parse_hooks (
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);
/* Adds entry option entries */
a_group = g_option_group_new ("entry",
"Text entry options",
"Show text entry options",
NULL,
NULL);
a_group = g_option_group_new (
"entry", "Text entry options", "Show text entry options", NULL, NULL);
g_option_group_add_entries (a_group, entry_options);
g_option_group_set_parse_hooks (
a_group, zenity_entry_pre_callback, zenity_entry_post_callback);

View File

@ -30,11 +30,7 @@
#include <locale.h>
#endif
typedef enum {
MODE_ENTRY,
MODE_LIST,
MODE_LAST
} ZenityDialogMode;
typedef enum { MODE_ENTRY, MODE_LIST, MODE_LAST } ZenityDialogMode;
typedef enum {
ERROR_SYNTAX,

View File

@ -61,11 +61,8 @@ zenity_tree_dialog_untoggle (
}
static void
check_or_radio_label_activated_cb (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column,
gpointer user_data)
{
check_or_radio_label_activated_cb (GtkTreeView *tree_view, GtkTreePath *path,
GtkTreeViewColumn *column, gpointer user_data) {
GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
GtkTreeIter iter;
gboolean value;
@ -444,18 +441,15 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data) {
tree_view = gtk_builder_get_object (builder, "zenity_tree_view");
if (tree_data->radiobox || tree_data->checkbox)
{
gtk_tree_view_set_activate_on_single_click (GTK_TREE_VIEW(tree_view),
TRUE);
if (tree_data->radiobox || tree_data->checkbox) {
gtk_tree_view_set_activate_on_single_click (
GTK_TREE_VIEW (tree_view), TRUE);
g_signal_connect (tree_view,
"row-activated",
G_CALLBACK (check_or_radio_label_activated_cb),
data);
}
else
{
} else {
g_signal_connect (tree_view,
"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));
if (tree_data->radiobox || tree_data->checkbox)
{
if (tree_data->radiobox || tree_data->checkbox) {
gtk_tree_selection_set_mode (
gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
GTK_SELECTION_SINGLE);
}
else
{
} else {
if (tree_data->multi)
gtk_tree_selection_set_mode (
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.
* Set it to second column instead if it exists. */
if (tree_data->imagebox && n_columns > 1) {
gtk_tree_view_set_search_column (GTK_TREE_VIEW (tree_view),
1);
gtk_tree_view_set_search_column (GTK_TREE_VIEW (tree_view), 1);
}
zenity_util_show_dialog (dialog, data->attach);

View File

@ -81,8 +81,7 @@ zenity_util_load_ui_file (const gchar *root_widget, ...) {
g_strfreev (objects);
if (result == 0) {
g_warning ("Could not load ui data: %s",
error->message);
g_warning ("Could not load ui data: %s", error->message);
g_error_free (error);
g_object_unref (builder);
return NULL;

0
utils/format.sh Normal file → Executable file
View File