aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-05-29 17:06:00 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-05-29 17:06:00 +0800
commit68f2584f730bb1b112a063b1483edbcde6ebb833 (patch)
treef300bc4b935ca2c0f97499c4a3cf871e04384761
parent0701e570aaf7fe4a4148c623200f1edca28c8220 (diff)
downloadgsoc2013-evolution-68f2584f730bb1b112a063b1483edbcde6ebb833.tar
gsoc2013-evolution-68f2584f730bb1b112a063b1483edbcde6ebb833.tar.gz
gsoc2013-evolution-68f2584f730bb1b112a063b1483edbcde6ebb833.tar.bz2
gsoc2013-evolution-68f2584f730bb1b112a063b1483edbcde6ebb833.tar.lz
gsoc2013-evolution-68f2584f730bb1b112a063b1483edbcde6ebb833.tar.xz
gsoc2013-evolution-68f2584f730bb1b112a063b1483edbcde6ebb833.tar.zst
gsoc2013-evolution-68f2584f730bb1b112a063b1483edbcde6ebb833.zip
Fixes #43455
2003-05-28 Rodrigo Moya <rodrigo@ximian.com> Fixes #43455 * gui/tasks-control.c (confirm_expunge): converted to a GtkMessageDialog and removed object weak's ref code, not needed anymore. svn path=/trunk/; revision=21344
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/tasks-control.c43
2 files changed, 21 insertions, 29 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 479309260e..d8db94bef4 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+2003-05-28 Rodrigo Moya <rodrigo@ximian.com>
+
+ Fixes #43455
+
+ * gui/tasks-control.c (confirm_expunge): converted to a GtkMessageDialog
+ and removed object weak's ref code, not needed anymore.
+
2003-05-20 JP Rosevear <jpr@ximian.com>
Fixes #43308
diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c
index 010fdce485..847e5a689b 100644
--- a/calendar/gui/tasks-control.c
+++ b/calendar/gui/tasks-control.c
@@ -25,6 +25,7 @@
#include <gtk/gtksignal.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkcheckbutton.h>
+#include <gtk/gtkmessagedialog.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include <libgnomeui/gnome-dialog.h>
@@ -445,12 +446,6 @@ tasks_control_complete_cmd (BonoboUIComponent *uic,
e_tasks_complete_selected (tasks);
}
-static void
-parent_destroyed (GnomeDialog *dialog, GObject *deadbeef)
-{
- gnome_dialog_close (GNOME_DIALOG (dialog));
-}
-
static gboolean
confirm_expunge (ETasks *tasks)
{
@@ -459,36 +454,26 @@ confirm_expunge (ETasks *tasks)
if (!calendar_config_get_confirm_expunge ())
return TRUE;
-
- dialog = gnome_dialog_new (_("Warning"),
- GNOME_STOCK_BUTTON_YES,
- GNOME_STOCK_BUTTON_NO,
- NULL);
parent = gtk_widget_get_toplevel (GTK_WIDGET (tasks));
- gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (parent));
- g_object_weak_ref ((GObject *) parent, (GWeakNotify) parent_destroyed, dialog);
-
- label = gtk_label_new (_("This operation will permanently erase all tasks marked as completed. If you continue, you will not be able to recover these tasks.\n\nReally erase these tasks?"));
-
- gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, TRUE, TRUE, 6);
-
+ dialog = gtk_message_dialog_new (
+ parent,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_YES_NO,
+ _("This operation will permanently erase all tasks marked as completed. If you continue, you will not be able to recover these tasks.\n\nReally erase these tasks?"));
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_NO);
+
checkbox = gtk_check_button_new_with_label (_("Do not ask me again."));
gtk_widget_show (checkbox);
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), checkbox, TRUE, TRUE, 6);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), checkbox, TRUE, TRUE, 6);
- button = gnome_dialog_run (GNOME_DIALOG (dialog));
- if (button == 0 && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)))
+ button = gtk_dialog_run (GTK_DIALOG (dialog));
+ if (button == GTK_RESPONSE_YES && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)))
calendar_config_set_confirm_expunge (FALSE);
- gnome_dialog_close (GNOME_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
- if (button == 0)
- return TRUE;
- else
- return FALSE;
+ return button == GTK_RESPONSE_YES ? TRUE : FALSE;
}
static void