aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-gui-utils.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-11-17 16:00:40 +0800
committerChris Toshok <toshok@src.gnome.org>2002-11-17 16:00:40 +0800
commit0e8f42c13689dcdd9c5b9c385a0b62c9112b22b8 (patch)
tree75a7ecec1b94570f152aff5bbdd753ff1ddfc8b9 /widgets/misc/e-gui-utils.c
parent1a61aa98b3ab76b5cb3b00a44f53265fc51b00c7 (diff)
downloadgsoc2013-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.c30
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