Approval required for a fix in evolution-calendar Fix for #309508



Hi,

The fix http://bugzilla.gnome.org/show_bug.cgi?id=309508 prompts the
user asking whether to save delegated item or not in a dialog box.
I have added a new string and this breaks the norms of String Freeze.

I request you to kindly approve this fix.



Thanks,
Viren.


Index: calendar.error.xml
===================================================================
RCS file: /cvs/gnome/evolution/calendar/calendar.error.xml,v
retrieving revision 1.3
diff -u -p -r1.3 calendar.error.xml
--- calendar.error.xml	6 Jul 2005 07:14:57 -0000	1.3
+++ calendar.error.xml	17 Aug 2005 09:31:48 -0000
@@ -227,4 +227,12 @@
  <_secondary>You are connecting to an unsupported GroupWise server and may encounter problems using Evolution. For best results the server should be upgraded to a supported version</_secondary>
  </error>
 
+<error id="prompt-save-delegated-item" type="question" default="GTK_RESPONSE_YES">
+ <title>Delegate</title>
+ <_primary>Meeting delegated</_primary>
+ <_secondary>Keep the original item ?</_secondary>
+ <button stock="gtk-no" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-yes" response="GTK_RESPONSE_YES"/>
+</error>
+			       
 </error-list>
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2795
diff -u -p -r1.2795 ChangeLog
--- ChangeLog	12 Aug 2005 14:33:55 -0000	1.2795
+++ ChangeLog	17 Aug 2005 09:32:02 -0000
@@ -1,3 +1,15 @@
+2005-08-17  Viren.L  <lviren novell com>
+
+	Fixes #309508
+	* calendar.error.xml:
+	Defined a error id prompt-save-delegated-item. 
+	* gui/dialogs/comp-editor.c: (response_cb),(prompt_to_save_changes),
+	(prompt_to_remove_delegated_meeting):
+	Added parameter to hold the response value of the save changes dialog,
+	and added the parameter wherever the call was made.	
+	Added function prompt_to_remove_delegated_meeting.
+	Added check for delegate in response_cb and invoked prompt_to_save_changes.
+			
 2005-08-12  Viren.L  <lviren novell com>
 
 	Fixes #312739
Index: gui/dialogs/comp-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.c,v
retrieving revision 1.147
diff -u -p -r1.147 comp-editor.c
--- gui/dialogs/comp-editor.c	12 Aug 2005 21:19:52 -0000	1.147
+++ gui/dialogs/comp-editor.c	17 Aug 2005 09:32:04 -0000
@@ -130,7 +130,7 @@ static void comp_editor_show_help (CompE
 static void real_set_e_cal (CompEditor *editor, ECal *client);
 static void real_edit_comp (CompEditor *editor, ECalComponent *comp);
 static gboolean real_send_comp (CompEditor *editor, ECalComponentItipMethod method);
-static gboolean prompt_to_save_changes (CompEditor *editor, gboolean send);
+static gboolean prompt_to_save_changes (CompEditor *editor, gboolean send, GtkResponseType *response);
 static void delete_comp (CompEditor *editor);
 static void close_dialog (CompEditor *editor);
 
@@ -844,8 +844,42 @@ save_comp_with_send (CompEditor *editor)
 	return TRUE;
 }
 
+static void 
+prompt_to_remove_delegated_meeting (CompEditor *editor) 
+{
+	CompEditorPrivate *priv;
+
+	priv = editor->priv;	
+	
+	if (e_error_run (NULL, "calendar:prompt-save-delegated-item", NULL) == GTK_RESPONSE_NO) {
+		const char *uid;
+		GError *error = NULL;
+
+		e_cal_component_get_uid (priv->comp, &uid);
+
+		if (!e_cal_component_is_instance (priv->comp)) {
+			e_cal_remove_object (priv->client, uid, &error);
+		} else {
+			if (priv->mod == CALOBJ_MOD_ALL) {
+				e_cal_remove_object_with_mod (priv->client, uid, NULL, 
+						CALOBJ_MOD_ALL, &error);
+			} else {
+				const char *rid = e_cal_component_get_recurid_as_string (priv->comp);
+
+				e_cal_remove_object_with_mod (priv->client, uid, rid, 
+						CALOBJ_MOD_THIS, &error);
+			}
+		}
+
+		if (error) {
+			g_warning ("Could not remove the Object: %s", error->message);
+			g_clear_error (&error);
+		}
+	}					
+}	
+
 static gboolean
