diff options
author | Chenthill Palanisamy <pchen@src.gnome.org> | 2007-07-09 03:52:34 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2007-07-09 03:52:34 +0800 |
commit | 3615c9dbb4749849de6ea7d913b5c9bc73ba70ce (patch) | |
tree | 3284d244add037e0a5414e385eeb0de8aee86c94 /calendar/gui/dialogs/comp-editor.c | |
parent | 72d7222c6d21b3935dac26983028ff2b0e06e1dc (diff) | |
download | gsoc2013-evolution-3615c9dbb4749849de6ea7d913b5c9bc73ba70ce.tar gsoc2013-evolution-3615c9dbb4749849de6ea7d913b5c9bc73ba70ce.tar.gz gsoc2013-evolution-3615c9dbb4749849de6ea7d913b5c9bc73ba70ce.tar.bz2 gsoc2013-evolution-3615c9dbb4749849de6ea7d913b5c9bc73ba70ce.tar.lz gsoc2013-evolution-3615c9dbb4749849de6ea7d913b5c9bc73ba70ce.tar.xz gsoc2013-evolution-3615c9dbb4749849de6ea7d913b5c9bc73ba70ce.tar.zst gsoc2013-evolution-3615c9dbb4749849de6ea7d913b5c9bc73ba70ce.zip |
Fixes #329594
svn path=/trunk/; revision=33768
Diffstat (limited to 'calendar/gui/dialogs/comp-editor.c')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 59f805c1e1..3e4a77d0ee 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -911,11 +911,14 @@ prompt_and_save_changes (CompEditor *editor, gboolean send) if (!priv->changed) return TRUE; - if (!e_cal_is_read_only (priv->client, &read_only, NULL) || read_only) - return TRUE; - switch (save_component_dialog (GTK_WINDOW(editor), priv->comp)) { case GTK_RESPONSE_YES: /* Save */ + if (!e_cal_is_read_only (priv->client, &read_only, NULL) || read_only) { + e_error_run ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (editor)), "calendar:prompt-read-only-cal", NULL); + /* don't discard changes when selected readonly calendar */ + return FALSE; + } + comp = comp_editor_get_current_comp (editor); e_cal_component_get_summary (comp, &text); g_object_unref (comp); @@ -1258,6 +1261,7 @@ menu_file_save_cb (BonoboUIComponent *uic, CompEditorPrivate *priv = editor->priv; ECalComponentText text; gboolean delegated = FALSE; + gboolean read_only; ECalComponent *comp; if (e_attachment_bar_get_download_count (E_ATTACHMENT_BAR (editor->priv->attachment_bar)) ){ @@ -1280,6 +1284,12 @@ menu_file_save_cb (BonoboUIComponent *uic, if (!response) return; } + + if (!e_cal_is_read_only (priv->client, &read_only, NULL) || read_only) { + e_error_run ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (editor)), "calendar:prompt-read-only-cal", NULL); + return; + } + commit_all_fields (editor); if (e_cal_component_is_instance (priv->comp)) if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor), delegated)) |