From 0e8f42c13689dcdd9c5b9c385a0b62c9112b22b8 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sun, 17 Nov 2002 08:00:40 +0000 Subject: convert this to wrap around GtkMessageDialog. 2002-11-16 Chris Toshok * gal/widgets/e-gui-utils.c (e_notice): convert this to wrap around GtkMessageDialog. * gal/widgets/e-categories-master-list-dialog.c (dialog_response): gnome_dialog_close -> gtk_widget_destroy. svn path=/trunk/; revision=18814 --- widgets/misc/e-gui-utils.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-gui-utils.c b/widgets/misc/e-gui-utils.c index 9c66c70f1e..44b7223869 100644 --- a/widgets/misc/e-gui-utils.c +++ b/widgets/misc/e-gui-utils.c @@ -27,27 +27,45 @@ #include #include -#include +#include #include #include +/* should probably just deprecate/remove this and have callers change + to using gtk_message_dialog_new */ void e_notice (GtkWindow *window, const char *type, const char *format, ...) { + GtkMessageType gtk_type; + GtkWidget *dialog; va_list args; char *str; + if (!strcmp (type, GNOME_MESSAGE_BOX_INFO) + || !strcmp (type, GNOME_MESSAGE_BOX_GENERIC)) + gtk_type = GTK_MESSAGE_INFO; + else if (!strcmp (type, GNOME_MESSAGE_BOX_WARNING)) + gtk_type = GTK_MESSAGE_WARNING; + else if (!strcmp (type, GNOME_MESSAGE_BOX_ERROR)) + gtk_type = GTK_MESSAGE_ERROR; + else if (!strcmp (type, GNOME_MESSAGE_BOX_QUESTION)) + gtk_type = GTK_MESSAGE_QUESTION; + else { + g_warning ("invalid dialog type '%s'", type); + gtk_type = GTK_MESSAGE_INFO; + } + va_start (args, format); str = g_strdup_vprintf (format, args); - dialog = gnome_message_box_new (str, type, GTK_STOCK_OK, NULL); + dialog = gtk_message_dialog_new (window, 0, gtk_type, + GTK_BUTTONS_OK, + str, + NULL); va_end (args); g_free (str); - if (window) - gnome_dialog_set_parent (GNOME_DIALOG (dialog), window); - - gnome_dialog_run (GNOME_DIALOG (dialog)); + gtk_dialog_run (GTK_DIALOG (dialog)); } static void -- cgit