From 178c7af85fac11d8ae0c4bf5c4ae2396731396e9 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Wed, 2 Jan 2002 19:11:03 +0000 Subject: remove e_gnome_dialog util functions and use e-util ones instead 2002-01-02 JP Rosevear * mail-callbacks.c: remove e_gnome_dialog util functions and use e-util ones instead 2002-01-02 JP Rosevear * e-dialog-utils.c (e_gnome_dialog_set_parent): util function moved from mail-callbacks, also destroys the dialog if the parent is destroyed (e_gnome_warning_dialog_parented): similarly (e_gnome_ok_cancel_dialog_parented): ditto * e-dialog-utils.h: new protos svn path=/trunk/; revision=15225 --- e-util/ChangeLog | 10 ++++++++++ e-util/e-dialog-utils.c | 42 ++++++++++++++++++++++++++++++++++++++++++ e-util/e-dialog-utils.h | 18 ++++++++++++++---- mail/ChangeLog | 5 +++++ mail/mail-callbacks.c | 45 +-------------------------------------------- 5 files changed, 72 insertions(+), 48 deletions(-) diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 178ec7aa8b..2bcb5f8820 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,13 @@ +2002-01-02 JP Rosevear + + * e-dialog-utils.c (e_gnome_dialog_set_parent): util function + moved from mail-callbacks, also destroys the dialog if the parent + is destroyed + (e_gnome_warning_dialog_parented): similarly + (e_gnome_ok_cancel_dialog_parented): ditto + + * e-dialog-utils.h: new protos + 2001-12-17 JP Rosevear * e-pilot-map.c (e_pilot_map_clear): clear all info from the map 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 +#include + #include #include @@ -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; +} diff --git a/e-util/e-dialog-utils.h b/e-util/e-dialog-utils.h index a00ab75d21..1e1b8af22f 100644 --- a/e-util/e-dialog-utils.h +++ b/e-util/e-dialog-utils.h @@ -25,12 +25,22 @@ #include #include +#include +#include #include /* Window */ -void e_set_dialog_parent (GtkWindow *dialog, - GtkWidget *parent_widget); -void e_set_dialog_parent_from_xid (GtkWindow *dialog, - Window xid); +void e_set_dialog_parent (GtkWindow *dialog, + GtkWidget *parent_widget); +void e_set_dialog_parent_from_xid (GtkWindow *dialog, + Window xid); +void e_gnome_dialog_set_parent (GnomeDialog *dialog, + GtkWindow *parent); +GtkWidget *e_gnome_warning_dialog_parented (const char *warning, + GtkWindow *parent); +GtkWidget *e_gnome_ok_cancel_dialog_parented (const char *message, + GnomeReplyCallback callback, + gpointer data, + GtkWindow *parent); #endif diff --git a/mail/ChangeLog b/mail/ChangeLog index 7a01be6d11..14cb4b9667 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2002-01-02 JP Rosevear + + * mail-callbacks.c: remove e_gnome_dialog util functions and use + e-util ones instead + 2001-12-21 Jeffrey Stedfast The idea here is that if we consistantly name the movemail file diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 1c6a40609f..f08c40f9d4 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -31,8 +31,6 @@ #include #include #include -#include -#include #include #include #include @@ -42,6 +40,7 @@ #include #include #include +#include #include #include "mail.h" #include "message-browser.h" @@ -73,48 +72,6 @@ #define FB_WINDOW(fb) GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (fb), GTK_TYPE_WINDOW)) -/* These e_gnome_dialog* functions are to handle the brokenness that is gnome-dialog */ -static void -e_gnome_dialog_parent_destroyed (GtkWidget *parent, GtkWidget *dialog) -{ - gnome_dialog_close (GNOME_DIALOG (dialog)); -} - -static 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)); -} - -static 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; -} - -static 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; -} - - struct post_send_data { CamelFolder *folder; gchar *uid; -- cgit v1.2.3