-prompt_to_save_changes (CompEditor *editor, gboolean send)
+prompt_to_save_changes (CompEditor *editor, gboolean send, GtkResponseType *response)
 {
 	CompEditorPrivate *priv;
 	gboolean read_only;
@@ -857,8 +891,9 @@ prompt_to_save_changes (CompEditor *edit
 
 	if (!e_cal_is_read_only (priv->client, &read_only, NULL) || read_only)
 		return TRUE;
-
-	switch (save_component_dialog (GTK_WINDOW(editor), priv->comp)) {
+	*response = save_component_dialog (GTK_WINDOW(editor), priv->comp);
+	
+	switch (*response) {
 	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), FALSE))
@@ -886,6 +921,7 @@ response_cb (GtkWidget *widget, int resp
 	ECalComponentText text;
 	gboolean delegated;
 	ECalComponent *comp;
+	GtkResponseType res;
 
 	priv = editor->priv;
 	delegated = (priv->flags & COMP_EDITOR_DELEGATE);
@@ -924,6 +960,9 @@ response_cb (GtkWidget *widget, int resp
 				return;
 		if (save_comp_with_send (editor)) 
 			close_dialog (editor);
+		if (delegated) 
+			prompt_to_remove_delegated_meeting (editor); 
+
 		break;
 
 	case GTK_RESPONSE_HELP:
@@ -933,8 +972,11 @@ response_cb (GtkWidget *widget, int resp
 	case GTK_RESPONSE_CANCEL:
 		commit_all_fields (editor);
 		
-		if (prompt_to_save_changes (editor, TRUE))
+		if (prompt_to_save_changes (editor, TRUE, &res)) {
 			close_dialog (editor);
+			if (res == GTK_RESPONSE_YES && (priv->flags & COMP_EDITOR_DELEGATE))
+					prompt_to_remove_delegated_meeting (editor);
+		}
 		break;
 	default:
 		/* We handle delete event below */
@@ -947,12 +989,13 @@ delete_event_cb (GtkWidget *widget, GdkE
 {
 	CompEditor *editor = COMP_EDITOR (data);
 	CompEditorPrivate *priv;
+	GtkResponseType res;
 	
 	priv = editor->priv;
 
 	commit_all_fields (editor);
 	
-	if (prompt_to_save_changes (editor, TRUE))
+	if (prompt_to_save_changes (editor, TRUE, &res))
 		close_dialog (editor);
 
 	return TRUE;
@@ -2356,7 +2399,8 @@ comp_editor_get_current_comp (CompEditor
 gboolean
 comp_editor_save_comp (CompEditor *editor, gboolean send)
 {
-	return prompt_to_save_changes (editor, send);
+	GtkResponseType res;
+	return prompt_to_save_changes (editor, send, &res);
 }
 
 /**
@@ -2398,13 +2442,14 @@ gboolean
 comp_editor_close (CompEditor *editor)
 {
 	gboolean close;
+	GtkResponseType res;
 	
 	g_return_val_if_fail (editor != NULL, FALSE);
 	g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE);
 
 	commit_all_fields (editor);
 	
-	close = prompt_to_save_changes (editor, TRUE);
+	close = prompt_to_save_changes (editor, TRUE, &res);
 	if (close)
 		close_dialog (editor);
 


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