aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-09-26 17:08:46 +0800
committerMilan Crha <mcrha@redhat.com>2011-09-26 17:08:46 +0800
commit933a26b0ed9dd8337ffb5a24d7934a35adbdd0f8 (patch)
tree8927d0a9d539c576b3cdd49a56da02aaff1e167e /calendar/gui
parent8a309aef81ed8364b054e49cfb94908623e2d0d4 (diff)
downloadgsoc2013-evolution-933a26b0ed9dd8337ffb5a24d7934a35adbdd0f8.tar
gsoc2013-evolution-933a26b0ed9dd8337ffb5a24d7934a35adbdd0f8.tar.gz
gsoc2013-evolution-933a26b0ed9dd8337ffb5a24d7934a35adbdd0f8.tar.bz2
gsoc2013-evolution-933a26b0ed9dd8337ffb5a24d7934a35adbdd0f8.tar.lz
gsoc2013-evolution-933a26b0ed9dd8337ffb5a24d7934a35adbdd0f8.tar.xz
gsoc2013-evolution-933a26b0ed9dd8337ffb5a24d7934a35adbdd0f8.tar.zst
gsoc2013-evolution-933a26b0ed9dd8337ffb5a24d7934a35adbdd0f8.zip
Bug #657170 - Disallow creating assigned tasks when not supported
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/dialogs/comp-editor.c24
-rw-r--r--calendar/gui/dialogs/task-page.c6
2 files changed, 30 insertions, 0 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 172e79a1fe..d5190ba8ba 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -958,6 +958,18 @@ action_save_cb (GtkAction *action,
return;
}
+ if ((comp_editor_get_flags (editor) & COMP_EDITOR_IS_ASSIGNED) != 0
+ && e_cal_component_get_vtype (priv->comp) == E_CAL_COMPONENT_TODO
+ && e_client_check_capability (E_CLIENT (priv->cal_client), CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT)) {
+ e_alert_submit (
+ E_ALERT_SINK (editor),
+ "calendar:prompt-no-task-assignment-editor",
+ e_source_peek_name (
+ e_client_get_source (E_CLIENT (priv->cal_client))),
+ NULL);
+ return;
+ }
+
commit_all_fields (editor);
if (e_cal_component_has_recurrences (priv->comp)) {
if (!recur_component_dialog (
@@ -2214,6 +2226,18 @@ prompt_and_save_changes (CompEditor *editor,
return FALSE;
}
+ if ((comp_editor_get_flags (editor) & COMP_EDITOR_IS_ASSIGNED) != 0
+ && e_cal_component_get_vtype (priv->comp) == E_CAL_COMPONENT_TODO
+ && e_client_check_capability (E_CLIENT (priv->cal_client), CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT)) {
+ e_alert_submit (
+ E_ALERT_SINK (editor),
+ "calendar:prompt-no-task-assignment-editor",
+ e_source_peek_name (
+ e_client_get_source (E_CLIENT (priv->cal_client))),
+ NULL);
+ return FALSE;
+ }
+
comp = comp_editor_get_current_comp (editor, &correct);
e_cal_component_get_summary (comp, &text);
g_object_unref (comp);
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index d88976be75..e0aa030358 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -290,6 +290,12 @@ sensitize_widgets (TaskPage *tpage)
gchar *tmp = g_strconcat ("<b>", _("Task cannot be fully edited, because you are not the organizer"), "</b>", NULL);
task_page_set_info_string (tpage, GTK_STOCK_DIALOG_INFO, tmp);
g_free (tmp);
+ } else if ((flags & COMP_EDITOR_IS_ASSIGNED) != 0 && e_client_check_capability (E_CLIENT (client), CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT)) {
+ gchar *tmp = g_strconcat ("<b>", _("Task cannot be edited, because the selected task list does not support assigned tasks"), "</b>", NULL);
+ task_page_set_info_string (tpage, GTK_STOCK_DIALOG_INFO, tmp);
+ g_free (tmp);
+ sens = FALSE;
+ read_only = TRUE;
} else if (!check_starts_in_the_past (tpage)) {
task_page_set_info_string (tpage, priv->subscriber_info_text ? GTK_STOCK_DIALOG_INFO : NULL, priv->subscriber_info_text);
}