[evolution-patches] Patch for bug #61673 (Tasks)



Hi all,
Attached is the patch for bug # 616173. 
There is a new error message string in calendar-errors.xml. The function
save_component_dialog(present in the file
calendar/gui/dialogs/save_comp.c) now takes 2 arguments instead of one.
The second argument is a pointer to the ECalComponent structure, is used
to determine the type of the component. An error message is displayed
based on the component type.

cheers,
partha
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2472
diff -u -r1.2472 ChangeLog
--- calendar/ChangeLog	4 Aug 2004 04:32:12 -0000	1.2472
+++ calendar/ChangeLog	5 Aug 2004 09:27:20 -0000
@@ -1,3 +1,17 @@
+2004-08-05  Parthasarathi S A   <sparthasarathi novell com>
+	Fix for bug #61673. 
+	* calendar/gui/dialogs/save_comp.c(save_component_dialog):
+	  The function takes two arguments now, instead of one. The second
+	  argument is the pointer to the ECalComponent from which the component
+	  type can be determined. Based on the component type the corresponding
+	  error message is displayed.
+        * calendar/gui/dialogs/save_comp.h: 
+	  Function definition updated for save_component_dialog.
+	* calendar/gui/dialogs/comp_editor.c(prompt_to_save_changes):
+	  passing the ECalComponent pointer to the 'save_component_dialog' function
+	* calendar/calendar-errors.xml: New error message string for task included
+	* calendar/calendar-errors.xml.h
+
 2004-08-04  Harish Krishnaswamy  <kharish novell com>
 
 	* gui/e-itip-control.c: (ok_clicked_cb): Handle decline request by
Index: calendar/gui/dialogs/comp-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.c,v
retrieving revision 1.108
diff -u -r1.108 comp-editor.c
--- calendar/gui/dialogs/comp-editor.c	16 Jul 2004 02:28:21 -0000	1.108
+++ calendar/gui/dialogs/comp-editor.c	5 Aug 2004 09:28:00 -0000
@@ -330,7 +330,7 @@
 	if (!e_cal_is_read_only (priv->client, &read_only, NULL) || read_only)
 		return TRUE;
 
-	switch (save_component_dialog (GTK_WINDOW (editor))) {
+	switch (save_component_dialog (GTK_WINDOW(editor), priv->comp)) {
 	case GTK_RESPONSE_YES: /* Save */
 		if (e_cal_component_is_instance (priv->comp))
 			if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor)))
Index: calendar/gui/dialogs/save-comp.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/save-comp.c,v
retrieving revision 1.14
diff -u -r1.14 save-comp.c
--- calendar/gui/dialogs/save-comp.c	25 May 2004 20:41:32 -0000	1.14
+++ calendar/gui/dialogs/save-comp.c	5 Aug 2004 09:28:16 -0000
@@ -24,13 +24,15 @@
 #endif
 
 #include "widgets/misc/e-error.h"
+#include <libecal/e-cal-component.h>
 #include "save-comp.h"
-
+#include "comp-editor.h"
 
 /**
  * save_component_dialog:
  * @parent: Window to use as the transient dialog's parent.
- * 
+ * @comp: Pointer to the EcalComponent 
+ *
  * Pops up a dialog box asking the user whether he wants to save changes for
  * a calendar component.
  * 
@@ -38,7 +40,16 @@
  **/
 
 GtkResponseType
-save_component_dialog (GtkWindow *parent)
+save_component_dialog (GtkWindow *parent, ECalComponent *comp)
 {
-	return e_error_run (parent, "calendar:prompt-save-appointment", NULL);
+	ECalComponentVType vtype = e_cal_component_get_vtype(comp);
+
+	switch(vtype) {
+		case E_CAL_COMPONENT_EVENT:
+			return e_error_run (parent, "calendar:prompt-save-appointment", NULL);
+		case E_CAL_COMPONENT_TODO:
+			return e_error_run (parent, "calendar:prompt-save-task", NULL);
+		default:
+			return GTK_RESPONSE_NO;
+	}
 }
Index: calendar/gui/dialogs/save-comp.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/save-comp.h,v
retrieving revision 1.5
diff -u -r1.5 save-comp.h
--- calendar/gui/dialogs/save-comp.h	12 Mar 2003 16:04:50 -0000	1.5
+++ calendar/gui/dialogs/save-comp.h	5 Aug 2004 09:28:27 -0000
@@ -24,6 +24,6 @@
 
 #include <gtk/gtkdialog.h>
 
-GtkResponseType save_component_dialog (GtkWindow *parent);
+GtkResponseType save_component_dialog (GtkWindow *parent, ECalComponent *comp);
 
 #endif
Index: calendar/calendar-errors.xml
===================================================================
RCS file: /cvs/gnome/evolution/calendar/calendar-errors.xml,v
retrieving revision 1.1
diff -u -r1.1 calendar-errors.xml
--- calendar/calendar-errors.xml	25 May 2004 20:41:32 -0000	1.1
+++ calendar/calendar-errors.xml	5 Aug 2004 09:28:40 -0000
@@ -115,6 +115,15 @@
   <button label="Save Changes" response="GTK_RESPONSE_YES"/>
  </error>
 
+ <error id="prompt-save-task" type="question" default="GTK_RESPONSE_YES">
+  <title>Save Task</title>
+  <primary>Would you like to save your changes to this task?</primary>
+  <secondary>You have made changes to this task, but not yet saved them.</secondary>
+  <button label="Discard Changes" response="GTK_RESPONSE_NO"/>
+  <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+  <button label="Save Changes" response="GTK_RESPONSE_YES"/>
+ </error>
+
  <error id="prompt-meeting-invite" type="question" default="GTK_RESPONSE_YES">
   <primary>Would you like to send meeting invitations to participants?</primary>
   <secondary>Email invitations will be sent to all participants and allow them to RSVP.</secondary>
Index: calendar/calendar-errors.xml.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/calendar-errors.xml.h,v
retrieving revision 1.1
diff -u -r1.1 calendar-errors.xml.h
--- calendar/calendar-errors.xml.h	25 May 2004 20:41:32 -0000	1.1
+++ calendar/calendar-errors.xml.h	5 Aug 2004 09:28:46 -0000
@@ -72,6 +72,14 @@
 char *s = N_("You have made changes to this appointment, but not yet saved them.");
 char *s = N_("Discard Changes");
 char *s = N_("Save Changes");
+/* calendar:prompt-save-task title */
+char *s = N_("Save Task");
+/* calendar:prompt-save-task primary */
+char *s = N_("Would you like to save your changes to this task?");
+/* calendar:prompt-save-task secondary */
+char *s = N_("You have made changes to this task, but not yet saved them.");
+char *s = N_("Discard Changes");
+char *s = N_("Save Changes");
 /* calendar:prompt-meeting-invite primary */
 char *s = N_("Would you like to send meeting invitations to participants?");
 /* calendar:prompt-meeting-invite secondary */


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