Re: [evolution-patches] [Calendar] New Appointment - summary validation



Hi

Thanks for the comments. Made the suggested changes.

Please review.

Thanks
Johnny

On 12/20/05, chen <pchenthill novell com> wrote:
> On Thu, 2005-12-15 at 18:23 +0530, Johnny Jacob wrote:
> > switch (save_component_dialog (GTK_WINDOW(editor), priv->comp)) {
> >         case GTK_RESPONSE_YES: /* Save */
> > +               comp = comp_editor_get_current_comp (editor
> The summary can be retrieved from the priv->comp. Gettting the current
> comp is not necessary. Other than this the patch looks good.
>
>
> thanks, Chenthill.
>
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2894
diff -u -p -r1.2894 ChangeLog
--- calendar/ChangeLog	19 Dec 2005 11:23:09 -0000	1.2894
+++ calendar/ChangeLog	20 Dec 2005 04:12:09 -0000
@@ -1,3 +1,10 @@
+2005-12-15  Johnny Jacob  <johnnyjacob gmail com>
+
+	Refixes Bug # 324060
+	* gui/dialogs/comp-editor.c: (prompt_and_save_changes) :
+	Renamed from prompt_to_save_changes. Check wheather the 
+	summary is empty and prompt.
+
 2005-12-19  Chenthill Palanisamy  <pchenthill novell com>
 	
 	Committing for David Trowbridge <trowbrds cs colorado edu>
Index: calendar/gui/dialogs/comp-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.c,v
retrieving revision 1.158
diff -u -p -r1.158 comp-editor.c
--- calendar/gui/dialogs/comp-editor.c	15 Dec 2005 08:33:31 -0000	1.158
+++ calendar/gui/dialogs/comp-editor.c	20 Dec 2005 04:12:21 -0000
@@ -133,7 +133,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_and_save_changes (CompEditor *editor, gboolean send);
 static void delete_comp (CompEditor *editor);
 static void close_dialog (CompEditor *editor);
 
@@ -852,10 +852,11 @@ save_comp_with_send (CompEditor *editor)
 }
 
 static gboolean
-prompt_to_save_changes (CompEditor *editor, gboolean send)
+prompt_and_save_changes (CompEditor *editor, gboolean send)
 {
 	CompEditorPrivate *priv;
 	gboolean read_only;
+	ECalComponentText text;
 
 	priv = editor->priv;
 
@@ -867,6 +868,13 @@ prompt_to_save_changes (CompEditor *edit
 
 	switch (save_component_dialog (GTK_WINDOW(editor), priv->comp)) {
 	case GTK_RESPONSE_YES: /* Save */
+		
+	e_cal_component_get_summary (priv->comp, &text);
+
+		if (!text.value)
+			if (!send_component_prompt_subject ((GtkWindow *) editor, priv->client, priv->comp))
+				return FALSE;
+
 		if (e_cal_component_is_instance (priv->comp))
 			if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor), FALSE))
 				return FALSE;
@@ -895,7 +903,7 @@ delete_event_cb (GtkWidget *widget, GdkE
 
 	commit_all_fields (editor);
 	
-	if (prompt_to_save_changes (editor, TRUE))
+	if (prompt_and_save_changes (editor, TRUE))
 		close_dialog (editor);
 
 	return TRUE;
@@ -1179,7 +1187,7 @@ editor_key_press_event(GtkWidget *widget
         if (event->keyval == GDK_Escape) {
 		commit_all_fields (editor);
 		
-		if (prompt_to_save_changes (editor, TRUE))
+		if (prompt_and_save_changes (editor, TRUE))
 			close_dialog (editor);
 
                 return TRUE;
@@ -1248,17 +1256,8 @@ menu_file_close_cb (BonoboUIComponent *u
 	
 	commit_all_fields (editor);
 
-	if (prompt_to_save_changes (editor, TRUE)) {
-		comp = comp_editor_get_current_comp (editor);
-		e_cal_component_get_summary (comp, &text);
-		g_object_unref (comp);
-
-		if (!text.value)
-			if (!send_component_prompt_subject ((GtkWindow *) editor, priv->client, priv->comp))
-				return;
-
+	if (prompt_and_save_changes (editor, TRUE))
 		close_dialog (editor);
-	}
 }
 
 static void
@@ -1486,7 +1485,7 @@ comp_editor_key_press_event (GtkWidget *
 {
 #if 0
 	if (e->keyval == GDK_Escape) {
-		if (prompt_to_save_changes (COMP_EDITOR (d), TRUE))
+		if (prompt_and_save_changes (COMP_EDITOR (d), TRUE))
 			close_dialog (COMP_EDITOR (d));
 		return TRUE;
 	}
@@ -2508,7 +2507,7 @@ comp_editor_get_current_comp (CompEditor
 gboolean
 comp_editor_save_comp (CompEditor *editor, gboolean send)
 {
-	return prompt_to_save_changes (editor, send);
+	return prompt_and_save_changes (editor, send);
 }
 
 /**
@@ -2556,7 +2555,7 @@ comp_editor_close (CompEditor *editor)
 
 	commit_all_fields (editor);
 	
-	close = prompt_to_save_changes (editor, TRUE);
+	close = prompt_and_save_changes (editor, TRUE);
 	if (close)
 		close_dialog (editor);
 


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