[evolution-patches] calendar patch for 42046



So, this patch HIG-ifies the "Do you want to save changes?" dialog which
is associated with tasks and appointments. Basically, it replaces the
(deprecated, ugly) gnome_message_box with a gtk_mesage_dialog. It fixes
bug #42046.

I am not sure if you guys will want me to apply this or not, though,
because: 

* It breaks string freeze-- though I suppose I could change the text so
it doesn't. 
* It involves a fair amount of AnnaHacking, which is hardly my forte.
(though really, this was mostly AnnaCopyingAndPasting, so it could be
worse.)

On the other hand: 

* It does seem to work in all instances (I tested it a lot)
* It fixes a wretched dialog.

Oh also: 

* When you (attempt to) close the appt editor's window w/o saving
changes, the window goes behind the main evo window. I checked, and this
happens with the currently-in-cvs code, as well as with my patch. I
sense that there is another problem somewhere involving keeping that
window on top which should, someday, be fixed.

So let me know what you think.
Anna



-- 
Anna Marie Dirks <anna ximian com>
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1774
diff -u -u -w -r1.1774 ChangeLog
--- ChangeLog	19 May 2003 17:06:13 -0000	1.1774
+++ ChangeLog	19 May 2003 22:34:39 -0000
@@ -1,5 +1,12 @@
 2003-05-19  Anna Marie Dirks  <anna ximian com>
 
+	* gui/dialogs/save-comp.c (save_component_dialog): Changed this dialog
+	to use a gtk_message_dialog instead of a gnome_message_box. (Which 
+	HIG-ifies this dialog. Fixes bug #42046)
+
+
+2003-05-19  Anna Marie Dirks  <anna ximian com>
+
 	* gui/e-meeting-time-sel.c:  (e_meeting_time_selector_construct): 
 	Added HIG-blessed padding to (some of) the widgets in the
 	dialog.
Index: gui/dialogs/save-comp.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/save-comp.c,v
retrieving revision 1.8
diff -u -u -w -r1.8 save-comp.c
--- gui/dialogs/save-comp.c	12 Mar 2003 16:10:30 -0000	1.8
+++ gui/dialogs/save-comp.c	19 May 2003 22:34:40 -0000
@@ -25,9 +25,8 @@
 
 #include <glib.h>
 #include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-messagebox.h>
-#include <libgnomeui/gnome-stock-icons.h>
 #include <gal/widgets/e-unicode.h>
+#include <gtk/gtk.h>
 #include "save-comp.h"
 
 
@@ -41,28 +40,31 @@
  * 
  * Return value: the response_id of the button selected.
  **/
+
 GtkResponseType
 save_component_dialog (GtkWindow *parent)
 {
 	GtkWidget *dialog;
 	gint r;
 
-	dialog = gnome_message_box_new (_("Do you want to save changes?"),
-					GNOME_MESSAGE_BOX_QUESTION,
-					GTK_STOCK_CANCEL,
-					GTK_STOCK_NO,
-					GTK_STOCK_YES,
+	dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
+					 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+					 GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
+					 _("This event has been changed, but has not been saved.\n\n"
+					   "Do you wish to save your changes?"));
+       
+	gtk_dialog_add_buttons (GTK_DIALOG (dialog),
+				_("_Discard Changes"),GTK_RESPONSE_NO,
+				GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL,
+				GTK_STOCK_SAVE, GTK_RESPONSE_YES,
 					NULL);
 
-	gnome_dialog_set_default (GNOME_DIALOG (dialog), 0);
-	gnome_dialog_grab_focus (GNOME_DIALOG (dialog), 0);
-	gnome_dialog_set_parent (GNOME_DIALOG (dialog), parent);
-
-	r = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
-	if (r == 1)
-		return GTK_RESPONSE_NO;
-	else if (r == 2)
-		return GTK_RESPONSE_YES;
+	gtk_window_set_title (GTK_WINDOW (dialog), _("Save Event"));
+	gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
+
+	r = gtk_dialog_run (GTK_DIALOG (dialog));
+	gtk_widget_destroy (dialog);
+
+	return r;
 
-	return GTK_RESPONSE_CANCEL;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]