diff options
author | Chris Toshok <toshok@ximian.com> | 2002-11-17 16:00:40 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2002-11-17 16:00:40 +0800 |
commit | 0e8f42c13689dcdd9c5b9c385a0b62c9112b22b8 (patch) | |
tree | 75a7ecec1b94570f152aff5bbdd753ff1ddfc8b9 /widgets/misc/e-gui-utils.c | |
parent | 1a61aa98b3ab76b5cb3b00a44f53265fc51b00c7 (diff) | |
download | gsoc2013-evolution-0e8f42c13689dcdd9c5b9c385a0b62c9112b22b8.tar gsoc2013-evolution-0e8f42c13689dcdd9c5b9c385a0b62c9112b22b8.tar.gz gsoc2013-evolution-0e8f42c13689dcdd9c5b9c385a0b62c9112b22b8.tar.bz2 gsoc2013-evolution-0e8f42c13689dcdd9c5b9c385a0b62c9112b22b8.tar.lz gsoc2013-evolution-0e8f42c13689dcdd9c5b9c385a0b62c9112b22b8.tar.xz gsoc2013-evolution-0e8f42c13689dcdd9c5b9c385a0b62c9112b22b8.tar.zst gsoc2013-evolution-0e8f42c13689dcdd9c5b9c385a0b62c9112b22b8.zip |
convert this to wrap around GtkMessageDialog.
2002-11-16 Chris Toshok <toshok@ximian.com>
* 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
Diffstat (limited to 'widgets/misc/e-gui-utils.c')
-rw-r--r-- | widgets/misc/e-gui-utils.c | 30 |
1 files changed, 24 insertions, 6 deletions
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 <gtk/gtkentry.h> #include <gtk/gtksignal.h> -#include <libgnomeui/gnome-messagebox.h> +#include <gtk/gtkmessagedialog.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <libgnomecanvas/gnome-canvas-pixbuf.h> +/* 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 |