** Fix for bug #439998 (bnc)

2008-12-29  Bharath Acharya  <abharath@novell.com>

       ** Fix for bug #439998 (bnc)

       * gui/dialogs/comp-editor.c: (remove_event_dialog),
       (action_save_cb): Ask the user if he wants to remove the
        delegated events or keep a copy.

svn path=/trunk/; revision=36940
This commit is contained in:
Bharath Acharya
2008-12-29 05:57:28 +00:00
committed by Bharath Acharya
parent c51b91d1e3
commit b24fc3e455
2 changed files with 52 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2008-12-29 Bharath Acharya <abharath@novell.com>
** Fix for bug #439998 (bnc)
* gui/dialogs/comp-editor.c: (remove_event_dialog),
(action_save_cb): Ask the user if he wants to remove the delegated
events or keep a copy.
2008-12-22 Milan Crha <mcrha@redhat.com>
** Fix for bug #559604

View File

@ -1102,6 +1102,24 @@ action_print_preview_cb (GtkAction *action,
g_object_unref (comp);
}
static gboolean
remove_event_dialog (ECal *client,
ECalComponent *comp,
GtkWindow *parent)
{
GtkWidget *dialog;
gboolean ret;
g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), TRUE);
dialog = gtk_message_dialog_new (parent, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", _("Keep original item?"));
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
ret = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES;
gtk_widget_destroy (dialog);
return ret;
}
static void
action_save_cb (GtkAction *action,
CompEditor *editor)
@ -1153,9 +1171,33 @@ action_save_cb (GtkAction *action,
if (!text.value)
if (!send_component_prompt_subject ((GtkWindow *) editor, priv->client, priv->comp))
return;
if (save_comp_with_send (editor))
close_dialog (editor);
if (save_comp_with_send (editor)) {
CompEditorFlags flags;
gboolean delegate;
flags = comp_editor_get_flags (editor);
delegate = flags & COMP_EDITOR_DELEGATE;
if (delegate && !remove_event_dialog (priv->client, priv->comp, GTK_WINDOW (editor))) {
const char *uid = NULL;
GError *error = NULL;
e_cal_component_get_uid (priv->comp, &uid);
if (e_cal_component_is_instance (priv->comp) || e_cal_component_has_recurrences (priv->comp)) {
gchar *rid;
rid = e_cal_component_get_recurid_as_string (priv->comp);
e_cal_remove_object_with_mod (priv->client, uid, rid, priv->mod, &error);
g_free (rid);
} else
e_cal_remove_object (priv->client, uid, &error);
g_clear_error (&error);
}
}
close_dialog (editor);
}
static void