Re: [evolution-patches] [Calendar] New Appointment - summary validation
- From: Johnny Jacob <johnnyjacob gmail com>
- To: chen <pchenthill novell com>
- Cc: evolution-patches gnome org
- Subject: Re: [evolution-patches] [Calendar] New Appointment - summary validation
- Date: Thu, 15 Dec 2005 18:23:16 +0530
Hi
Made the sugested changes. Changed "prompt_to_save_changes" to
"prompt_and_save_changes".
Please review the patch.
Thanks
Johnny
On 12/15/05, chen <pchenthill novell com> wrote:
> On Wed, 2005-12-14 at 13:57 +0530, Johnny Jacob wrote:
> > + comp = comp_editor_get_current_comp (editor);
> > + e_cal_component_get_summary (comp, &text);
> > + g_object_unref (comp);
> This must come inside prompt_to_save_changes. Perhaps the
> prompt_to_save_changes does more than what it should do which is
> confusing, it prompts for the dialog and also saves/discards the changes
> depending on the response. It should be renamed.
>
> thanks, Chenthill.
>
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2871
diff -u -p -r1.2871 ChangeLog
--- calendar/ChangeLog 15 Dec 2005 08:20:56 -0000 1.2871
+++ calendar/ChangeLog 15 Dec 2005 12:49:41 -0000
@@ -1,3 +1,11 @@
+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-15 Chenthill Palanisamy <pchenthill novell com>
Fixes #321739
Index: calendar/gui/dialogs/comp-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.c,v
retrieving revision 1.157
diff -u -p -r1.157 comp-editor.c
--- calendar/gui/dialogs/comp-editor.c 14 Dec 2005 12:46:45 -0000 1.157
+++ calendar/gui/dialogs/comp-editor.c 15 Dec 2005 12:50:22 -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,12 @@ 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;
+ ECalComponent *comp;
+ ECalComponentText text;
priv = editor->priv;
@@ -867,6 +869,14 @@ prompt_to_save_changes (CompEditor *edit
switch (save_component_dialog (GTK_WINDOW(editor), priv->comp)) {
case GTK_RESPONSE_YES: /* Save */
+ 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 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 +905,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;
@@ -1177,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;
@@ -1246,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
@@ -1484,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;
}
@@ -2521,7 +2522,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);
}
/**
@@ -2569,7 +2570,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]