aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-dialog-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-dialog-utils.c')
-rw-r--r--e-util/e-dialog-utils.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/e-util/e-dialog-utils.c b/e-util/e-dialog-utils.c
index 45a57d42fc..f155b83145 100644
--- a/e-util/e-dialog-utils.c
+++ b/e-util/e-dialog-utils.c
@@ -32,6 +32,8 @@
#include <gtk/gtksignal.h>
+#include <libgnomeui/gnome-dialog-util.h>
+
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-property-bag.h>
@@ -162,3 +164,43 @@ e_set_dialog_parent_from_xid (GtkWindow *dialog,
set_transient_for_gdk (dialog, gdk_window_foreign_new (xid));
}
+
+static void
+e_gnome_dialog_parent_destroyed (GtkWidget *parent, GtkWidget *dialog)
+{
+ gnome_dialog_close (GNOME_DIALOG (dialog));
+}
+
+void
+e_gnome_dialog_set_parent (GnomeDialog *dialog, GtkWindow *parent)
+{
+ gnome_dialog_set_parent (dialog, parent);
+ gtk_signal_connect_while_alive (GTK_OBJECT (parent), "destroy",
+ e_gnome_dialog_parent_destroyed,
+ dialog, GTK_OBJECT (dialog));
+}
+
+GtkWidget *
+e_gnome_warning_dialog_parented (const char *warning, GtkWindow *parent)
+{
+ GtkWidget *dialog;
+
+ dialog = gnome_warning_dialog_parented (warning, parent);
+ gtk_signal_connect (GTK_OBJECT (parent), "destroy",
+ e_gnome_dialog_parent_destroyed, dialog);
+
+ return dialog;
+}
+
+GtkWidget *
+e_gnome_ok_cancel_dialog_parented (const char *message, GnomeReplyCallback callback,
+ gpointer data, GtkWindow *parent)
+{
+ GtkWidget *dialog;
+
+ dialog = gnome_ok_cancel_dialog_parented (message, callback, data, parent);
+ gtk_signal_connect (GTK_OBJECT (parent), "destroy",
+ e_gnome_dialog_parent_destroyed, dialog);
+
+ return dialog;
+}