summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLogan Rathbone <poprocks@gmail.com>2023-01-19 14:07:34 -0500
committerLogan Rathbone <poprocks@gmail.com>2023-01-23 23:41:38 -0500
commit011783da148ce9c81d042feecd202f6935f7ef71 (patch)
treea21403ebdef8f824e068f7124263d2323e957363 /src
parent7e3cf22aba795935154c25e65e6fe8bc2895f05c (diff)
downloadzenity-011783da148ce9c81d042feecd202f6935f7ef71.tar.gz
Initial port to libadwaita
Diffstat (limited to 'src')
-rw-r--r--src/about.c6
-rw-r--r--src/calendar.c37
-rw-r--r--src/color.c21
-rw-r--r--src/entry.c34
-rw-r--r--src/fileselection.c25
-rw-r--r--src/forms.c37
-rw-r--r--src/main.c13
-rw-r--r--src/meson.build21
-rw-r--r--src/msg.c74
-rw-r--r--src/notification.c2
-rw-r--r--src/option.h2
-rw-r--r--src/password.c38
-rw-r--r--src/progress.c86
-rw-r--r--src/scale.c38
-rw-r--r--src/text.c54
-rw-r--r--src/tree.c36
-rw-r--r--src/util.c67
-rw-r--r--src/util.h25
-rw-r--r--src/zenity.gresource.xml.in (renamed from src/zenity.gresource.xml)4
-rw-r--r--src/zenity.h28
-rw-r--r--src/zenity.ui967
21 files changed, 642 insertions, 973 deletions
diff --git a/src/about.c b/src/about.c
index cac56c8..b71ea13 100644
--- a/src/about.c
+++ b/src/about.c
@@ -6,7 +6,7 @@
* Copyright © 2002 Sun Microsystems, Inc.
* Copyright © 2001 CodeFactory AB
* Copyright © 2001, 2002 Anders Carlsson
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -83,7 +83,7 @@ zenity_about (ZenityData *data)
VERSION,
"copyright",
"Copyright \xc2\xa9 2003 Sun Microsystems\n"
- "Copyright \xc2\xa9 2021 Logan Rathbone\n",
+ "Copyright \xc2\xa9 2021-2023 Logan Rathbone\n",
"comments",
_("Display dialog boxes from shell scripts"),
"authors",
@@ -117,5 +117,5 @@ zenity_about_close_cb (GtkWindow *window, gpointer data)
ZenityData *zen_data = data;
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
- zenity_util_gapp_quit (window);
+ zenity_util_gapp_quit (window, zen_data);
}
diff --git a/src/calendar.c b/src/calendar.c
index be8c8af..f5237d1 100644
--- a/src/calendar.c
+++ b/src/calendar.c
@@ -4,7 +4,7 @@
* calendar.c
*
* Copyright © 2002 Sun Microsystems, Inc.
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -35,20 +35,18 @@
static GtkWidget *calendar;
static ZenityCalendarData *zen_cal_data;
-static void zenity_calendar_dialog_response (GtkWidget *widget,
- int response, gpointer data);
+static void zenity_calendar_dialog_response (GtkWidget *widget, char *rstr, gpointer data);
void
zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data)
{
g_autoptr(GtkBuilder) builder = NULL;
GtkWidget *dialog;
- GtkWidget *button;
GObject *text;
zen_cal_data = cal_data;
- builder = zenity_util_load_ui_file ("zenity_calendar_dialog", NULL);
+ builder = zenity_util_load_ui_file ("zenity_calendar_dialog", "zenity_calendar_box", NULL);
if (builder == NULL) {
data->exit_code = zenity_util_return_exit_code (ZENITY_ERROR);
@@ -108,22 +106,17 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data)
if (data->extra_label)
{
- for (int i = 0; data->extra_label[i] != NULL; ++i) {
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- data->extra_label[i], i);
- }
+ ZENITY_UTIL_ADD_EXTRA_LABELS (dialog)
}
- if (data->ok_label) {
- button = GTK_WIDGET (gtk_builder_get_object (builder,
- "zenity_calendar_ok_button"));
- gtk_button_set_label (GTK_BUTTON (button), data->ok_label);
+ if (data->ok_label)
+ {
+ ZENITY_UTIL_SETUP_OK_BUTTON_LABEL (dialog);
}
- if (data->cancel_label) {
- button = GTK_WIDGET (gtk_builder_get_object (builder,
- "zenity_calendar_cancel_button"));
- gtk_button_set_label (GTK_BUTTON (button), data->cancel_label);
+ if (data->cancel_label)
+ {
+ ZENITY_UTIL_SETUP_CANCEL_BUTTON_LABEL (dialog);
}
zenity_util_gapp_main (GTK_WINDOW(dialog));
@@ -150,19 +143,19 @@ zenity_calendar_dialog_output (void)
}
static void
-zenity_calendar_dialog_response (GtkWidget *widget, int response,
- gpointer data)
+zenity_calendar_dialog_response (GtkWidget *widget, char *rstr, gpointer data)
{
ZenityData *zen_data = data;
+ ZenityExitCode response = zenity_util_parse_dialog_response (rstr);
switch (response)
{
- case GTK_RESPONSE_OK:
+ case ZENITY_OK:
zenity_calendar_dialog_output ();
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
break;
- case GTK_RESPONSE_CANCEL:
+ case ZENITY_CANCEL:
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
break;
@@ -178,5 +171,5 @@ zenity_calendar_dialog_response (GtkWidget *widget, int response,
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);
break;
}
- zenity_util_gapp_quit (GTK_WINDOW(gtk_widget_get_native (widget)));
+ zenity_util_gapp_quit (GTK_WINDOW(gtk_widget_get_native (widget)), zen_data);
}
diff --git a/src/color.c b/src/color.c
index 4289407..667c1ad 100644
--- a/src/color.c
+++ b/src/color.c
@@ -4,7 +4,7 @@
* color.c
*
* Copyright © 2010 Berislav Kovacki
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -32,8 +32,7 @@
static ZenityData *zen_data;
-static void zenity_colorselection_dialog_response (GtkWidget *widget,
- int response, gpointer data);
+static void zenity_colorselection_dialog_response (GtkWidget *widget, char *rstr, gpointer data);
void
zenity_colorselection (ZenityData *data, ZenityColorData *color_data)
@@ -58,11 +57,7 @@ zenity_colorselection (ZenityData *data, ZenityColorData *color_data)
if (data->extra_label)
{
- for (int i = 0; data->extra_label[i] != NULL; ++i)
- {
- gtk_dialog_add_button (GTK_DIALOG (dialog),
- data->extra_label[i], i);
- }
+ ZENITY_UTIL_ADD_EXTRA_LABELS (dialog)
}
if (data->modal)
@@ -81,20 +76,20 @@ zenity_colorselection (ZenityData *data, ZenityColorData *color_data)
}
static void
-zenity_colorselection_dialog_response (GtkWidget *widget,
- int response, gpointer data)
+zenity_colorselection_dialog_response (GtkWidget *widget, char *rstr, gpointer data)
{
GdkRGBA color;
+ ZenityExitCode response = zenity_util_parse_dialog_response (rstr);
switch (response)
{
- case GTK_RESPONSE_OK:
+ case ZENITY_OK:
zenity_util_exit_code_with_data (ZENITY_OK, zen_data);
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (widget), &color);
g_print ("%s\n", gdk_rgba_to_string (&color));
break;
- case GTK_RESPONSE_CANCEL:
+ case ZENITY_CANCEL:
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
break;
@@ -105,5 +100,5 @@ zenity_colorselection_dialog_response (GtkWidget *widget,
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);
break;
}
- zenity_util_gapp_quit (GTK_WINDOW(widget));
+ zenity_util_gapp_quit (GTK_WINDOW(widget), zen_data);
}
diff --git a/src/entry.c b/src/entry.c
index a6d67a4..bf94cd4 100644
--- a/src/entry.c
+++ b/src/entry.c
@@ -4,7 +4,7 @@
* entry.c
*
* Copyright © 2002 Sun Microsystems, Inc.
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -29,8 +29,7 @@
#include <config.h>
-static void zenity_entry_dialog_response (GtkWidget *widget,
- int response, gpointer data);
+static void zenity_entry_dialog_response (GtkWidget *widget, char *rstr, gpointer data);
static GtkWidget *entry;
static int n_entries = 0;
@@ -55,13 +54,12 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data)
{
g_autoptr(GtkBuilder) builder = NULL;
GtkWidget *dialog;
- GtkWidget *button;
GObject *text;
GSList *entries = NULL;
GSList *tmp;
GObject *vbox;
- builder = zenity_util_load_ui_file ("zenity_entry_dialog", NULL);
+ builder = zenity_util_load_ui_file ("zenity_entry_dialog", "zenity_entry_box", NULL);
if (builder == NULL)
{
@@ -72,8 +70,7 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data)
dialog = GTK_WIDGET(gtk_builder_get_object (builder,
"zenity_entry_dialog"));
- g_signal_connect (dialog, "response",
- G_CALLBACK(zenity_entry_dialog_response), data);
+ g_signal_connect (dialog, "response", G_CALLBACK(zenity_entry_dialog_response), data);
if (data->dialog_title)
gtk_window_set_title (GTK_WINDOW(dialog), data->dialog_title);
@@ -90,25 +87,17 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data)
if (data->extra_label)
{
- for (int i = 0; data->extra_label[i] != NULL; ++i)
- {
- gtk_dialog_add_button (GTK_DIALOG (dialog),
- data->extra_label[i], i);
- }
+ ZENITY_UTIL_ADD_EXTRA_LABELS (dialog)
}
if (data->ok_label)
{
- button = GTK_WIDGET(gtk_builder_get_object (builder,
- "zenity_entry_ok_button"));
- gtk_button_set_label (GTK_BUTTON(button), data->ok_label);
+ ZENITY_UTIL_SETUP_OK_BUTTON_LABEL (dialog);
}
if (data->cancel_label)
{
- button = GTK_WIDGET(gtk_builder_get_object (builder,
- "zenity_entry_cancel_button"));
- gtk_button_set_label (GTK_BUTTON(button), data->cancel_label);
+ ZENITY_UTIL_SETUP_CANCEL_BUTTON_LABEL (dialog);
}
text = gtk_builder_get_object (builder, "zenity_entry_text");
@@ -202,18 +191,19 @@ zenity_entry_dialog_output (void)
}
static void
-zenity_entry_dialog_response (GtkWidget *widget, int response, gpointer data)
+zenity_entry_dialog_response (GtkWidget *widget, char *rstr, gpointer data)
{
ZenityData *zen_data = data;
+ ZenityExitCode response = zenity_util_parse_dialog_response (rstr);
switch (response)
{
- case GTK_RESPONSE_OK:
+ case ZENITY_OK:
zenity_entry_dialog_output ();
zenity_util_exit_code_with_data (ZENITY_OK, zen_data);
break;
- case GTK_RESPONSE_CANCEL:
+ case ZENITY_CANCEL:
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
break;
@@ -229,5 +219,5 @@ zenity_entry_dialog_response (GtkWidget *widget, int response, gpointer data)
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);
break;
}
- zenity_util_gapp_quit (GTK_WINDOW(widget));
+ zenity_util_gapp_quit (GTK_WINDOW(widget), zen_data);
}
diff --git a/src/fileselection.c b/src/fileselection.c
index e495f76..4cf544d 100644
--- a/src/fileselection.c
+++ b/src/fileselection.c
@@ -4,7 +4,7 @@
* fileselection.c
*
* Copyright © 2002 Sun Microsystems, Inc.
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -31,10 +31,14 @@
#include <config.h>
+/* GtkFileChooser deprecated in 4.10, but we want to maintain backwards
+ * compatibility with GTK 4.0.
+ */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
static ZenityData *zen_data;
-static void zenity_fileselection_dialog_response (GtkDialog *dialog,
- int response, gpointer data);
+static void zenity_fileselection_dialog_response (GtkWidget *widget, char *rstr, gpointer data);
void
zenity_fileselection (ZenityData *data, ZenityFileData *file_data)
@@ -63,8 +67,7 @@ zenity_fileselection (ZenityData *data, ZenityFileData *file_data)
if (data->extra_label)
g_warning ("Cannot add extra labels to GtkFileChooserNative");
- g_signal_connect (dialog, "response",
- G_CALLBACK(zenity_fileselection_dialog_response), file_data);
+ g_signal_connect (dialog, "response", G_CALLBACK(zenity_fileselection_dialog_response), file_data);
if (file_data->uri)
{
@@ -179,11 +182,11 @@ zenity_fileselection_dialog_output (GtkFileChooser *chooser,
}
static void
-zenity_fileselection_dialog_response (GtkDialog *dialog,
- int response, gpointer data)
+zenity_fileselection_dialog_response (GtkWidget *widget, char *rstr, gpointer data)
{
ZenityFileData *file_data = data;
- GtkFileChooser *chooser = GTK_FILE_CHOOSER (dialog);
+ GtkFileChooser *chooser = GTK_FILE_CHOOSER (widget);
+ ZenityExitCode response = zenity_util_parse_dialog_response (rstr);
switch (response)
{
@@ -192,7 +195,7 @@ zenity_fileselection_dialog_response (GtkDialog *dialog,
zenity_util_exit_code_with_data (ZENITY_OK, zen_data);
break;
- case GTK_RESPONSE_CANCEL:
+ case GTK_RESPONSE_REJECT:
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
break;
@@ -209,5 +212,7 @@ zenity_fileselection_dialog_response (GtkDialog *dialog,
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);
break;
}
- zenity_util_gapp_quit (NULL);
+ zenity_util_gapp_quit (NULL, zen_data);
}
+
+G_GNUC_END_IGNORE_DEPRECATIONS
diff --git a/src/forms.c b/src/forms.c
index ea50349..f3ce547 100644
--- a/src/forms.c
+++ b/src/forms.c
@@ -4,7 +4,7 @@
* forms.c
*
* Copyright © 2010 Arx Cruz
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -33,8 +33,7 @@
static ZenityData *zen_data;
static GSList *selected;
-static void zenity_forms_dialog_response (GtkWidget *widget,
- int response, gpointer data);
+static void zenity_forms_dialog_response (GtkWidget *widget, char *rstr, gpointer data);
static void
zenity_forms_dialog_get_selected (GtkTreeModel *model, GtkTreePath *path_buf,
@@ -228,7 +227,6 @@ zenity_forms_dialog (ZenityData *data, ZenityFormsData *forms_data)
GtkWidget *dialog;
GtkWidget *grid;
GtkWidget *text;
- GtkWidget *button;
int list_count = 0;
int combo_count = 0;
@@ -236,7 +234,7 @@ zenity_forms_dialog (ZenityData *data, ZenityFormsData *forms_data)
zen_data = data;
- builder = zenity_util_load_ui_file ("zenity_forms_dialog", NULL);
+ builder = zenity_util_load_ui_file ("zenity_forms_dialog", "zenity_forms_box", NULL);
if (builder == NULL) {
data->exit_code = zenity_util_return_exit_code (ZENITY_ERROR);
@@ -259,23 +257,17 @@ zenity_forms_dialog (ZenityData *data, ZenityFormsData *forms_data)
if (data->extra_label)
{
- for (i = 0; data->extra_label[i] != NULL; ++i)
- {
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- data->extra_label[i], i);
- }
+ ZENITY_UTIL_ADD_EXTRA_LABELS (dialog)
}
- if (data->ok_label) {
- button = GTK_WIDGET (
- gtk_builder_get_object (builder, "zenity_forms_ok_button"));
- gtk_button_set_label (GTK_BUTTON (button), data->ok_label);
+ if (data->ok_label)
+ {
+ ZENITY_UTIL_SETUP_OK_BUTTON_LABEL (dialog);
}
- if (data->cancel_label) {
- button = GTK_WIDGET (
- gtk_builder_get_object (builder, "zenity_forms_cancel_button"));
- gtk_button_set_label (GTK_BUTTON (button), data->cancel_label);
+ if (data->cancel_label)
+ {
+ ZENITY_UTIL_SETUP_CANCEL_BUTTON_LABEL (dialog);
}
text = GTK_WIDGET (gtk_builder_get_object (builder, "zenity_forms_text"));
@@ -441,18 +433,19 @@ zenity_forms_dialog_output (ZenityFormsData *forms_data)
}
static void
-zenity_forms_dialog_response (GtkWidget *widget, int response, gpointer data)
+zenity_forms_dialog_response (GtkWidget *widget, char *rstr, gpointer data)
{
ZenityFormsData *forms_data = data;
+ ZenityExitCode response = zenity_util_parse_dialog_response (rstr);
switch (response)
{
- case GTK_RESPONSE_OK:
+ case ZENITY_OK:
zenity_forms_dialog_output (forms_data);
zenity_util_exit_code_with_data (ZENITY_OK, zen_data);
break;
- case GTK_RESPONSE_CANCEL:
+ case ZENITY_CANCEL:
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
break;
@@ -468,5 +461,5 @@ zenity_forms_dialog_response (GtkWidget *widget, int response, gpointer data)
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);
break;
}
- zenity_util_gapp_quit (GTK_WINDOW(widget));
+ zenity_util_gapp_quit (GTK_WINDOW(widget), zen_data);
}
diff --git a/src/main.c b/src/main.c
index a4531fd..b224bf1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4,7 +4,7 @@
* main.c
*
* Copyright © 2002 Sun Microsystems, Inc.
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -27,7 +27,7 @@
#include "option.h"
#include "zenity.h"
-#include <gtk/gtk.h>
+#include <adwaita.h>
#include <locale.h>
#include <stdlib.h>
@@ -39,7 +39,7 @@ typedef struct {
} ZenityArgs;
static void
-command_line_cb (GtkApplication *app,
+command_line_cb (GApplication *app,
GApplicationCommandLine *command_line,
gpointer user_data)
{
@@ -125,9 +125,6 @@ command_line_cb (GtkApplication *app,
exit (-1);
}
- g_application_command_line_set_exit_status (command_line,
- results->data->exit_code);
-
g_free (args);
}
@@ -135,7 +132,7 @@ int
main (int argc, char *argv[])
{
ZenityArgs *args;
- g_autoptr(GtkApplication) app = NULL;
+ g_autoptr(AdwApplication) app = NULL;
int status;
/* <i18n> */
@@ -150,7 +147,7 @@ main (int argc, char *argv[])
args->argc = argc;
args->argv = argv;
- app = gtk_application_new (APP_ID, G_APPLICATION_HANDLES_COMMAND_LINE);
+ app = adw_application_new (APP_ID, G_APPLICATION_HANDLES_COMMAND_LINE);
g_signal_connect (app, "command-line", G_CALLBACK(command_line_cb), args);
status = g_application_run (G_APPLICATION(app), 0, NULL);
diff --git a/src/meson.build b/src/meson.build
index 9034cb2..0c03b31 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -15,12 +15,25 @@ zenity_sources = [
'scale.c',
'text.c',
'tree.c',
- 'util.c'
+ 'util.c',
]
+zenity_enums = gnome.mkenums_simple('zenity-enums',
+ sources: 'zenity.h',
+)
+
+zenity_res_conf = configuration_data()
+zenity_res_conf.set('resource_base_path', resource_base_path)
+
+zenity_res_in = configure_file(
+ input: 'zenity.gresource.xml.in',
+ output: 'zenity.gresource.xml',
+ configuration: zenity_res_conf
+)
+
zenity_res = gnome.compile_resources(
'zenity-resources',
- 'zenity.gresource.xml',
+ zenity_res_in,
c_name: 'zenity'
)
@@ -30,9 +43,9 @@ zenity_c_args = [
zenity = executable(
meson.project_name(),
- zenity_sources + zenity_res,
+ zenity_sources + zenity_enums + zenity_res,
include_directories: zenity_root_dir,
c_args: zenity_c_args,
- dependencies: gtk_dep,
+ dependencies: adw_dep,
install: true
)
diff --git a/src/msg.c b/src/msg.c
index 985a733..87a5beb 100644
--- a/src/msg.c
+++ b/src/msg.c
@@ -4,7 +4,7 @@
* msg.c
*
* Copyright (C) 2002 Sun Microsystems, Inc.
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -29,31 +29,7 @@
#include "util.h"
#include "zenity.h"
-static void zenity_msg_dialog_response (GtkWidget *widget,
- int response, gpointer data);
-
-static void
-zenity_msg_construct_question_dialog (GtkWidget *dialog,
- ZenityMsgData *msg_data, ZenityData *data)
-{
- GtkWidget *cancel_button, *ok_button;
-
- cancel_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
- _("_No"), GTK_RESPONSE_CANCEL);
- ok_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
- _("_Yes"), GTK_RESPONSE_OK);
-
- gtk_widget_grab_focus
- (msg_data->default_cancel ? cancel_button : ok_button);
-
- if (data->cancel_label) {
- gtk_button_set_label (GTK_BUTTON (cancel_button), data->cancel_label);
- }
-
- if (data->ok_label) {
- gtk_button_set_label (GTK_BUTTON (ok_button), data->ok_label);
- }
-}
+static void zenity_msg_dialog_response (GtkWidget *widget, char *rstr, gpointer data);
/* FIXME - Is this still necessary with gtk4? */
static void
@@ -86,50 +62,42 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
{
g_autoptr(GtkBuilder) builder;
GtkWidget *dialog;
- GtkWidget *ok_button;
GObject *text;
GObject *image;
switch (msg_data->mode)
{
case ZENITY_MSG_WARNING:
- builder = zenity_util_load_ui_file ("zenity_warning_dialog", NULL);
+ builder = zenity_util_load_ui_file ("zenity_warning_dialog", "zenity_warning_box", NULL);
dialog = GTK_WIDGET (
gtk_builder_get_object (builder, "zenity_warning_dialog"));
text = gtk_builder_get_object (builder, "zenity_warning_text");
image = gtk_builder_get_object (builder, "zenity_warning_image");
- ok_button = GTK_WIDGET (
- gtk_builder_get_object (builder, "zenity_warning_ok_button"));
break;
case ZENITY_MSG_QUESTION:
case ZENITY_MSG_SWITCH:
- builder = zenity_util_load_ui_file ("zenity_question_dialog", NULL);
+ builder = zenity_util_load_ui_file ("zenity_question_dialog", "zenity_question_box", NULL);
dialog = GTK_WIDGET (gtk_builder_get_object (builder,
"zenity_question_dialog"));
text = gtk_builder_get_object (builder, "zenity_question_text");
image = gtk_builder_get_object (builder, "zenity_question_image");
- ok_button = NULL;
break;
case ZENITY_MSG_ERROR:
- builder = zenity_util_load_ui_file ("zenity_error_dialog", NULL);
+ builder = zenity_util_load_ui_file ("zenity_error_dialog", "zenity_error_box", NULL);
dialog = GTK_WIDGET (gtk_builder_get_object (builder,
"zenity_error_dialog"));
text = gtk_builder_get_object (builder, "zenity_error_text");
image = gtk_builder_get_object (builder, "zenity_error_image");
- ok_button = GTK_WIDGET (gtk_builder_get_object (builder,
- "zenity_error_ok_button"));
break;
case ZENITY_MSG_INFO:
- builder = zenity_util_load_ui_file ("zenity_info_dialog", NULL);
+ builder = zenity_util_load_ui_file ("zenity_info_dialog", "zenity_info_box", NULL);
dialog = GTK_WIDGET (gtk_builder_get_object (builder,
"zenity_info_dialog"));
text = gtk_builder_get_object (builder, "zenity_info_text");
image = gtk_builder_get_object (builder, "zenity_info_image");
- ok_button = GTK_WIDGET (gtk_builder_get_object (builder,
- "zenity_info_ok_button"));
break;
default:
@@ -137,18 +105,13 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
dialog = NULL;
text = NULL;
image = NULL;
- ok_button = NULL;
g_assert_not_reached ();
break;
}
if (data->extra_label)
{
- for (int i = 0; data->extra_label[i] != NULL; ++i)
- {
- gtk_dialog_add_button (GTK_DIALOG (dialog),
- data->extra_label[i], i);
- }
+ ZENITY_UTIL_ADD_EXTRA_LABELS (dialog)
}
if (builder == NULL) {
@@ -156,18 +119,14 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
return;
}
- g_signal_connect (G_OBJECT (dialog),
- "response",
- G_CALLBACK (zenity_msg_dialog_response),
- data);
+ g_signal_connect (dialog, "response", G_CALLBACK(zenity_msg_dialog_response), data);
if (data->dialog_title)
gtk_window_set_title (GTK_WINDOW (dialog), data->dialog_title);
- if (ok_button) {
- if (data->ok_label) {
- gtk_button_set_label (GTK_BUTTON (ok_button), data->ok_label);
- }
+ if (data->ok_label)
+ {
+ ZENITY_UTIL_SETUP_OK_BUTTON_LABEL (dialog)
}
switch (msg_data->mode)
@@ -180,7 +139,6 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
case ZENITY_MSG_QUESTION:
gtk_window_set_icon_name (GTK_WINDOW(dialog),
"dialog-question");
- zenity_msg_construct_question_dialog (dialog, msg_data, data);
break;
case ZENITY_MSG_SWITCH:
@@ -256,16 +214,18 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
}
static void
-zenity_msg_dialog_response (GtkWidget *widget, int response, gpointer data) {
+zenity_msg_dialog_response (GtkWidget *widget, char *rstr, gpointer data)
+{
ZenityData *zen_data = data;
+ ZenityExitCode response = zenity_util_parse_dialog_response (rstr);
switch (response)
{
- case GTK_RESPONSE_OK:
+ case ZENITY_OK:
zenity_util_exit_code_with_data (ZENITY_OK, zen_data);
break;
- case GTK_RESPONSE_CANCEL:
+ case ZENITY_CANCEL:
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
break;
@@ -276,5 +236,5 @@ zenity_msg_dialog_response (GtkWidget *widget, int response, gpointer data) {
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);
break;
}
- zenity_util_gapp_quit (GTK_WINDOW(widget));
+ zenity_util_gapp_quit (GTK_WINDOW(widget), zen_data);
}
diff --git a/src/notification.c b/src/notification.c
index dc25e59..295c1c2 100644
--- a/src/notification.c
+++ b/src/notification.c
@@ -88,7 +88,7 @@ on_notification_default_action (GSimpleAction *self,
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
- zenity_util_gapp_quit (NULL);
+ zenity_util_gapp_quit (NULL, zen_data);
}
static gboolean
diff --git a/src/option.h b/src/option.h
index df4150a..5da7cfe 100644
--- a/src/option.h
+++ b/src/option.h
@@ -2,7 +2,7 @@
* option.h
*
* Copyright © 2002 Sun Microsystems, Inc.
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
diff --git a/src/password.c b/src/password.c
index 172fe4f..69dd683 100644
--- a/src/password.c
+++ b/src/password.c
@@ -4,7 +4,7 @@
* password.c
*
* Copyright © 2010 Arx Cruz
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -33,15 +33,13 @@
static ZenityData *zen_data;
-static void zenity_password_dialog_response (GtkWidget *widget,
- int response, gpointer data);
+static void zenity_password_dialog_response (GtkWidget *widget, char *rstr, gpointer data);
void
zenity_password_dialog (ZenityData *data, ZenityPasswordData *password_data)
{
GtkBuilder *builder;
GtkWidget *dialog;
- GtkWidget *button;
GtkWidget *grid;
GtkWidget *label;
int pass_row = 0;
@@ -49,7 +47,7 @@ zenity_password_dialog (ZenityData *data, ZenityPasswordData *password_data)
/* Set global */
zen_data = data;
- builder = zenity_util_load_ui_file ("zenity_password_dialog", NULL);
+ builder = zenity_util_load_ui_file ("zenity_password_dialog", "zenity_password_box", NULL);
if (builder == NULL)
{
@@ -62,25 +60,16 @@ zenity_password_dialog (ZenityData *data, ZenityPasswordData *password_data)
if (data->extra_label)
{
- for (int i = 0; data->extra_label[i] != NULL; ++i)
- {
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- data->extra_label[i], i);
- }
+ ZENITY_UTIL_ADD_EXTRA_LABELS (dialog)
}
- if (data->ok_label)
- {
- button = GTK_WIDGET(gtk_builder_get_object (builder,
- "zenity_password_ok_button"));
- gtk_button_set_label (GTK_BUTTON(button), data->ok_label);
+ if (data->ok_label) {
+ ZENITY_UTIL_SETUP_OK_BUTTON_LABEL (dialog);
}
if (data->cancel_label)
{
- button = GTK_WIDGET(gtk_builder_get_object (builder,
- "zenity_password_cancel_button"));
- gtk_button_set_label (GTK_BUTTON(button), data->cancel_label);
+ ZENITY_UTIL_SETUP_CANCEL_BUTTON_LABEL (dialog);
}
grid = GTK_WIDGET(gtk_builder_get_object (builder,
@@ -136,8 +125,7 @@ zenity_password_dialog (ZenityData *data, ZenityPasswordData *password_data)
if (data->modal)
gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
- g_signal_connect (dialog, "response",
- G_CALLBACK(zenity_password_dialog_response), password_data);
+ g_signal_connect (dialog, "response", G_CALLBACK(zenity_password_dialog_response), password_data);
zenity_util_show_dialog (dialog);
@@ -151,18 +139,18 @@ zenity_password_dialog (ZenityData *data, ZenityPasswordData *password_data)
}
static void
-zenity_password_dialog_response (GtkWidget *widget, int response,
- gpointer data)
+zenity_password_dialog_response (GtkWidget *widget, char *rstr, gpointer data)
{
ZenityPasswordData *password_data = data;
GtkEntryBuffer *user_buff, *pass_buff;
+ ZenityExitCode response = zenity_util_parse_dialog_response (rstr);
user_buff = gtk_entry_get_buffer (GTK_ENTRY(password_data->entry_username));
pass_buff = gtk_entry_get_buffer (GTK_ENTRY(password_data->entry_password));
switch (response)
{
- case GTK_RESPONSE_OK:
+ case ZENITY_OK:
zenity_util_exit_code_with_data (ZENITY_OK, zen_data);
if (password_data->username) {
g_print ("%s|%s\n",
@@ -175,7 +163,7 @@ zenity_password_dialog_response (GtkWidget *widget, int response,
}
break;
- case GTK_RESPONSE_CANCEL:
+ case ZENITY_CANCEL:
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
break;
@@ -186,5 +174,5 @@ zenity_password_dialog_response (GtkWidget *widget, int response,
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);
break;
}
- zenity_util_gapp_quit (GTK_WINDOW(widget));
+ zenity_util_gapp_quit (GTK_WINDOW(widget), zen_data);
}
diff --git a/src/progress.c b/src/progress.c
index 81d5e5f..cae1a6c 100644
--- a/src/progress.c
+++ b/src/progress.c
@@ -4,7 +4,7 @@
* progress.c
*
* Copyright © 2002 Sun Microsystems, Inc.
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -50,8 +50,7 @@ static gboolean auto_close;
gint zenity_progress_timeout (gpointer data);
gint zenity_progress_pulsate_timeout (gpointer data);
-static void zenity_progress_dialog_response (GtkWidget *widget,
- int response, gpointer data);
+static void zenity_progress_dialog_response (GtkWidget *widget, char *rstr, gpointer data);
static gboolean
zenity_progress_pulsate_progress_bar (gpointer user_data)
@@ -250,19 +249,15 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition,
if (percentage == 100)
{
- GObject *button;
-
- button = gtk_builder_get_object (builder,
- "zenity_progress_ok_button");
- gtk_widget_set_sensitive (GTK_WIDGET (button), TRUE);
- gtk_widget_grab_focus (GTK_WIDGET (button));
+ adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "ok", TRUE);
+ adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG(parent), "ok");
if (progress_data->autoclose)
{
zen_data->exit_code =
zenity_util_return_exit_code (ZENITY_OK);
- zenity_util_gapp_quit (parent);
+ zenity_util_gapp_quit (parent, zen_data);
}
}
}
@@ -276,17 +271,10 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition,
{
/* We assume that we are done, so stop the pulsating and de-sensitize
* the buttons */
- GtkWidget *button;
-
- button = GTK_WIDGET(gtk_builder_get_object (builder,
- "zenity_progress_ok_button"));
- gtk_widget_set_sensitive (button, TRUE);
- gtk_widget_grab_focus (button);
+ adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "ok", TRUE);
+ adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "cancel", FALSE);
+ adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG(parent), "ok");
- button = GTK_WIDGET (gtk_builder_get_object (builder,
- "zenity_progress_cancel_button"));
-
- gtk_widget_set_sensitive (button, FALSE);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), 1.0);
zenity_progress_pulsate_stop ();
@@ -296,7 +284,7 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition,
if (progress_data->autoclose)
{
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
- zenity_util_gapp_quit (parent);
+ zenity_util_gapp_quit (parent, zen_data);
}
g_io_channel_shutdown (channel, TRUE, NULL);
@@ -331,13 +319,11 @@ void
zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
{
GtkWidget *dialog;
- GtkWidget *button;
GObject *text;
GObject *progress_bar;
- GObject *cancel_button, *ok_button;
zen_data = data;
- builder = zenity_util_load_ui_file ("zenity_progress_dialog", NULL);
+ builder = zenity_util_load_ui_file ("zenity_progress_dialog", "zenity_progress_box", NULL);
if (builder == NULL) {
data->exit_code = zenity_util_return_exit_code (ZENITY_ERROR);
@@ -351,8 +337,7 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
progress_bar = gtk_builder_get_object (builder, "zenity_progress_bar");
- g_signal_connect (dialog, "response",
- G_CALLBACK(zenity_progress_dialog_response), data);
+ g_signal_connect (dialog, "response", G_CALLBACK(zenity_progress_dialog_response), data);
if (data->dialog_title)
gtk_window_set_title (GTK_WINDOW(dialog), data->dialog_title);
@@ -384,25 +369,16 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
if (data->extra_label)
{
- for (int i = 0; data->extra_label[i] != NULL; ++i)
- {
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- data->extra_label[i], i);
- }
+ ZENITY_UTIL_ADD_EXTRA_LABELS (dialog)
}
- if (data->ok_label)
- {
- button = GTK_WIDGET(gtk_builder_get_object (builder,
- "zenity_progress_ok_button"));
- gtk_button_set_label (GTK_BUTTON(button), data->ok_label);
+ if (data->ok_label) {
+ ZENITY_UTIL_SETUP_OK_BUTTON_LABEL (dialog);
}
if (data->cancel_label)
{
- button = GTK_WIDGET(gtk_builder_get_object (builder,
- "zenity_progress_cancel_button"));
- gtk_button_set_label (GTK_BUTTON(button), data->cancel_label);
+ ZENITY_UTIL_SETUP_CANCEL_BUTTON_LABEL (dialog);
}
if (progress_data->dialog_text) {
@@ -416,21 +392,22 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
}
autokill = progress_data->autokill;
-
auto_close = progress_data->autoclose;
- ok_button = gtk_builder_get_object (builder, "zenity_progress_ok_button");
-
no_cancel = progress_data->no_cancel;
- cancel_button =
- gtk_builder_get_object (builder, "zenity_progress_cancel_button");
- if (no_cancel) {
- gtk_widget_hide (GTK_WIDGET(cancel_button));
+ /* Unlike some other dialogs, this one starts off blank and we need to add
+ * the OK/Cancel buttons depending on the options.
+ */
+ if (no_cancel)
gtk_window_set_deletable (GTK_WINDOW(dialog), FALSE);
- }
+ else
+ adw_message_dialog_add_response (ADW_MESSAGE_DIALOG(dialog), "cancel", _("_Cancel"));
- if (no_cancel && auto_close)
- gtk_widget_hide (GTK_WIDGET(ok_button));
+ if (!auto_close)
+ {
+ adw_message_dialog_add_response (ADW_MESSAGE_DIALOG(dialog), "ok", _("_OK"));
+ adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(dialog), "ok", FALSE);
+ }
zenity_util_show_dialog (dialog);
zenity_progress_read_info (progress_data);
@@ -445,16 +422,17 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
}
static void
-zenity_progress_dialog_response (GtkWidget *widget, int response,
- gpointer data)
+zenity_progress_dialog_response (GtkWidget *widget, char *rstr, gpointer data)
{
+ ZenityExitCode response = zenity_util_parse_dialog_response (rstr);
+
switch (response)
{
- case GTK_RESPONSE_OK:
+ case ZENITY_OK:
zenity_util_exit_code_with_data (ZENITY_OK, zen_data);
break;
- case GTK_RESPONSE_CANCEL:
+ case ZENITY_CANCEL:
/* We do not want to kill the parent process, in order to give the
* user the ability to choose the action to be taken. But we want
* to give people the option to choose this behavior.
@@ -478,5 +456,5 @@ zenity_progress_dialog_response (GtkWidget *widget, int response,
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);
break;
}
- zenity_util_gapp_quit (GTK_WINDOW(widget));
+ zenity_util_gapp_quit (GTK_WINDOW(widget), zen_data);
}
diff --git a/src/scale.c b/src/scale.c
index 2140040..7ac0f41 100644
--- a/src/scale.c
+++ b/src/scale.c
@@ -4,7 +4,7 @@
* scale.c
*
* Copyright © 2002 Sun Microsystems, Inc.
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -33,19 +33,16 @@
static GtkWidget *scale;
static void zenity_scale_value_changed (GtkWidget *widget, gpointer data);
-static void zenity_scale_dialog_response (GtkWidget *widget, int response,
- gpointer data);
+static void zenity_scale_dialog_response (GtkWidget *widget, char *rstr, gpointer data);
void
zenity_scale (ZenityData *data, ZenityScaleData *scale_data)
{
g_autoptr(GtkBuilder) builder = NULL;
GtkWidget *dialog;
- GtkWidget *button;
GObject *text;
- builder =
- zenity_util_load_ui_file ("zenity_scale_dialog", "adjustment1", NULL);
+ builder = zenity_util_load_ui_file ("zenity_scale_dialog", "zenity_scale_adjustment", "zenity_scale_box", NULL);
if (builder == NULL) {
data->exit_code = zenity_util_return_exit_code (ZENITY_ERROR);
@@ -58,8 +55,7 @@ zenity_scale (ZenityData *data, ZenityScaleData *scale_data)
GTK_WIDGET (gtk_builder_get_object (builder, "zenity_scale_hscale"));
text = gtk_builder_get_object (builder, "zenity_scale_text");
- g_signal_connect (dialog, "response",
- G_CALLBACK(zenity_scale_dialog_response), data);
+ g_signal_connect (dialog, "response", G_CALLBACK(zenity_scale_dialog_response), data);
if (scale_data->min_value >= scale_data->max_value)
{
@@ -92,24 +88,17 @@ zenity_scale (ZenityData *data, ZenityScaleData *scale_data)
if (data->extra_label)
{
- for (int i = 0; data->extra_label[i] != NULL; ++i)
- {
- gtk_dialog_add_button (GTK_DIALOG (dialog),
- data->extra_label[i], i);
- }
+ ZENITY_UTIL_ADD_EXTRA_LABELS (dialog)
}
- if (data->ok_label) {
- button = GTK_WIDGET(gtk_builder_get_object (builder,
- "zenity_scale_ok_button"));
- gtk_button_set_label (GTK_BUTTON (button), data->ok_label);
+ if (data->ok_label)
+ {
+ ZENITY_UTIL_SETUP_OK_BUTTON_LABEL (dialog);
}
if (data->cancel_label)
{
- button = GTK_WIDGET (gtk_builder_get_object (builder,
- "zenity_scale_cancel_button"));
- gtk_button_set_label (GTK_BUTTON (button), data->cancel_label);
+ ZENITY_UTIL_SETUP_CANCEL_BUTTON_LABEL (dialog);
}
if (scale_data->dialog_text) {
@@ -151,18 +140,19 @@ zenity_scale_value_changed (GtkWidget *widget, gpointer data)
}
static void
-zenity_scale_dialog_response (GtkWidget *widget, int response, gpointer data)
+zenity_scale_dialog_response (GtkWidget *widget, char *rstr, gpointer data)
{
ZenityData *zen_data = data;
+ ZenityExitCode response = zenity_util_parse_dialog_response (rstr);
switch (response)
{
- case GTK_RESPONSE_OK:
+ case ZENITY_OK:
zenity_util_exit_code_with_data (ZENITY_OK, zen_data);
g_print ("%.0f\n", gtk_range_get_value (GTK_RANGE (scale)));
break;
- case GTK_RESPONSE_CANCEL:
+ case ZENITY_CANCEL:
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
break;
@@ -181,5 +171,5 @@ zenity_scale_dialog_response (GtkWidget *widget, int response, gpointer data)
break;
}
- zenity_util_gapp_quit (GTK_WINDOW(widget));
+ zenity_util_gapp_quit (GTK_WINDOW(widget), zen_data);
}
diff --git a/src/text.c b/src/text.c
index 1df25b2..f539c7a 100644
--- a/src/text.c
+++ b/src/text.c
@@ -4,7 +4,7 @@
* text.c
*
* Copyright © 2002 Sun Microsystems, Inc.
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -38,9 +38,8 @@
static ZenityTextData *zen_text_data;
-static void zenity_text_dialog_response (GtkWidget *widget, int response,
- gpointer data);
-static void zenity_text_toggle_button (GtkToggleButton *button, gpointer data);
+static void zenity_text_dialog_response (GtkWidget *widget, char *rstr, gpointer data);
+static void zenity_text_toggle_button (GtkCheckButton *button, AdwMessageDialog *dialog);
// TODO - I don't think gtk4 support for webkit is fully "there" yet.
#ifdef HAVE_WEBKITGTK
@@ -253,9 +252,7 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
{
g_autoptr(GtkBuilder) builder = NULL;
GtkWidget *dialog;
- GtkWidget *ok_button;
GtkWidget *checkbox;
- GtkWidget *cancel_button;
GObject *text_view;
GtkTextBuffer *text_buffer;
@@ -268,8 +265,7 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
#endif
zen_text_data = text_data;
- builder =
- zenity_util_load_ui_file ("zenity_text_dialog", "textbuffer1", NULL);
+ builder = zenity_util_load_ui_file ("zenity_text_dialog", "zenity_text_box", NULL);
if (builder == NULL) {
data->exit_code = zenity_util_return_exit_code (ZENITY_ERROR);
@@ -279,10 +275,6 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
dialog = GTK_WIDGET(gtk_builder_get_object (builder,
"zenity_text_dialog"));
- ok_button = GTK_WIDGET(gtk_builder_get_object (builder,
- "zenity_text_close_button"));
- cancel_button = GTK_WIDGET(gtk_builder_get_object (builder,
- "zenity_text_cancel_button"));
checkbox = GTK_WIDGET(gtk_builder_get_object (builder,
"zenity_text_checkbox"));
@@ -295,8 +287,6 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
gtk_window_set_icon_name (GTK_WINDOW(dialog),
"accessories-text-editor");
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
-
text_buffer = gtk_text_buffer_new (NULL);
text_view = gtk_builder_get_object (builder, "zenity_text_view");
gtk_text_view_set_buffer (GTK_TEXT_VIEW (text_view), text_buffer);
@@ -334,28 +324,24 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
if (data->extra_label)
{
- for (int i = 0; data->extra_label[i] != NULL; ++i)
- {
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- data->extra_label[i], i);
- }
+ ZENITY_UTIL_ADD_EXTRA_LABELS (dialog)
}
if (data->ok_label) {
- gtk_button_set_label (GTK_BUTTON (ok_button), data->ok_label);
+ ZENITY_UTIL_SETUP_OK_BUTTON_LABEL (dialog);
}
- if (data->cancel_label) {
- gtk_button_set_label (GTK_BUTTON (cancel_button), data->cancel_label);
+ if (data->cancel_label)
+ {
+ ZENITY_UTIL_SETUP_CANCEL_BUTTON_LABEL (dialog);
}
if (text_data->checkbox) {
- gtk_widget_set_visible (GTK_WIDGET (checkbox), TRUE);
- gtk_widget_set_sensitive (GTK_WIDGET (ok_button), FALSE);
- gtk_button_set_label (GTK_BUTTON (checkbox), text_data->checkbox);
+ gtk_widget_set_visible (GTK_WIDGET(checkbox), TRUE);
+ gtk_check_button_set_label (GTK_CHECK_BUTTON(checkbox), text_data->checkbox);
+ adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(dialog), "ok", FALSE);
- g_signal_connect (checkbox, "toggled",
- G_CALLBACK(zenity_text_toggle_button), ok_button);
+ g_signal_connect (checkbox, "toggled", G_CALLBACK(zenity_text_toggle_button), dialog);
}
if (data->width > -1 || data->height > -1)
@@ -428,12 +414,9 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
}
static void
-zenity_text_toggle_button (GtkToggleButton *button, gpointer data)
+zenity_text_toggle_button (GtkCheckButton *button, AdwMessageDialog *dialog)
{
- GtkWidget *ok_button = GTK_WIDGET(data);
-
- gtk_widget_set_sensitive (ok_button,
- gtk_toggle_button_get_active (button));
+ adw_message_dialog_set_response_enabled (dialog, "ok", gtk_check_button_get_active (button));
}
static void
@@ -452,13 +435,14 @@ zenity_text_dialog_output (ZenityData *zen_data)
}
static void
-zenity_text_dialog_response (GtkWidget *widget, int response, gpointer data)
+zenity_text_dialog_response (GtkWidget *widget, char *rstr, gpointer data)
{
ZenityData *zen_data = data;
+ ZenityExitCode response = zenity_util_parse_dialog_response (rstr);
switch (response)
{
- case GTK_RESPONSE_CLOSE:
+ case ZENITY_ESC:
zenity_text_dialog_output (zen_data);
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
break;
@@ -477,5 +461,5 @@ zenity_text_dialog_response (GtkWidget *widget, int response, gpointer data)
zenity_util_exit_code_with_data (ZENITY_ESC, zen_data);
break;
}
- zenity_util_gapp_quit (GTK_WINDOW(widget));
+ zenity_util_gapp_quit (GTK_WINDOW(widget), zen_data);
}
diff --git a/src/tree.c b/src/tree.c
index 6f07973..aba2a3b 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -4,7 +4,7 @@
* tree.c
*
* Copyright © 2002 Sun Microsystems, Inc.
- * Copyright © 2021 Logan Rathbone
+ * Copyright © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -47,8 +47,7 @@ static GIOChannel *channel;
static int *zenity_tree_extract_column_indexes (char *indexes, int n_columns);
static gboolean zenity_tree_column_is_hidden (int column_index);
-static void zenity_tree_dialog_response (GtkWidget *widget, int response,
- gpointer data);
+static void zenity_tree_dialog_response (GtkWidget *widget, char *rstr, gpointer data);
static void zenity_tree_row_activated (GtkTreeView *tree_view,
GtkTreePath *tree_path, GtkTreeViewColumn *tree_col, gpointer data);
@@ -349,7 +348,6 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
{
g_autoptr(GtkBuilder) builder = NULL;
GtkWidget *dialog;
- GtkWidget *button;
GObject *text;
GtkTreeViewColumn *column;
GtkListStore *model;
@@ -358,7 +356,7 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
gboolean first_column = FALSE;
int i, column_index, n_columns;
- builder = zenity_util_load_ui_file ("zenity_tree_dialog", NULL);
+ builder = zenity_util_load_ui_file ("zenity_tree_dialog", "zenity_tree_box", NULL);
if (builder == NULL) {
data->exit_code = zenity_util_return_exit_code (ZENITY_ERROR);
@@ -406,8 +404,7 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
dialog = GTK_WIDGET(gtk_builder_get_object (builder,
"zenity_tree_dialog"));
- g_signal_connect (dialog, "response",
- G_CALLBACK(zenity_tree_dialog_response), data);
+ g_signal_connect (dialog, "response", G_CALLBACK(zenity_tree_dialog_response), data);
if (data->dialog_title)
gtk_window_set_title (GTK_WINDOW (dialog), data->dialog_title);
@@ -417,23 +414,15 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
if (data->extra_label)
{
- for (int i = 0; data->extra_label[i] != NULL; ++i)
- {
- gtk_dialog_add_button (GTK_DIALOG (dialog),
- data->extra_label[i], i);
- }
+ ZENITY_UTIL_ADD_EXTRA_LABELS (dialog)
}
if (data->ok_label) {
- button = GTK_WIDGET(gtk_builder_get_object (builder,
- "zenity_tree_ok_button"));
- gtk_button_set_label (GTK_BUTTON (button), data->ok_label);
+ ZENITY_UTIL_SETUP_OK_BUTTON_LABEL (dialog)
}
if (data->cancel_label) {
- button = GTK_WIDGET (gtk_builder_get_object (builder,
- "zenity_tree_cancel_button"));
- gtk_button_set_label (GTK_BUTTON (button), data->cancel_label);
+ ZENITY_UTIL_SETUP_CANCEL_BUTTON_LABEL (dialog)
}
text = gtk_builder_get_object (builder, "zenity_tree_text");
@@ -804,18 +793,19 @@ zenity_tree_dialog_output (void)
}
static void
-zenity_tree_dialog_response (GtkWidget *widget, int response, gpointer data)
+zenity_tree_dialog_response (GtkWidget *widget, char *rstr, gpointer data)
{
ZenityData *zen_data = data;
+ ZenityExitCode response = zenity_util_parse_dialog_response (rstr);
switch (response)
{
- case GTK_RESPONSE_OK:
+ case ZENITY_OK:
zenity_tree_dialog_output ();
zenity_util_exit_code_with_data (ZENITY_OK, zen_data);
break;
- case GTK_RESPONSE_CANCEL:
+ case ZENITY_CANCEL:
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
break;
@@ -839,7 +829,7 @@ zenity_tree_dialog_response (GtkWidget *widget, int response, gpointer data)
g_io_channel_shutdown (channel, TRUE, NULL);
}
- zenity_util_gapp_quit (GTK_WINDOW(widget));
+ zenity_util_gapp_quit (GTK_WINDOW(widget), zen_data);
}
static void
@@ -858,7 +848,7 @@ zenity_tree_row_activated (GtkTreeView *loc_tv, GtkTreePath *tree_path,
parent = GTK_WINDOW(gtk_widget_get_native (GTK_WIDGET(tree_view)));
- zenity_util_gapp_quit (parent);
+ zenity_util_gapp_quit (parent, zen_data);
}
static gboolean
diff --git a/src/util.c b/src/util.c
index ec60ba3..1cc21af 100644
--- a/src/util.c
+++ b/src/util.c
@@ -7,7 +7,7 @@
* © 1999, 2000 Red Hat Inc.
* © 1998 James Henstridge
* © 1995-2002 Free Software Foundation
- * © 2021 Logan Rathbone
+ * © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -32,6 +32,7 @@
#include "util.h"
#include "zenity.h"
+
#include <errno.h>
#include <locale.h>
#include <stdarg.h>
@@ -210,8 +211,8 @@ zenity_util_show_help (GError **error) {
}
int
-zenity_util_return_exit_code (ZenityExitCode value) {
-
+zenity_util_return_exit_code (ZenityExitCode value)
+{
const char *env_var = NULL;
int retval;
@@ -416,15 +417,12 @@ zenity_util_show_dialog (GtkWidget *dialog)
}
gboolean
-zenity_util_timeout_handle (gpointer data)
+zenity_util_timeout_handle (AdwMessageDialog *dialog)
{
- GtkDialog *dialog = GTK_DIALOG (data);
-
- if (dialog != NULL) {
- gtk_dialog_response (dialog, ZENITY_TIMEOUT);
+ if (dialog) {
+ adw_message_dialog_response (dialog, "timeout");
}
else {
- zenity_util_gapp_quit (GTK_WINDOW(dialog));
exit (ZENITY_TIMEOUT);
}
return FALSE;
@@ -450,14 +448,61 @@ zenity_util_gapp_main (GtkWindow *window)
}
void
-zenity_util_gapp_quit (GtkWindow *window)
+zenity_util_gapp_quit (GtkWindow *window, ZenityData *data)
{
+ /* This is a bit hack-ish, but GApplication doesn't really allow for
+ * customized exit statuses within that API.
+ */
+ if (data->exit_code != 0)
+ exit (data->exit_code);
+
if (window)
{
g_assert (GTK_IS_WINDOW (window));
- gtk_window_set_application (window, NULL);
+ gtk_window_destroy (window);
}
else {
g_application_release (g_application_get_default ());
}
}
+
+int
+zenity_util_parse_dialog_response (const char *response)
+{
+ if (g_strcmp0 (response, "ok") == 0 || g_strcmp0 (response, "yes") == 0)
+ {
+ return ZENITY_OK;
+ }
+ else if (g_strcmp0 (response, "cancel") == 0 || g_strcmp0 (response, "no") == 0)
+ {
+ return ZENITY_CANCEL;
+ }
+ else if (g_strcmp0 (response, "timeout") == 0)
+ {
+ return ZENITY_TIMEOUT;
+ }
+ else if (response[0] >= '0' && response[0] <= '9')
+ {
+ /* FIXME - atoi returns 0 on error, so this *could* mean the function
+ * failed - but that would be a programmer error, so we'll leave this
+ * in place.
+ */
+ return atoi (response);
+ }
+ else
+ {
+ return ZENITY_ESC;
+ }
+}
+
+GtkWidget *
+zenity_util_add_button (AdwMessageDialog *dialog, const char *button_text,
+ ZenityExitCode response_id)
+{
+ GtkWidget *w = GTK_WIDGET(dialog);
+ g_autofree char *response_str = g_strdup_printf ("%d", response_id);
+
+ adw_message_dialog_add_response (dialog, response_str, button_text);
+
+ return w;
+}
diff --git a/src/util.h b/src/util.h
index fd3d446..5ea703d 100644
--- a/src/util.h
+++ b/src/util.h
@@ -7,7 +7,7 @@
* © 1999, 2000 Red Hat Inc.
* © 1998 James Henstridge
* © 1995-2002 Free Software Foundation
- * © 2021 Logan Rathbone
+ * © 2021-2023 Logan Rathbone
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -33,8 +33,7 @@
* Tom Tromey <tromey@redhat.com>
*/
-#ifndef UTIL_H
-#define UTIL_H
+#pragma once
#include "zenity.h"
#include <gtk/gtk.h>
@@ -43,6 +42,17 @@ G_BEGIN_DECLS
#define ZENITY_IMAGE_FULLPATH(filename) (PACKAGE_DATADIR "/" filename)
+#define ZENITY_UTIL_ADD_EXTRA_LABELS(DIALOG) \
+ for (int i = 0; data->extra_label[i] != NULL; ++i) { \
+ zenity_util_add_button (ADW_MESSAGE_DIALOG (DIALOG), data->extra_label[i], i); \
+ }
+
+#define ZENITY_UTIL_SETUP_OK_BUTTON_LABEL(DIALOG) \
+ adw_message_dialog_set_response_label (ADW_MESSAGE_DIALOG(DIALOG), "ok", data->ok_label);
+
+#define ZENITY_UTIL_SETUP_CANCEL_BUTTON_LABEL(DIALOG) \
+ adw_message_dialog_set_response_label (ADW_MESSAGE_DIALOG(DIALOG), "cancel", data->cancel_label);
+
GIcon *zenity_util_gicon_from_string (const char *str);
GtkBuilder *zenity_util_load_ui_file (const char *widget_root,
...) G_GNUC_NULL_TERMINATED;
@@ -53,11 +63,12 @@ void zenity_util_show_help (GError **error);
int 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);
-gboolean zenity_util_timeout_handle (gpointer data);
+gboolean zenity_util_timeout_handle (AdwMessageDialog *dialog);
char *zenity_util_pango_font_description_to_css (PangoFontDescription *desc);
void zenity_util_gapp_main (GtkWindow *window);
-void zenity_util_gapp_quit (GtkWindow *window);
+void zenity_util_gapp_quit (GtkWindow *window, ZenityData *data);
+ZenityExitCode zenity_util_parse_dialog_response (const char *response);
+GtkWidget *zenity_util_add_button (AdwMessageDialog *dialog, const char
+ *button_text, ZenityExitCode response_id);
G_END_DECLS
-
-#endif /* UTIL_H */
diff --git a/src/zenity.gresource.xml b/src/zenity.gresource.xml.in
index 68efa13..4671d46 100644
--- a/src/zenity.gresource.xml
+++ b/src/zenity.gresource.xml.in
@@ -3,7 +3,7 @@
<!-- vim:ts=4 sw=4
-->
<!--
- Copyright © 2021 Logan Rathbone <poprocks@gmail.com>
+ Copyright © 2021-2023 Logan Rathbone <poprocks@gmail.com>
Zenity is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License as
@@ -22,7 +22,7 @@
-->
<gresources>
- <gresource prefix="/org/gnome/Zenity">
+ <gresource prefix="@resource_base_path@">
<file preprocess="xml-stripblanks" compressed="true">zenity.ui</file>
</gresource>
</gresources>
diff --git a/src/zenity.h b/src/zenity.h
index 0316ce5..20cac9f 100644
--- a/src/zenity.h
+++ b/src/zenity.h
@@ -1,15 +1,26 @@
/* vim: colorcolumn=80 ts=4 sw=4
*/
-#ifndef ZENITY_H
-#define ZENITY_H
+#pragma once
-#include <gtk/gtk.h>
+#include <adwaita.h>
#include <glib/gi18n.h>
+#include "zenity-enums.h" /* auto-generated by build system */
+
#include <config.h>
G_BEGIN_DECLS
+typedef enum
+{
+ ZENITY_OK = -1,
+ ZENITY_CANCEL = -2,
+ ZENITY_ESC = -3,
+ ZENITY_ERROR = -4,
+ ZENITY_EXTRA = -5,
+ ZENITY_TIMEOUT = -6
+} ZenityExitCode;
+
typedef struct {
char *dialog_title;
char *ok_label;
@@ -22,15 +33,6 @@ typedef struct {
gboolean modal;
} ZenityData;
-typedef enum {
- ZENITY_OK,
- ZENITY_CANCEL,
- ZENITY_ESC,
- ZENITY_ERROR,
- ZENITY_EXTRA,
- ZENITY_TIMEOUT
-} ZenityExitCode;
-
typedef struct {
char *dialog_text;
int day;
@@ -188,5 +190,3 @@ void zenity_password_dialog (
ZenityData *data, ZenityPasswordData *password_data);
void zenity_forms_dialog (ZenityData *data, ZenityFormsData *forms_data);
G_END_DECLS
-
-#endif /* ZENITY_H */
diff --git a/src/zenity.ui b/src/zenity.ui
index 03f9684..7fcbb02 100644
--- a/src/zenity.ui
+++ b/src/zenity.ui
@@ -5,748 +5,485 @@
<interface>
<requires lib="gtk" version="4.0"/>
- <object class="GtkAdjustment" id="adjustment1">
+ <object class="AdwMessageDialog" id="zenity_scale_dialog">
+ <property name="title" translatable="yes">Adjust the scale value</property>
+ <property name="default_width">300</property>
+ <property name="default_height">100</property>
+ <property name="extra-child">zenity_scale_box</property>
+ <responses>
+ <response id="cancel" translatable="yes">_Cancel</response>
+ <response id="ok" translatable="yes">_OK</response>
+ </responses>
+ </object>
+ <object class="GtkAdjustment" id="zenity_scale_adjustment">
<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">1</property>
- <property name="can_focus">0</property>
- <property name="title" translatable="yes">Adjust the scale value</property>
- <property name="default_width">300</property>
- <property name="default_height">100</property>
- <child internal-child="content_area">
- <object class="GtkBox" id="dialog-vbox11">
- <property name="can_focus">0</property>
- <child>
- <object class="GtkBox" id="vbox13">
- <property name="can_focus">0</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="zenity_scale_text">
- <property name="valign">center</property>
- <property name="can_focus">0</property>
- <property name="label" translatable="yes">Adjust the scale value</property>
- <property name="xalign">0</property>
- </object>
- </child>
- <child>
- <object class="GtkScale" id="zenity_scale_hscale">
- <property name="hexpand">true</property>
- <property name="draw-value">1</property>
- <property name="adjustment">adjustment1</property>
- <property name="digits">0</property>
- <property name="value_pos">right</property>
- </object>
- </child>
- </object>
- </child>
+ <object class="GtkBox" id="zenity_scale_box">
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="zenity_scale_text">
+ <property name="valign">center</property>
+ <property name="vexpand">true</property>
+ <property name="label" translatable="yes">Adjust the scale value</property>
+ <property name="xalign">0</property>
</object>
</child>
- <action-widgets>
- <action-widget response="-6">zenity_scale_cancel_button</action-widget>
- <action-widget response="-5" default="true">zenity_scale_ok_button</action-widget>
- </action-widgets>
- <child internal-child="action_area">
- <object class="GtkBox" id="dialog-action_area11">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkButton" id="zenity_scale_cancel_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_Cancel</property>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="zenity_scale_ok_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_OK</property>
- </object>
- </child>
+ <child>
+ <object class="GtkScale" id="zenity_scale_hscale">
+ <property name="hexpand">true</property>
+ <property name="draw-value">1</property>
+ <property name="adjustment">zenity_scale_adjustment</property>
+ <property name="digits">0</property>
+ <property name="value_pos">right</property>
</object>
</child>
</object>
- <object class="GtkTextBuffer" id="textbuffer1"/>
- <object class="GtkDialog" id="zenity_text_dialog">
- <property name="can_focus">0</property>
+ <object class="AdwMessageDialog" id="zenity_text_dialog">
<property name="title" translatable="yes">Text View</property>
<property name="default_width">300</property>
<property name="default_height">200</property>
- <child internal-child="content_area">
- <object class="GtkBox" id="dialog-vbox5">
- <property name="can_focus">0</property>
- <property name="spacing">2</property>
+ <property name="extra-child">zenity_text_box</property>
+ <responses>
+ <response id="cancel" translatable="yes">_Cancel</response>
+ <response id="ok" translatable="yes">_OK</response>
+ </responses>
+ </object>
+ <object class="GtkBox" id="zenity_text_box">
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkBox" id="vbox5">
+ <property name="hexpand">1</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkBox" id="vbox5">
- <property name="hexpand">1</property>
- <property name="can_focus">0</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkScrolledWindow" id="zenity_text_scrolled_window">
- <property name="vexpand">1</property>
- <property name="child">
- <object class="GtkTextView" id="zenity_text_view">
- <property name="pixels_above_lines">2</property>
- <property name="pixels_below_lines">2</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>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkCheckButton" id="zenity_text_checkbox">
- <property name="valign">center</property>
- <property name="visible">0</property>
+ <object class="GtkScrolledWindow" id="zenity_text_scrolled_window">
+ <property name="vexpand">1</property>
+ <property name="child">
+ <object class="GtkTextView" id="zenity_text_view">
+ <property name="editable">false</property>
+ <property name="wrap_mode">word</property>
</object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="-6">zenity_text_cancel_button</action-widget>
- <action-widget response="-7" default="true">zenity_text_close_button</action-widget>
- </action-widgets>
- <child internal-child="action_area">
- <object class="GtkBox" id="dialog-action_area5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkButton" id="zenity_text_cancel_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_Cancel</property>
+ </property>
</object>
</child>
<child>
- <object class="GtkButton" id="zenity_text_close_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_OK</property>
+ <object class="GtkCheckButton" id="zenity_text_checkbox">
+ <property name="valign">center</property>
+ <property name="visible">0</property>
</object>
</child>
</object>
</child>
</object>
- <object class="GtkDialog" id="zenity_calendar_dialog">
- <property name="can_focus">0</property>
+ <object class="AdwMessageDialog" id="zenity_calendar_dialog">
<property name="title" translatable="yes">Calendar selection</property>
- <child internal-child="content_area">
- <object class="GtkBox" id="dialog-vbox2">
- <property name="can_focus">0</property>
- <property name="spacing">2</property>
+ <property name="extra-child">zenity_calendar_box</property>
+ <responses>
+ <response id="cancel" translatable="yes">_Cancel</response>
+ <response id="ok" translatable="yes">_OK</response>
+ </responses>
+ </object>
+ <object class="GtkBox" id="zenity_calendar_box">
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkBox" id="vbox1">
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkBox" id="vbox1">
- <property name="can_focus">0</property>
- <property name="orientation">vertical</property>
+ <object class="GtkBox" id="vbox2">
+ <property name="vexpand">1</property>
<property name="spacing">6</property>
<child>
- <object class="GtkBox" id="vbox2">
- <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="halign">center</property>
- <property name="can_focus">0</property>
- <property name="label" translatable="yes">Select a date from below.</property>
- <property name="wrap">1</property>
- <property name="xalign">0</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="zenity_calendar_label">
- <property name="valign">center</property>
- <property name="can_focus">0</property>
- <property name="label" translatable="yes">C_alendar:</property>
- <property name="use_underline">1</property>
- <property name="mnemonic_widget">zenity_calendar</property>
+ <object class="GtkLabel" id="zenity_calendar_text">
+ <property name="halign">center</property>
+ <property name="label" translatable="yes">Select a date from below.</property>
+ <property name="wrap">1</property>
<property name="xalign">0</property>
- <accessibility>
- <property name="label" translatable="yes">Calendar</property>
- <relation name="labelled-by">zenity_calendar</relation>
- </accessibility>
- </object>
- </child>
- <child>
- <object class="GtkCalendar" id="zenity_calendar">
- <property name="valign">center</property>
</object>
</child>
</object>
</child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="-6">zenity_calendar_cancel_button</action-widget>
- <action-widget response="-5" default="true">zenity_calendar_ok_button</action-widget>
- </action-widgets>
- <child internal-child="action_area">
- <object class="GtkBox" id="dialog-action_area2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<child>
- <object class="GtkButton" id="zenity_calendar_cancel_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_Cancel</property>
+ <object class="GtkLabel" id="zenity_calendar_label">
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">C_alendar:</property>
+ <property name="use_underline">1</property>
+ <property name="mnemonic_widget">zenity_calendar</property>
+ <property name="xalign">0</property>
+ <accessibility>
+ <property name="label" translatable="yes">Calendar</property>
+ <relation name="labelled-by">zenity_calendar</relation>
+ </accessibility>
</object>
</child>
<child>
- <object class="GtkButton" id="zenity_calendar_ok_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_OK</property>
+ <object class="GtkCalendar" id="zenity_calendar">
+ <property name="valign">center</property>
+ <property name="vexpand">true</property>
</object>
</child>
</object>
</child>
</object>
- <object class="GtkDialog" id="zenity_entry_dialog">
- <property name="can_focus">0</property>
+ <object class="AdwMessageDialog" id="zenity_entry_dialog">
<property name="title" translatable="yes">Add a new entry</property>
- <child internal-child="content_area">
- <object class="GtkBox" id="dialog-vbox4">
- <property name="can_focus">0</property>
- <property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-bottom">12</property>
- <property name="margin-top">12</property>
- <child>
- <object class="GtkBox" id="vbox3">
- <property name="can_focus">0</property>
+ <property name="extra-child">zenity_entry_box</property>
+ <responses>
+ <response id="cancel" translatable="yes">_Cancel</response>
+ <response id="ok" translatable="yes">_OK</response>
+ </responses>
+ </object>
+ <object class="GtkBox" id="zenity_entry_box">
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-bottom">12</property>
+ <property name="margin-top">12</property>
+ <child>
+ <object class="GtkBox" id="vbox3">
+ <child>
+ <object class="GtkBox" id="vbox4">
+ <property name="hexpand">1</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkBox" id="vbox4">
- <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="valign">center</property>
- <property name="can_focus">0</property>
- <property name="label" translatable="yes">_Enter new text:</property>
- <property name="use_underline">1</property>
- <property name="xalign">0</property>
- </object>
- </child>
- <child>
- <placeholder/>
- </child>
+ <object class="GtkLabel" id="zenity_entry_text">
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">_Enter new text:</property>
+ <property name="use_underline">1</property>
+ <property name="xalign">0</property>
</object>
</child>
- </object>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="-6">zenity_entry_cancel_button</action-widget>
- <action-widget response="-5" default="true">zenity_entry_ok_button</action-widget>
- </action-widgets>
- <child internal-child="action_area">
- <object class="GtkBox" id="dialog-action_area4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkButton" id="zenity_entry_cancel_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_Cancel</property>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="zenity_entry_ok_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_OK</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- <object class="GtkDialog" id="zenity_error_dialog">
- <property name="can_focus">0</property>
- <property name="title" translatable="yes">Error</property>
- <child internal-child="content_area">
- <object class="GtkBox" id="dialog-vbox7">
- <property name="can_focus">0</property>
- <property name="spacing">14</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-bottom">12</property>
- <property name="margin-top">12</property>
- <child>
- <object class="GtkBox" id="vbox8">
- <property name="can_focus">0</property>
<child>
- <object class="GtkBox" id="hbox3">
- <property name="hexpand">1</property>
- <property name="can_focus">0</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkImage" id="zenity_error_image">
- <property name="halign">center</property>
- <property name="can_focus">0</property>
- <property name="icon_name">dialog-error</property>
- <property name="icon_size">large</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="zenity_error_text">
- <property name="halign">center</property>
- <property name="label" translatable="yes">An error has occurred.</property>
- <property name="wrap">1</property>
- <property name="selectable">1</property>
- <property name="yalign">0</property>
- </object>
- </child>
- </object>
+ <placeholder/>
</child>
</object>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="-5" default="true">zenity_error_ok_button</action-widget>
- </action-widgets>
- <child internal-child="action_area">
- <object class="GtkBox" id="dialog-action_area7">
- <property name="can_focus">False</property>
- <child>
- <object class="GtkButton" id="zenity_error_ok_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_OK</property>
- </object>
- </child>
- </object>
- </child>
</object>
- <object class="GtkDialog" id="zenity_forms_dialog">
- <property name="can_focus">0</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="can_focus">0</property>
- <property name="child">
- <object class="GtkGrid" id="zenity_forms_grid">
- <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>
- <property name="column_spacing">10</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- </property>
- <child type="label">
- <object class="GtkLabel" id="zenity_forms_text">
- <property name="can_focus">0</property>
- <property name="label" translatable="yes">Forms dialog</property>
- <attributes>
- <attribute name="weight" value="bold"></attribute>
- </attributes>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="-6">zenity_forms_cancel_button</action-widget>
- <action-widget response="-5" default="true">zenity_forms_ok_button</action-widget>
- </action-widgets>
- <child internal-child="action_area">
- <object class="GtkBox" id="dialog-action_area12">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkButton" id="zenity_forms_cancel_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_Cancel</property>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="zenity_forms_ok_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_OK</property>
- </object>
- </child>
- </object>
- </child>
+ <object class="AdwMessageDialog" id="zenity_error_dialog">
+ <property name="title" translatable="yes">Error</property>
+ <property name="extra-child">zenity_error_box</property>
+ <responses>
+ <response id="ok" translatable="yes">_OK</response>
+ </responses>
</object>
- <object class="GtkDialog" id="zenity_info_dialog">
- <property name="can_focus">0</property>
- <property name="title" translatable="yes">Information</property>
- <child internal-child="content_area">
- <object class="GtkBox" id="dialog-vbox9">
- <property name="can_focus">0</property>
- <property name="spacing">14</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-bottom">12</property>
- <property name="margin-top">12</property>
-
- <child>
- <object class="GtkBox" id="hbox4">
- <property name="can_focus">0</property>
+ <object class="GtkBox" id="zenity_error_box">
+ <property name="spacing">14</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-bottom">12</property>
+ <property name="margin-top">12</property>
+ <child>
+ <object class="GtkBox" id="vbox8">
+ <child>
+ <object class="GtkBox" id="hbox3">
+ <property name="hexpand">1</property>
<property name="spacing">12</property>
<child>
- <object class="GtkImage" id="zenity_info_image">
+ <object class="GtkImage" id="zenity_error_image">
<property name="halign">center</property>
- <property name="can_focus">0</property>
- <property name="icon_name">dialog-information</property>
+ <property name="icon_name">dialog-error</property>
<property name="icon_size">large</property>
</object>
</child>
<child>
- <object class="GtkLabel" id="zenity_info_text">
+ <object class="GtkLabel" id="zenity_error_text">
<property name="halign">center</property>
- <property name="label" translatable="yes">All updates are complete.</property>
- <property name="wrap">1</property>
- <property name="selectable">1</property>
- <property name="yalign">0</property>
+ <property name="label" translatable="yes">An error has occurred.</property>
+ <property name="wrap">true</property>
+ <property name="selectable">true</property>
+ <property name="can-focus">false</property>
</object>
</child>
</object>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="-5" default="true">zenity_info_ok_button</action-widget>
- </action-widgets>
- <child internal-child="action_area">
- <object class="GtkBox" id="dialog-action_area3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkButton" id="zenity_info_ok_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_OK</property>
- </object>
- </child>
- </object>
- </child>
</object>
- <object class="GtkDialog" id="zenity_progress_dialog">
- <property name="can_focus">0</property>
- <property name="title" translatable="yes">Progress</property>
- <child internal-child="content_area">
- <object class="GtkBox" id="dialog-vbox6">
- <property name="can_focus">0</property>
- <property name="spacing">2</property>
- <child>
- <object class="GtkBox" id="vbox7">
- <property name="halign">center</property>
- <property name="can_focus">0</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <object class="AdwMessageDialog" id="zenity_forms_dialog">
+ <property name="extra-child">zenity_forms_box</property>
+ <responses>
+ <response id="cancel" translatable="yes">_Cancel</response>
+ <response id="ok" translatable="yes">_OK</response>
+ </responses>
+ </object>
+ <object class="GtkBox" id="zenity_forms_box">
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="child">
+ <object class="GtkGrid" id="zenity_forms_grid">
+ <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>
+ <property name="column_spacing">10</property>
<child>
- <object class="GtkLabel" id="zenity_progress_text">
- <property name="valign">center</property>
- <property name="can_focus">0</property>
- <property name="label" translatable="yes">Running...</property>
- <property name="wrap">1</property>
- <property name="xalign">0</property>
- </object>
+ <placeholder/>
</child>
<child>
- <object class="GtkProgressBar" id="zenity_progress_bar">
- <property name="valign">center</property>
- <property name="can_focus">0</property>
- <property name="pulse_step">0.10000000149</property>
- </object>
+ <placeholder/>
</child>
<child>
- <object class="GtkLabel" id="zenity_progress_time">
- <property name="valign">center</property>
- <property name="can_focus">0</property>
- <property name="xalign">0</property>
- </object>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
</child>
</object>
+ </property>
+ <child type="label">
+ <object class="GtkLabel" id="zenity_forms_text">
+ <property name="label" translatable="yes">Forms dialog</property>
+ <attributes>
+ <attribute name="weight" value="bold"></attribute>
+ </attributes>
+ </object>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="-6">zenity_progress_cancel_button</action-widget>
- <action-widget response="-5" default="true">zenity_progress_ok_button</action-widget>
- </action-widgets>
- <child internal-child="action_area">
- <object class="GtkBox" id="dialog-action_area6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkButton" id="zenity_progress_cancel_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_Cancel</property>
+ </object>
+ <object class="AdwMessageDialog" id="zenity_info_dialog">
+ <property name="title" translatable="yes">Information</property>
+ <property name="extra-child">zenity_info_box</property>
+ <responses>
+ <response id="ok" translatable="yes">_OK</response>
+ </responses>
+ </object>
+ <object class="GtkBox" id="zenity_info_box">
+ <property name="spacing">14</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-bottom">12</property>
+ <property name="margin-top">12</property>
+ <child>
+ <object class="GtkBox" id="hbox4">
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkImage" id="zenity_info_image">
+ <property name="halign">center</property>
+ <property name="icon_name">dialog-information</property>
+ <property name="icon_size">large</property>
</object>
</child>
<child>
- <object class="GtkButton" id="zenity_progress_ok_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_OK</property>
- <property name="sensitive">0</property>
+ <object class="GtkLabel" id="zenity_info_text">
+ <property name="halign">center</property>
+ <property name="vexpand">true</property>
+ <property name="label" translatable="yes">All updates are complete.</property>
+ <property name="wrap">true</property>
+ <property name="selectable">true</property>
+ <property name="can-focus">false</property>
</object>
</child>
</object>
</child>
</object>
- <object class="GtkDialog" id="zenity_question_dialog">
- <property name="can_focus">0</property>
- <property name="title" translatable="yes">Question</property>
- <child internal-child="content_area">
- <object class="GtkBox" id="dialog-vbox3">
- <property name="can_focus">0</property>
- <property name="spacing">14</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-bottom">12</property>
- <property name="margin-top">12</property>
+ <object class="AdwMessageDialog" id="zenity_progress_dialog">
+ <property name="title" translatable="yes">Progress</property>
+ <property name="extra-child">zenity_progress_box</property>
+ </object>
+ <object class="GtkBox" id="zenity_progress_box">
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkBox" id="vbox7">
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkBox" id="hbox1">
- <property name="can_focus">0</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkImage" id="zenity_question_image">
- <property name="can_focus">0</property>
- <property name="icon_name">dialog-question</property>
- <property name="icon_size">large</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="zenity_question_text">
- <property name="halign">center</property>
- <property name="label" translatable="yes">Are you sure you want to proceed?</property>
- <property name="wrap">1</property>
- <property name="selectable">1</property>
- <property name="yalign">0</property>
- </object>
- </child>
+ <object class="GtkLabel" id="zenity_progress_text">
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">Running...</property>
+ <property name="wrap">1</property>
+ <property name="xalign">0</property>
</object>
</child>
- </object>
-
- </child>
- <child internal-child="action_area">
- <object class="GtkBox" id="zenity_question_button_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- </child>
- </object>
- <object class="GtkDialog" id="zenity_tree_dialog">
- <property name="can_focus">0</property>
- <property name="title" translatable="yes">Select items from the list</property>
- <property name="default_width">300</property>
- <property name="default_height">196</property>
- <child internal-child="content_area">
- <object class="GtkBox" id="dialog-vbox8">
- <property name="can_focus">0</property>
<child>
- <object class="GtkBox" id="vbox10">
- <property name="can_focus">0</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="zenity_tree_text">
- <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>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="zenity_tree_window">
- <property name="hexpand">1</property>
- <property name="vexpand">1</property>
- <property name="child">
- <object class="GtkTreeView" id="zenity_tree_view">
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview-selection1"/>
- </child>
- </object>
- </property>
- </object>
- </child>
+ <object class="GtkProgressBar" id="zenity_progress_bar">
+ <property name="valign">center</property>
+ <property name="hexpand">true</property>
+ <property name="pulse_step">0.10000000149</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="zenity_progress_time">
+ <property name="valign">center</property>
+ <property name="xalign">0</property>
</object>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="-6">zenity_tree_cancel_button</action-widget>
- <action-widget response="-5" default="true">zenity_tree_ok_button</action-widget>
- </action-widgets>
- <child internal-child="action_area">
- <object class="GtkBox" id="dialog-action_area8">
- <property name="can_focus">False</property>
+ </object>
+ <object class="AdwMessageDialog" id="zenity_question_dialog">
+ <property name="title" translatable="yes">Question</property>
+ <property name="extra-child">zenity_question_box</property>
+ <responses>
+ <response id="no" translatable="yes">_No</response>
+ <response id="yes" translatable="yes">_Yes</response>
+ </responses>
+ </object>
+ <object class="GtkBox" id="zenity_question_box">
+ <property name="spacing">14</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-bottom">12</property>
+ <property name="margin-top">12</property>
+ <child>
+ <object class="GtkBox" id="hbox1">
+ <property name="spacing">12</property>
<child>
- <object class="GtkButton" id="zenity_tree_cancel_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_Cancel</property>
+ <object class="GtkImage" id="zenity_question_image">
+ <property name="icon_name">dialog-question</property>
+ <property name="icon_size">large</property>
</object>
</child>
<child>
- <object class="GtkButton" id="zenity_tree_ok_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_OK</property>
+ <object class="GtkLabel" id="zenity_question_text">
+ <property name="halign">center</property>
+ <property name="vexpand">true</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="can-focus">false</property>
</object>
</child>
</object>
</child>
</object>
- <object class="GtkDialog" id="zenity_warning_dialog">
- <property name="can_focus">0</property>
- <property name="title" translatable="yes">Warning</property>
- <property name="resizable">false</property>
-
- <child internal-child="content_area">
- <object class="GtkBox" id="dialog-vbox1">
- <property name="can_focus">0</property>
- <property name="spacing">14</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-bottom">12</property>
- <property name="margin-top">12</property>
+ <object class="AdwMessageDialog" id="zenity_tree_dialog">
+ <property name="title" translatable="yes">Select items from the list</property>
+ <property name="default_width">300</property>
+ <property name="default_height">196</property>
+ <property name="extra-child">zenity_tree_box</property>
+ <property name="resizable">true</property>
+ <responses>
+ <response id="cancel" translatable="yes">_Cancel</response>
+ <response id="ok" translatable="yes">_OK</response>
+ </responses>
+ </object>
+ <object class="GtkBox" id="zenity_tree_box">
+ <child>
+ <object class="GtkBox" id="vbox10">
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkBox" id="hbox2">
- <property name="can_focus">0</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkImage" id="zenity_warning_image">
- <property name="can_focus">0</property>
- <property name="icon_name">dialog-warning</property>
- <property name="icon_size">large</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="zenity_warning_text">
- <property name="halign">center</property>
- <property name="vexpand">true</property>
- <property name="hexpand">true</property>
- <property name="label" translatable="yes">Are you sure you want to proceed?</property>
- <property name="wrap">1</property>
- <property name="selectable">1</property>
- </object>
- </child>
+ <object class="GtkLabel" id="zenity_tree_text">
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">Select items from the list below.</property>
+ <property name="xalign">0</property>
</object>
</child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="-5" default="true">zenity_warning_ok_button</action-widget>
- </action-widgets>
- <child internal-child="action_area">
- <object class="GtkBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<child>
- <object class="GtkButton" id="zenity_warning_ok_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_OK</property>
+ <object class="GtkScrolledWindow" id="zenity_tree_window">
+ <property name="hexpand">1</property>
+ <property name="vexpand">1</property>
+ <property name="child">
+ <object class="GtkTreeView" id="zenity_tree_view">
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection1"/>
+ </child>
+ </object>
+ </property>
</object>
</child>
</object>
</child>
</object>
-
-
-
-
-
-
-
- <object class="GtkDialog" id="zenity_password_dialog">
+ <object class="AdwMessageDialog" id="zenity_warning_dialog">
<property name="title" translatable="yes">Warning</property>
<property name="resizable">false</property>
-
- <child internal-child="content_area">
- <object class="GtkBox"> <!-- vbox -->
- <property name="orientation">vertical</property>
- <property name="spacing">14</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-bottom">12</property>
- <property name="margin-top">12</property>
+ <property name="extra-child">zenity_warning_box</property>
+ <responses>
+ <response id="ok" translatable="yes">_OK</response>
+ </responses>
+ </object>
+ <object class="GtkBox" id="zenity_warning_box">
+ <property name="spacing">14</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-bottom">12</property>
+ <property name="margin-top">12</property>
+ <child>
+ <object class="GtkBox" id="hbox2">
+ <property name="spacing">12</property>
<child>
- <object class="GtkBox">
- <property name="orientation">horizontal</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkImage" id="zenity_password_image">
- <property name="icon_name">dialog-password</property>
- <property name="icon_size">large</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="zenity_password_title">
- <property name="label" translatable="yes">Type your password</property>
- </object>
- </child>
+ <object class="GtkImage" id="zenity_warning_image">
+ <property name="icon_name">dialog-warning</property>
+ <property name="icon_size">large</property>
</object>
</child>
<child>
- <object class="GtkGrid" id="zenity_password_grid">
- <property name="column-spacing">12</property>
- <property name="row-spacing">6</property>
+ <object class="GtkLabel" id="zenity_warning_text">
+ <property name="halign">center</property>
+ <property name="vexpand">true</property>
+ <property name="hexpand">true</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="can-focus">false</property>
</object>
</child>
- </object> <!-- !vbox -->
+ </object>
</child>
- <action-widgets>
- <action-widget response="ok" default="true">zenity_password_ok_button</action-widget>
- <action-widget response="cancel">zenity_password_cancel_button</action-widget>
- </action-widgets>
- <child internal-child="action_area">
+ </object>
+ <object class="AdwMessageDialog" id="zenity_password_dialog">
+ <property name="title" translatable="yes">Warning</property>
+ <property name="resizable">false</property>
+ <property name="extra-child">zenity_password_box</property>
+ <responses>
+ <response id="cancel" translatable="yes">_Cancel</response>
+ <response id="ok" translatable="yes">_OK</response>
+ </responses>
+ </object>
+ <object class="GtkBox" id="zenity_password_box">
+ <property name="orientation">vertical</property>
+ <property name="spacing">14</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-bottom">12</property>
+ <property name="margin-top">12</property>
+ <child>
<object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="orientation">horizontal</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkButton" id="zenity_password_ok_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_OK</property>
+ <object class="GtkImage" id="zenity_password_image">
+ <property name="icon_name">dialog-password</property>
+ <property name="icon_size">large</property>
</object>
</child>
<child>
- <object class="GtkButton" id="zenity_password_cancel_button">
- <property name="use-underline">true</property>
- <property name="label" translatable="yes">_Cancel</property>
+ <object class="GtkLabel" id="zenity_password_title">
+ <property name="label" translatable="yes">Type your password</property>
</object>
</child>
</object>
</child>
- </object>
+ <child>
+ <object class="GtkGrid" id="zenity_password_grid">
+ <property name="column-spacing">12</property>
+ <property name="row-spacing">6</property>
+ </object>
+ </child>
+ </object> <!-- !vbox -->
</interface>