diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/about.c | 242 | ||||
-rw-r--r-- | src/calendar.c | 116 | ||||
-rw-r--r-- | src/color.c | 61 | ||||
-rw-r--r-- | src/option.c | 10 | ||||
-rw-r--r-- | src/util.c | 15 | ||||
-rw-r--r-- | src/util.h | 3 | ||||
-rw-r--r-- | src/zenity.h | 1 | ||||
-rw-r--r-- | src/zenity.ui | 1091 |
8 files changed, 528 insertions, 1011 deletions
diff --git a/src/about.c b/src/about.c index 627aa1e..e01e0af 100644 --- a/src/about.c +++ b/src/about.c @@ -1,12 +1,15 @@ +/* vim: colorcolumn=80 ts=4 sw=4 + */ /* * about.c * - * Copyright (C) 2002 Sun Microsystems, Inc. - * Copyright (C) 2001 CodeFactory AB - * Copyright (C) 2001, 2002 Anders Carlsson + * Copyright © 2002 Sun Microsystems, Inc. + * Copyright © 2001 CodeFactory AB + * Copyright © 2001, 2002 Anders Carlsson + * Copyright © 2021 Logan Rathbone * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * @@ -15,7 +18,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. @@ -24,12 +27,13 @@ * Anders Carlsson <andersca@gnu.org> */ -#include "config.h" #include "util.h" #include "zenity.h" -#include <gdk/gdkkeysyms.h> + #include <string.h> +#include <config.h> + #define GTK_RESPONSE_CREDITS 0 #define ZENITY_HELP_PATH ZENITY_DATADIR "/help/" #define ZENITY_CLOTHES_PATH ZENITY_DATADIR "/clothes/" @@ -39,8 +43,8 @@ static GtkWidget *dialog; -static void zenity_about_dialog_response ( - GtkWidget *widget, int response, gpointer data); +static void zenity_about_dialog_response (GtkWidget *widget, + int response, gpointer data); /* Sync with the people in the THANKS file */ static const gchar *const authors[] = {"Glynn Foster <glynn foster sun com>", @@ -72,197 +76,15 @@ static const char *license[] = { "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA " "02110-1301, USA.")}; -#if 0 -static gint -zenity_move_clothes_event (GnomeCanvasItem *item, - GdkEvent *event, - gpointer data) -{ - static double x, y; - double new_x, new_y; - static int dragging; - double item_x, item_y; - - /* set item_[xy] to the event x,y position in the parent's - * item-relative coordinates - */ - - item_x = event->button.x; - item_y = event->button.y; - gnome_canvas_item_w2i (item->parent, &item_x, &item_y); - - switch (event->type) { - case GDK_BUTTON_PRESS: - x = item_x; - y = item_y; - gnome_canvas_item_ungrab (item, event->button.time); - gnome_canvas_item_raise_to_top (item); - dragging = TRUE; - break; - - case GDK_MOTION_NOTIFY: - if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { - new_x = item_x; - new_y = item_y; - - gnome_canvas_item_move (item, new_x - x, new_y - y); - x = new_x; - y = new_y; - } - break; - - case GDK_BUTTON_RELEASE: - gnome_canvas_item_ungrab (item, event->button.time); - dragging = FALSE; - break; - - default: - break; - } - - return FALSE; -} - -typedef struct -{ - const gchar *filename; - gdouble x, y; -} MonkClothes; - -static const MonkClothes monk_clothes[] = { - {"gnome-tshirt.png", 30.0, 20.0}, - {"sunglasses.png", ZENITY_CANVAS_X - 100.0 , ZENITY_CANVAS_Y - 150.0 }, - {"surfboard.png", 30.0, ZENITY_CANVAS_Y - 200.0}, - {"hawaii-shirt.png", ZENITY_CANVAS_X - 50.0, 20.0} -}; - -static void -zenity_create_clothes (GtkWidget *canvas_board) -{ - GdkPixbuf *pixbuf; - GnomeCanvasItem *canvas_item; - gchar *pixbuf_path; - size_t i; - - for (i = 0; i < G_N_ELEMENTS (monk_clothes); i++) { - pixbuf_path = g_strconcat (ZENITY_CLOTHES_PATH, monk_clothes[i].filename, NULL); - pixbuf = gdk_pixbuf_new_from_file (pixbuf_path, NULL); - - canvas_item = gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (canvas_board)->root), - GNOME_TYPE_CANVAS_PIXBUF, - "x", monk_clothes[i].x, - "y", monk_clothes[i].y, - "pixbuf", pixbuf, - "anchor", GTK_ANCHOR_NW, - NULL); - g_signal_connect (G_OBJECT (canvas_item), "event", - G_CALLBACK (zenity_move_clothes_event), NULL); - } -} - -static GtkWidget * -zenity_create_monk (void) -{ - GtkWidget *canvas_board; - GnomeCanvasItem *canvas_item; - GdkPixbuf *pixbuf; - GdkColor color = { 0, 0xffff, 0xffff, 0xffff }; - - canvas_board = gnome_canvas_new (); - - gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas_board), 0, 0, - ZENITY_CANVAS_X, ZENITY_CANVAS_Y); - - gtk_widget_set_size_request (canvas_board, ZENITY_CANVAS_X, ZENITY_CANVAS_Y); - - gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (canvas_board)), - &color, FALSE, TRUE); - - gtk_widget_modify_bg (GTK_WIDGET (canvas_board), GTK_STATE_NORMAL, &color); - - pixbuf = gdk_pixbuf_new_from_file (ZENITY_CLOTHES_PATH "monk.png", NULL); - - canvas_item = gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (canvas_board)->root), - GNOME_TYPE_CANVAS_PIXBUF, - "x", (ZENITY_CANVAS_X / 2.0)/2.0 + 10.0, - "y", (ZENITY_CANVAS_Y / 2.0)/2.0 - 50.0, - "pixbuf", pixbuf, - "anchor", GTK_ANCHOR_NW, - NULL); - - zenity_create_clothes (canvas_board); - - return canvas_board; -} - -static GtkWidget * -zenity_create_boutique (void) -{ - GtkWidget *window; - GtkWidget *canvas; - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - zenity_util_set_window_icon (window, NULL, ZENITY_IMAGE_FULLPATH ("zenity.png")); - canvas = zenity_create_monk (); - gtk_container_add (GTK_CONTAINER (window), canvas); - - return window; -} - -static gboolean -zenity_zen_wisdom (GtkDialog *dialog, GdkEventKey *event, gpointer user_data) -{ - static gint string_count; - - if (string_count >= 3) - return FALSE; - - switch (event->keyval) { - case GDK_N: - case GDK_n: - if (string_count == 2) { - GtkWidget *window; - window = zenity_create_boutique (); - gtk_widget_show_all (window); - string_count++; - } else { - string_count = 0; - } - break; - case GDK_Z: - case GDK_z: - if (string_count == 0) - string_count++; - else - string_count = 0; - break; - case GDK_E: - case GDK_e: - if (string_count == 1) - string_count++; - else - string_count = 0; - break; - default: - string_count = 0; - } - - return FALSE; -} -#endif - void -zenity_about (ZenityData *data) { - GdkPixbuf *logo; +zenity_about (ZenityData *data) +{ char *license_trans; - translators = _ ("translator-credits"); - logo = - gdk_pixbuf_new_from_file (ZENITY_IMAGE_FULLPATH ("zenity.png"), NULL); + translators = _("translator-credits"); license_trans = g_strconcat ( - _ (license[0]), "\n", _ (license[1]), "\n", _ (license[2]), "\n", NULL); + _(license[0]), "\n", _(license[1]), "\n", _(license[2]), "\n", NULL); dialog = gtk_about_dialog_new (); @@ -272,9 +94,10 @@ zenity_about (ZenityData *data) { "version", VERSION, "copyright", - "Copyright \xc2\xa9 2003 Sun Microsystems", + "Copyright \xc2\xa9 2003 Sun Microsystems\n" + "Copyright \xc2\xa9 2021 Logan Rathbone\n", "comments", - _ ("Display dialog boxes from shell scripts"), + _("Display dialog boxes from shell scripts"), "authors", authors, "documenters", @@ -282,9 +105,7 @@ zenity_about (ZenityData *data) { "translator-credits", translators, "website", - "http://live.gnome.org/Zenity", - "logo", - logo, + "https://gitlab.gnome.org/GNOME/zenity", "wrap-license", TRUE, "license", @@ -293,27 +114,25 @@ zenity_about (ZenityData *data) { g_free (license_trans); - zenity_util_set_window_icon ( - dialog, NULL, ZENITY_IMAGE_FULLPATH ("zenity.png")); + zenity_util_set_window_icon (dialog, + NULL, ZENITY_IMAGE_FULLPATH ("zenity.png")); g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (zenity_about_dialog_response), data); -#if 0 - g_signal_connect (G_OBJECT (dialog), "key_press_event", - G_CALLBACK (zenity_zen_wisdom), NULL); -#endif - - zenity_util_show_dialog (dialog, data->attach); - gtk_main (); + zenity_util_show_dialog (dialog); + zenity_util_gapp_main (GTK_WINDOW (dialog)); } static void -zenity_about_dialog_response (GtkWidget *widget, int response, gpointer data) { +zenity_about_dialog_response (GtkWidget *widget, int response, gpointer data) +{ ZenityData *zen_data = data; + g_return_if_fail (GTK_IS_WINDOW (GTK_WINDOW(widget))); + switch (response) { case GTK_RESPONSE_CLOSE: zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK); @@ -324,6 +143,5 @@ zenity_about_dialog_response (GtkWidget *widget, int response, gpointer data) { zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC); break; } - - gtk_main_quit (); + zenity_util_gapp_quit (GTK_WINDOW(widget)); } diff --git a/src/calendar.c b/src/calendar.c index 9aaf927..21dc6a1 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -1,19 +1,22 @@ +/* vim: colorcolumn=80 ts=4 sw=4 + */ /* * calendar.c * - * Copyright (C) 2002 Sun Microsystems, Inc. + * Copyright © 2002 Sun Microsystems, Inc. + * Copyright © 2021 Logan Rathbone * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. @@ -21,21 +24,25 @@ * Authors: Glynn Foster <glynn.foster@sun.com> */ -#include "config.h" #include "util.h" #include "zenity.h" + #include <time.h> +#include <config.h> + static GtkWidget *calendar; static ZenityCalendarData *zen_cal_data; -static void zenity_calendar_dialog_response ( - GtkWidget *widget, int response, gpointer data); -static void zenity_calendar_double_click (GtkCalendar *calendar, gpointer data); +static void zenity_calendar_dialog_response (GtkWidget *widget, + int response, gpointer data); +static void zenity_calendar_day_selected (GtkCalendar *calendar, + gpointer data); void -zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data) { +zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data) +{ GtkBuilder *builder; GtkWidget *dialog; GtkWidget *button; @@ -50,15 +57,11 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data) { return; } - gtk_builder_connect_signals (builder, NULL); - dialog = GTK_WIDGET (gtk_builder_get_object (builder, "zenity_calendar_dialog")); - g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (zenity_calendar_dialog_response), - data); + g_signal_connect (dialog, "response", + G_CALLBACK(zenity_calendar_dialog_response), data); if (data->dialog_title) gtk_window_set_title (GTK_WINDOW (dialog), data->dialog_title); @@ -68,8 +71,8 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data) { ZENITY_IMAGE_FULLPATH ("zenity-calendar.png")); if (data->width > -1 || data->height > -1) - gtk_window_set_default_size ( - GTK_WINDOW (dialog), data->width, data->height); + gtk_window_set_default_size (GTK_WINDOW(dialog), + data->width, data->height); if (data->modal) gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); @@ -77,24 +80,31 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data) { text = gtk_builder_get_object (builder, "zenity_calendar_text"); if (cal_data->dialog_text) - gtk_label_set_markup ( - GTK_LABEL (text), g_strcompress (cal_data->dialog_text)); + gtk_label_set_markup (GTK_LABEL(text), + g_strcompress (cal_data->dialog_text)); - calendar = GTK_WIDGET (gtk_builder_get_object (builder, "zenity_calendar")); + calendar = GTK_WIDGET(gtk_builder_get_object (builder, "zenity_calendar")); if (cal_data->month > 0 || cal_data->year > 0) - gtk_calendar_select_month ( - GTK_CALENDAR (calendar), cal_data->month - 1, cal_data->year); + { + g_object_set (calendar, + "month", cal_data->month - 1, + "year", cal_data->year, + NULL); + } + if (cal_data->day > 0) - gtk_calendar_select_day (GTK_CALENDAR (calendar), cal_data->day); + { + g_object_set (calendar, + "day", cal_data->day, + NULL); + } - g_signal_connect (calendar, - "day-selected-double-click", - G_CALLBACK (zenity_calendar_double_click), - data); + g_signal_connect (calendar, "day-selected", + G_CALLBACK(zenity_calendar_day_selected), data); gtk_label_set_mnemonic_widget (GTK_LABEL (text), calendar); - zenity_util_show_dialog (dialog, data->attach); + zenity_util_show_dialog (dialog); if (data->timeout_delay > 0) { g_timeout_add_seconds (data->timeout_delay, @@ -103,37 +113,44 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data) { } if (data->extra_label) { - gint i = 0; + int i = 0; + while (data->extra_label[i] != NULL) { - gtk_dialog_add_button ( - GTK_DIALOG (dialog), data->extra_label[i], i); + gtk_dialog_add_button (GTK_DIALOG(dialog), + data->extra_label[i], i); i++; } } if (data->ok_label) { - button = GTK_WIDGET ( - gtk_builder_get_object (builder, "zenity_calendar_ok_button")); + button = GTK_WIDGET (gtk_builder_get_object (builder, + "zenity_calendar_ok_button")); gtk_button_set_label (GTK_BUTTON (button), data->ok_label); } if (data->cancel_label) { - button = GTK_WIDGET ( - gtk_builder_get_object (builder, "zenity_calendar_cancel_button")); + button = GTK_WIDGET (gtk_builder_get_object (builder, + "zenity_calendar_cancel_button")); gtk_button_set_label (GTK_BUTTON (button), data->cancel_label); } g_object_unref (builder); - gtk_main (); + zenity_util_gapp_main (GTK_WINDOW(dialog)); } + static void -zenity_calendar_dialog_output (void) { - guint day, month, year; - gchar time_string[128]; +zenity_calendar_dialog_output (void) +{ + int day, month, year; + char time_string[128]; GDate *date = NULL; - gtk_calendar_get_date (GTK_CALENDAR (calendar), &day, &month, &year); + g_object_get (calendar, + "day", &day, + "month", &month, + "year", &year, + NULL); date = g_date_new_dmy (year, month + 1, day); g_date_strftime (time_string, 127, zen_cal_data->date_format, date); g_print ("%s\n", time_string); @@ -143,13 +160,13 @@ zenity_calendar_dialog_output (void) { } static void -zenity_calendar_dialog_response ( - GtkWidget *widget, int response, gpointer data) { - ZenityData *zen_data; - - zen_data = data; +zenity_calendar_dialog_response (GtkWidget *widget, + int response, gpointer data) +{ + ZenityData *zen_data = data; - switch (response) { + switch (response) + { case GTK_RESPONSE_OK: zenity_calendar_dialog_output (); zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK); @@ -166,15 +183,16 @@ zenity_calendar_dialog_response ( default: if (zen_data->extra_label && - response < g_strv_length (zen_data->extra_label)) + response < (int)g_strv_length (zen_data->extra_label)) printf ("%s\n", zen_data->extra_label[response]); zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC); break; } - gtk_main_quit (); + zenity_util_gapp_quit (GTK_WINDOW(widget)); } static void -zenity_calendar_double_click (GtkCalendar *cal, gpointer data) { +zenity_calendar_day_selected (GtkCalendar *cal, gpointer data) +{ zenity_calendar_dialog_response (NULL, GTK_RESPONSE_OK, data); } diff --git a/src/color.c b/src/color.c index 9ef233e..3dd2624 100644 --- a/src/color.c +++ b/src/color.c @@ -1,19 +1,22 @@ +/* vim: colorcolumn=80 ts=4 sw=4 + */ /* * color.c * - * Copyright (C) 2010 Berislav Kovacki + * Copyright © 2010 Berislav Kovacki + * Copyright © 2021 Logan Rathbone * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. @@ -29,11 +32,12 @@ static ZenityData *zen_data; -static void zenity_colorselection_dialog_response ( - GtkWidget *widget, int response, gpointer data); +static void zenity_colorselection_dialog_response (GtkWidget *widget, + int response, gpointer data); void -zenity_colorselection (ZenityData *data, ZenityColorData *color_data) { +zenity_colorselection (ZenityData *data, ZenityColorData *color_data) +{ GtkWidget *dialog; GtkWidget *button; GdkRGBA color; @@ -47,21 +51,26 @@ zenity_colorselection (ZenityData *data, ZenityColorData *color_data) { G_CALLBACK (zenity_colorselection_dialog_response), color_data); - if (color_data->color) { - if (gdk_rgba_parse (&color, color_data->color)) { - gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (dialog), &color); - } + if (color_data->color && + gdk_rgba_parse (&color, color_data->color)) + { + gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER(dialog), &color); } - if (data->extra_label) { - gint i = 0; - while (data->extra_label[i] != NULL) { - gtk_dialog_add_button ( - GTK_DIALOG (dialog), data->extra_label[i], i); + if (data->extra_label) + { + int i = 0; + + while (data->extra_label[i] != NULL) + { + gtk_dialog_add_button (GTK_DIALOG (dialog), + data->extra_label[i], i); i++; } } + // FIXME +#if 0 if (data->ok_label) { g_object_get (G_OBJECT (dialog), "ok-button", &button, NULL); gtk_button_set_label (GTK_BUTTON (button), data->ok_label); @@ -73,29 +82,32 @@ zenity_colorselection (ZenityData *data, ZenityColorData *color_data) { gtk_button_set_label (GTK_BUTTON (button), data->cancel_label); g_object_unref (G_OBJECT (button)); } +#endif if (data->modal) gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); g_object_set (dialog, "show-editor", !color_data->show_palette, NULL); - zenity_util_show_dialog (dialog, data->attach); + zenity_util_show_dialog (dialog); if (data->timeout_delay > 0) { g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, dialog); } - - gtk_main (); + zenity_util_gapp_main (GTK_WINDOW(dialog)); } +// FIXME - this shoudl probably use the color-activated signal static void -zenity_colorselection_dialog_response ( - GtkWidget *widget, int response, gpointer data) { +zenity_colorselection_dialog_response (GtkWidget *widget, + int response, gpointer data) +{ GdkRGBA color; - switch (response) { + switch (response) + { case GTK_RESPONSE_OK: zenity_util_exit_code_with_data (ZENITY_OK, zen_data); gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (widget), &color); @@ -108,11 +120,10 @@ zenity_colorselection_dialog_response ( default: if (zen_data->extra_label && - response < g_strv_length (zen_data->extra_label)) + response < (int)g_strv_length (zen_data->extra_label)) printf ("%s\n", zen_data->extra_label[response]); zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC); break; } - - gtk_main_quit (); + zenity_util_gapp_quit (GTK_WINDOW(widget)); } diff --git a/src/option.c b/src/option.c index 61df34d..833bf0d 100644 --- a/src/option.c +++ b/src/option.c @@ -47,7 +47,6 @@ static gchar *zenity_general_ok_button; static gchar *zenity_general_cancel_button; static gchar **zenity_general_extra_buttons; static gboolean zenity_general_modal; -static guintptr zenity_general_attach; static gboolean zenity_general_dialog_ellipsize; /* Calendar Dialog Options */ @@ -220,13 +219,6 @@ static GOptionEntry general_options[] = {{"title", &zenity_general_modal, N_ ("Set the modal hint"), NULL}, - {"attach", - '\0', - G_OPTION_FLAG_NOALIAS, - G_OPTION_ARG_INT, - &zenity_general_attach, - N_ ("Set the parent window to attach to"), - N_ ("WINDOW")}, {NULL}}; static GOptionEntry calendar_options[] = {{"calendar", @@ -1192,7 +1184,6 @@ zenity_general_pre_callback (GOptionContext *context, GOptionGroup *group, zenity_general_dialog_no_markup = FALSE; zenity_general_timeout_delay = -1; zenity_general_modal = FALSE; - zenity_general_attach = 0; return TRUE; } @@ -1386,7 +1377,6 @@ zenity_general_post_callback (GOptionContext *context, GOptionGroup *group, results->data->cancel_label = zenity_general_cancel_button; results->data->extra_label = zenity_general_extra_buttons; results->data->modal = zenity_general_modal; - results->data->attach = zenity_general_attach; return TRUE; } @@ -387,9 +387,9 @@ zenity_util_make_transient (GdkWindow *window, Window parent) { #endif /* GDK_WINDOWING_X11 */ void -zenity_util_show_dialog (GtkWidget *dialog, guintptr parent) +zenity_util_show_dialog (GtkWidget *dialog) { - gtk_widget_realize (dialog); + gtk_widget_realize (dialog); // FIXME - doubt this is necessary. gtk_widget_show (dialog); } @@ -401,8 +401,7 @@ zenity_util_timeout_handle (gpointer data) if (dialog != NULL) gtk_dialog_response (dialog, ZENITY_TIMEOUT); else { - // FIXME - TEST - delete window from app - gtk_window_set_application (GTK_WINDOW(dialog), NULL); + zenity_util_gapp_quit (GTK_WINDOW(dialog)); exit (ZENITY_TIMEOUT); } return FALSE; @@ -432,3 +431,11 @@ zenity_util_gapp_main (GtkWindow *window) { return status; } + +void +zenity_util_gapp_quit (GtkWindow *window) +{ + g_assert (GTK_IS_WINDOW (window)); + + gtk_window_set_application (window, NULL); +} @@ -26,9 +26,10 @@ void zenity_util_set_window_icon_from_file ( void zenity_util_show_help (GError **error); gint zenity_util_return_exit_code (ZenityExitCode value); void zenity_util_exit_code_with_data (ZenityExitCode value, ZenityData *data); -void zenity_util_show_dialog (GtkWidget *widget, guintptr parent); +void zenity_util_show_dialog (GtkWidget *widget); gboolean zenity_util_timeout_handle (gpointer data); int zenity_util_gapp_main (GtkWindow *window); +void zenity_util_gapp_quit (GtkWindow *window); G_END_DECLS diff --git a/src/zenity.h b/src/zenity.h index b86a264..3136baa 100644 --- a/src/zenity.h +++ b/src/zenity.h @@ -34,7 +34,6 @@ typedef struct { gint exit_code; gint timeout_delay; gboolean modal; - guintptr attach; } ZenityData; typedef enum { diff --git a/src/zenity.ui b/src/zenity.ui index 1359442..41ec10c 100644 --- a/src/zenity.ui +++ b/src/zenity.ui @@ -1,107 +1,48 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.0 --> <interface> - <requires lib="gtk+" version="3.0"/> + <requires lib="gtk" version="4.0"/> <object class="GtkAdjustment" id="adjustment1"> <property name="upper">100</property> <property name="step_increment">1</property> <property name="page_increment">1</property> </object> <object class="GtkDialog" id="zenity_scale_dialog"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="visible">1</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="title" translatable="yes">Adjust the scale value</property> <property name="default_width">300</property> <property name="default_height">100</property> <property name="type_hint">dialog</property> <signal name="destroy" handler="gtk_main_quit" swapped="no"/> - <child internal-child="vbox"> + <child internal-child="content_area"> <object class="GtkBox" id="dialog-vbox11"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area11"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="zenity_scale_cancel_button"> - <property name="label" translatable="yes">Cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="zenity_scale_ok_button"> - <property name="label" translatable="yes">OK</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> + <property name="can_focus">0</property> <child> <object class="GtkBox" id="vbox13"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="orientation">vertical</property> <property name="spacing">6</property> <child> <object class="GtkLabel" id="zenity_scale_text"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="can_focus">0</property> <property name="ypad">4</property> <property name="label" translatable="yes">Adjust the scale value</property> <property name="xalign">0</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> </child> <child> <object class="GtkScale" id="zenity_scale_hscale"> - <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="vexpand">1</property> + <property name="draw-value">1</property> <property name="adjustment">adjustment1</property> <property name="digits">0</property> <property name="value_pos">right</property> </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> </child> @@ -109,10 +50,39 @@ <action-widget response="-6">zenity_scale_cancel_button</action-widget> <action-widget response="-5">zenity_scale_ok_button</action-widget> </action-widgets> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area11"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="zenity_scale_cancel_button"> + <property name="label" translatable="yes">Cancel</property> + <property name="can_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="zenity_scale_ok_button"> + <property name="label" translatable="yes">OK</property> + <property name="can_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> </object> <object class="GtkTextBuffer" id="textbuffer1"/> <object class="GtkDialog" id="zenity_text_dialog"> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="title" translatable="yes">Text View</property> <property name="window_position">center</property> @@ -120,103 +90,41 @@ <property name="default_height">200</property> <property name="type_hint">dialog</property> <signal name="destroy" handler="gtk_main_quit" swapped="no"/> - <child internal-child="vbox"> + <child internal-child="content_area"> <object class="GtkBox" id="dialog-vbox5"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="spacing">2</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area5"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="zenity_text_cancel_button"> - <property name="label" translatable="yes">Cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="zenity_text_close_button"> - <property name="label" translatable="yes">OK</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">True</property> - <property name="image_position">right</property> - <accelerator key="Return" signal="clicked" modifiers="GDK_CONTROL_MASK"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> <child> <object class="GtkBox" id="vbox5"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="hexpand">1</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="orientation">vertical</property> <child> <object class="GtkScrolledWindow" id="zenity_text_scrolled_window"> - <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="vexpand">1</property> <property name="shadow_type">etched-in</property> - <child> + <property name="child"> <object class="GtkTextView" id="zenity_text_view"> - <property name="visible">True</property> - <property name="can_focus">True</property> <property name="pixels_above_lines">2</property> <property name="pixels_below_lines">2</property> - <property name="editable">False</property> + <property name="editable">0</property> <property name="wrap_mode">word</property> <property name="left_margin">2</property> <property name="right_margin">2</property> <property name="buffer">textbuffer1</property> </object> - </child> + </property> </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> </child> <child> <object class="GtkCheckButton" id="zenity_text_checkbox"> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="valign">center</property> + <property name="visible">0</property> <property name="xalign">0.5</property> - <property name="draw_indicator">True</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> </child> </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> </child> @@ -224,129 +132,90 @@ <action-widget response="-6">zenity_text_cancel_button</action-widget> <action-widget response="-7">zenity_text_close_button</action-widget> </action-widgets> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="zenity_text_cancel_button"> + <property name="label" translatable="yes">Cancel</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="zenity_text_close_button"> + <property name="label" translatable="yes">OK</property> + <property name="can_default">True</property> + <property name="receives_default">1</property> + <property name="image_position">right</property> + <accelerator key="Return" signal="clicked" modifiers="GDK_CONTROL_MASK"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> </object> <object class="GtkDialog" id="zenity_calendar_dialog"> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="title" translatable="yes">Calendar selection</property> <property name="window_position">center</property> <property name="type_hint">dialog</property> <signal name="destroy" handler="gtk_main_quit" swapped="no"/> - <child internal-child="vbox"> + <child internal-child="content_area"> <object class="GtkBox" id="dialog-vbox2"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="spacing">2</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="zenity_calendar_cancel_button"> - <property name="label" translatable="yes">Cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="zenity_calendar_ok_button"> - <property name="label" translatable="yes">OK</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> <child> <object class="GtkBox" id="vbox1"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="orientation">vertical</property> <property name="spacing">6</property> <child> <object class="GtkBox" id="vbox2"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="vexpand">1</property> + <property name="can_focus">0</property> <property name="spacing">6</property> <child> <object class="GtkLabel" id="zenity_calendar_text"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="halign">center</property> + <property name="can_focus">0</property> <property name="label" translatable="yes">Select a date from below.</property> - <property name="wrap">True</property> + <property name="wrap">1</property> <property name="xalign">0</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> </child> </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> </child> <child> <object class="GtkLabel" id="zenity_calendar_label"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="can_focus">0</property> <property name="label" translatable="yes">C_alendar:</property> - <property name="use_underline">True</property> + <property name="use_underline">1</property> <property name="mnemonic_widget">zenity_calendar</property> <property name="xalign">0</property> <accessibility> <relation type="label-for" target="zenity_calendar"/> </accessibility> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> </child> <child> <object class="GtkCalendar" id="zenity_calendar"> - <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="valign">center</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">2</property> - </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> </child> @@ -354,103 +223,74 @@ <action-widget response="-6">zenity_calendar_cancel_button</action-widget> <action-widget response="-5">zenity_calendar_ok_button</action-widget> </action-widgets> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="zenity_calendar_cancel_button"> + <property name="label" translatable="yes">Cancel</property> + <property name="can_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="zenity_calendar_ok_button"> + <property name="label" translatable="yes">OK</property> + <property name="has_focus">1</property> + <property name="can_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> </object> <object class="GtkDialog" id="zenity_entry_dialog"> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="title" translatable="yes">Add a new entry</property> <property name="window_position">center</property> <property name="type_hint">dialog</property> <signal name="destroy" handler="gtk_main_quit" swapped="no"/> - <child internal-child="vbox"> + <child internal-child="content_area"> <object class="GtkBox" id="dialog-vbox4"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="orientation">vertical</property> <property name="spacing">2</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area4"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="zenity_entry_cancel_button"> - <property name="label" translatable="yes">Cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="zenity_entry_ok_button"> - <property name="label" translatable="yes">OK</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> <child> <object class="GtkBox" id="vbox3"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">6</property> <child> <object class="GtkBox" id="vbox4"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="hexpand">1</property> + <property name="can_focus">0</property> <property name="orientation">vertical</property> <property name="spacing">6</property> <child> <object class="GtkLabel" id="zenity_entry_text"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="can_focus">0</property> <property name="label" translatable="yes">_Enter new text:</property> - <property name="use_underline">True</property> + <property name="use_underline">1</property> <property name="xalign">0</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> </child> <child> <placeholder/> </child> </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> </child> @@ -458,166 +298,121 @@ <action-widget response="-6">zenity_entry_cancel_button</action-widget> <action-widget response="-5">zenity_entry_ok_button</action-widget> </action-widgets> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="zenity_entry_cancel_button"> + <property name="label" translatable="yes">Cancel</property> + <property name="can_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="zenity_entry_ok_button"> + <property name="label" translatable="yes">OK</property> + <property name="can_default">True</property> + <property name="has_default">1</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> </object> <object class="GtkDialog" id="zenity_error_dialog"> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="title" translatable="yes">Error</property> <property name="window_position">center</property> <property name="type_hint">dialog</property> <signal name="destroy" handler="gtk_main_quit" swapped="no"/> - <child internal-child="vbox"> + <child internal-child="content_area"> <object class="GtkBox" id="dialog-vbox7"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="spacing">14</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area7"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="zenity_error_ok_button"> - <property name="label" translatable="yes">OK</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> <child> <object class="GtkBox" id="vbox8"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">6</property> <child> <object class="GtkBox" id="hbox3"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="hexpand">1</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="spacing">12</property> <child> <object class="GtkImage" id="zenity_error_image"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="halign">center</property> + <property name="can_focus">0</property> <property name="yalign">0</property> <property name="icon_name">dialog-error</property> <property name="icon_size">6</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> </child> <child> <object class="GtkLabel" id="zenity_error_text"> - <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="halign">center</property> <property name="label" translatable="yes">An error has occurred.</property> - <property name="wrap">True</property> - <property name="selectable">True</property> + <property name="wrap">1</property> + <property name="selectable">1</property> <property name="yalign">0</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> </child> </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> </child> <action-widgets> <action-widget response="-5">zenity_error_ok_button</action-widget> </action-widgets> - </object> - <object class="GtkDialog" id="zenity_forms_dialog"> - <property name="can_focus">False</property> - <property name="border_width">5</property> - <property name="window_position">center</property> - <property name="type_hint">normal</property> - <child internal-child="vbox"> - <object class="GtkBox" id="dialog-vbox12"> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area7"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="spacing">2</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area12"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="zenity_forms_cancel_button"> - <property name="label" translatable="yes">Cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="zenity_forms_ok_button"> - <property name="label" translatable="yes">OK</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="zenity_error_ok_button"> + <property name="label" translatable="yes">OK</property> + <property name="can_default">True</property> </object> <packing> <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> + <property name="fill">False</property> <property name="position">0</property> </packing> </child> + </object> + </child> + </object> + <object class="GtkDialog" id="zenity_forms_dialog"> + <property name="can_focus">0</property> + <property name="border_width">5</property> + <property name="window_position">center</property> + <property name="type_hint">normal</property> + <child internal-child="content_area"> + <object class="GtkBox" id="dialog-vbox12"> + <property name="can_focus">0</property> + <property name="spacing">2</property> <child> <object class="GtkFrame" id="frame1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <child> + <property name="can_focus">0</property> + <property name="child"> <object class="GtkGrid" id="zenity_forms_grid"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_left">12</property> - <property name="margin_right">6</property> + <property name="can_focus">0</property> + <property name="margin-start">12</property> + <property name="margin-end">6</property> <property name="margin_top">12</property> <property name="margin_bottom">6</property> <property name="row_spacing">6</property> @@ -650,23 +445,17 @@ <placeholder/> </child> </object> - </child> + </property> <child type="label"> <object class="GtkLabel" id="zenity_forms_text"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="label" translatable="yes">Forms dialog</property> <attributes> - <attribute name="weight" value="bold"/> + <attribute name="weight" value="bold"></attribute> </attributes> </object> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> </child> @@ -674,195 +463,168 @@ <action-widget response="-6">zenity_forms_cancel_button</action-widget> <action-widget response="-5">zenity_forms_ok_button</action-widget> </action-widgets> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area12"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="zenity_forms_cancel_button"> + <property name="label" translatable="yes">Cancel</property> + <property name="receives_default">1</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="zenity_forms_ok_button"> + <property name="label" translatable="yes">OK</property> + <property name="receives_default">1</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> </object> <object class="GtkDialog" id="zenity_info_dialog"> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="title" translatable="yes">Information</property> <property name="window_position">center</property> <property name="type_hint">dialog</property> <signal name="destroy" handler="gtk_main_quit" swapped="no"/> - <child internal-child="vbox"> + <child internal-child="content_area"> <object class="GtkBox" id="dialog-vbox9"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="spacing">14</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="zenity_info_ok_button"> - <property name="label" translatable="yes">OK</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> <child> <object class="GtkBox" id="hbox4"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="spacing">12</property> <child> <object class="GtkImage" id="zenity_info_image"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="halign">center</property> + <property name="can_focus">0</property> <property name="yalign">0</property> <property name="icon_name">dialog-information</property> <property name="icon_size">6</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> </child> <child> <object class="GtkLabel" id="zenity_info_text"> - <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="halign">center</property> <property name="label" translatable="yes">All updates are complete.</property> - <property name="wrap">True</property> - <property name="selectable">True</property> + <property name="wrap">1</property> + <property name="selectable">1</property> <property name="yalign">0</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> </child> <action-widgets> <action-widget response="-5">zenity_info_ok_button</action-widget> </action-widgets> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="zenity_info_ok_button"> + <property name="label" translatable="yes">OK</property> + <property name="can_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> </object> <object class="GtkDialog" id="zenity_progress_dialog"> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="title" translatable="yes">Progress</property> <property name="window_position">center</property> <property name="type_hint">dialog</property> <signal name="destroy" handler="gtk_main_quit" swapped="no"/> - <child internal-child="vbox"> + <child internal-child="content_area"> <object class="GtkBox" id="dialog-vbox6"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="spacing">2</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area6"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="zenity_progress_cancel_button"> - <property name="label" translatable="yes">Cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="zenity_progress_ok_button"> - <property name="label" translatable="yes">OK</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="has_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> <child> <object class="GtkBox" id="vbox7"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="halign">center</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="orientation">vertical</property> <property name="spacing">6</property> <child> <object class="GtkLabel" id="zenity_progress_text"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="can_focus">0</property> <property name="label" translatable="yes">Running...</property> - <property name="wrap">True</property> + <property name="wrap">1</property> <property name="xalign">0</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> </child> <child> <object class="GtkProgressBar" id="zenity_progress_bar"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="can_focus">0</property> <property name="pulse_step">0.10000000149</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> </child> <child> <object class="GtkLabel" id="zenity_progress_time"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="can_focus">0</property> <property name="xalign">0</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">2</property> - </packing> </child> </object> + </child> + </object> + </child> + <action-widgets> + <action-widget response="-6">zenity_progress_cancel_button</action-widget> + <action-widget response="-5">zenity_progress_ok_button</action-widget> + </action-widgets> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="zenity_progress_cancel_button"> + <property name="label" translatable="yes">Cancel</property> + <property name="can_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="zenity_progress_ok_button"> + <property name="label" translatable="yes">OK</property> + <property name="sensitive">0</property> + <property name="has_focus">1</property> + <property name="can_default">True</property> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> @@ -871,84 +633,55 @@ </child> </object> </child> - <action-widgets> - <action-widget response="-6">zenity_progress_cancel_button</action-widget> - <action-widget response="-5">zenity_progress_ok_button</action-widget> - </action-widgets> </object> <object class="GtkDialog" id="zenity_question_dialog"> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="title" translatable="yes">Question</property> <property name="window_position">center</property> <property name="type_hint">dialog</property> <signal name="destroy" handler="gtk_main_quit" swapped="no"/> - <child internal-child="vbox"> + <child internal-child="content_area"> <object class="GtkBox" id="dialog-vbox3"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="spacing">14</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="zenity_question_button_box"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> <child> <object class="GtkBox" id="hbox1"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="spacing">12</property> <child> <object class="GtkImage" id="zenity_question_image"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="xalign">0</property> <property name="yalign">0</property> <property name="icon_name">dialog-question</property> <property name="icon_size">6</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> </child> <child> <object class="GtkLabel" id="zenity_question_text"> - <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="halign">center</property> <property name="label" translatable="yes">Are you sure you want to proceed?</property> - <property name="wrap">True</property> - <property name="selectable">True</property> + <property name="wrap">1</property> + <property name="selectable">1</property> <property name="yalign">0</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> </child> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="zenity_question_button_box"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + </object> + </child> </object> <object class="GtkDialog" id="zenity_tree_dialog"> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="title" translatable="yes">Select items from the list</property> <property name="window_position">center</property> @@ -956,100 +689,39 @@ <property name="default_height">196</property> <property name="type_hint">dialog</property> <signal name="destroy" handler="gtk_main_quit" swapped="no"/> - <child internal-child="vbox"> + <child internal-child="content_area"> <object class="GtkBox" id="dialog-vbox8"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area8"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="zenity_tree_cancel_button"> - <property name="label" translatable="yes">Cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="zenity_tree_ok_button"> - <property name="label" translatable="yes">OK</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> + <property name="can_focus">0</property> <child> <object class="GtkBox" id="vbox10"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="orientation">vertical</property> <property name="spacing">6</property> <child> <object class="GtkLabel" id="zenity_tree_text"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="can_focus">0</property> <property name="label" translatable="yes">Select items from the list below.</property> <property name="xalign">0</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> </child> <child> <object class="GtkScrolledWindow" id="zenity_tree_window"> - <property name="visible">True</property> - <property name="can_focus">True</property> <property name="shadow_type">in</property> - <property name="expand">True</property> - <child> + <property name="hexpand">1</property> + <property name="vexpand">1</property> + <property name="child"> <object class="GtkTreeView" id="zenity_tree_view"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_focus">True</property> + <property name="has_focus">1</property> <child internal-child="selection"> <object class="GtkTreeSelection" id="treeview-selection1"/> </child> </object> - </child> + </property> </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> </child> @@ -1057,94 +729,95 @@ <action-widget response="-6">zenity_tree_cancel_button</action-widget> <action-widget response="-5">zenity_tree_ok_button</action-widget> </action-widgets> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="zenity_tree_cancel_button"> + <property name="label" translatable="yes">Cancel</property> + <property name="can_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="zenity_tree_ok_button"> + <property name="label" translatable="yes">OK</property> + <property name="can_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> </object> <object class="GtkDialog" id="zenity_warning_dialog"> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="title" translatable="yes">Warning</property> <property name="window_position">center</property> <property name="type_hint">dialog</property> <signal name="destroy" handler="gtk_main_quit" swapped="no"/> - <child internal-child="vbox"> + <child internal-child="content_area"> <object class="GtkBox" id="dialog-vbox1"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="spacing">14</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="zenity_warning_ok_button"> - <property name="label" translatable="yes">OK</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> <child> <object class="GtkBox" id="hbox2"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="border_width">5</property> <property name="spacing">12</property> <child> <object class="GtkImage" id="zenity_warning_image"> - <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">0</property> <property name="xalign">0</property> <property name="yalign">0</property> <property name="icon_name">dialog-warning</property> <property name="icon_size">6</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> </child> <child> <object class="GtkLabel" id="zenity_warning_text"> - <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="halign">center</property> <property name="label" translatable="yes">Are you sure you want to proceed?</property> - <property name="wrap">True</property> - <property name="selectable">True</property> + <property name="wrap">1</property> + <property name="selectable">1</property> <property name="yalign">0</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> </child> <action-widgets> <action-widget response="-5">zenity_warning_ok_button</action-widget> </action-widgets> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="zenity_warning_ok_button"> + <property name="label" translatable="yes">OK</property> + <property name="has_focus">1</property> + <property name="can_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> </object> </interface> |