diff options
author | Milan Crha <mcrha@redhat.com> | 2009-08-04 00:13:25 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-08-11 04:36:39 +0800 |
commit | 1295772b1ee9c3c106d1418884f6874d9ca06714 (patch) | |
tree | 1e3420dd26825825be67fc047a4c92d15cca0b75 /calendar/gui/dialogs/task-page.c | |
parent | 8d32cc325ad6ce115c683342b7741816a69f41fa (diff) | |
download | gsoc2013-evolution-1295772b1ee9c3c106d1418884f6874d9ca06714.tar gsoc2013-evolution-1295772b1ee9c3c106d1418884f6874d9ca06714.tar.gz gsoc2013-evolution-1295772b1ee9c3c106d1418884f6874d9ca06714.tar.bz2 gsoc2013-evolution-1295772b1ee9c3c106d1418884f6874d9ca06714.tar.lz gsoc2013-evolution-1295772b1ee9c3c106d1418884f6874d9ca06714.tar.xz gsoc2013-evolution-1295772b1ee9c3c106d1418884f6874d9ca06714.tar.zst gsoc2013-evolution-1295772b1ee9c3c106d1418884f6874d9ca06714.zip |
Bug #320071 - Unclear why you can't edit appointment in calendar
Diffstat (limited to 'calendar/gui/dialogs/task-page.c')
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 08bcedc7e7..2e60ff5069 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -85,6 +85,7 @@ struct _TaskPagePrivate { GtkWidget *info_hbox; GtkWidget *info_icon; GtkWidget *info_string; + gchar *subscriber_info_text; GtkWidget *summary; GtkWidget *summary_label; @@ -193,6 +194,8 @@ task_page_finalize (GObject *object) priv->deleted_attendees, (GFunc) g_object_unref, NULL); g_ptr_array_free (priv->deleted_attendees, TRUE); + g_free (priv->subscriber_info_text); + /* Chain up to parent's finalize() method. */ G_OBJECT_CLASS (task_page_parent_class)->finalize (object); } @@ -329,6 +332,18 @@ sensitize_widgets (TaskPage *tpage) sensitize = (!read_only && sens); + if (read_only) { + gchar *tmp = g_strconcat ("<b>", _("Task cannot be edited, because the selected task list is read only"), "</b>", NULL); + task_page_set_info_string (tpage, GTK_STOCK_DIALOG_INFO, tmp); + g_free (tmp); + } else if (!sens) { + 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 { + task_page_set_info_string (tpage, priv->subscriber_info_text ? GTK_STOCK_DIALOG_INFO : NULL, priv->subscriber_info_text); + } + /* The list of organizers is set to be non-editable. Otherwise any * change in the displayed list causes an 'Account not found' error. */ @@ -1366,7 +1381,7 @@ task_page_set_info_string (TaskPage *tpage, const gchar *icon, const gchar *msg) priv = tpage->priv; gtk_image_set_from_stock (GTK_IMAGE (priv->info_icon), icon, GTK_ICON_SIZE_BUTTON); - gtk_label_set_text (GTK_LABEL(priv->info_string), msg); + gtk_label_set_markup (GTK_LABEL(priv->info_string), msg); if (msg && icon) gtk_widget_show (priv->info_hbox); @@ -1789,13 +1804,19 @@ set_subscriber_info_string (TaskPage *tpage, const gchar *backend_address) client = comp_editor_get_client (editor); source = e_cal_get_source (client); - if (e_source_get_property (source, "subscriber")) + if (e_source_get_property (source, "subscriber")) { + g_free (tpage->priv->subscriber_info_text); /* Translators: This string is used when we are creating a Task on behalf of some other user */ - task_page_set_info_string (tpage, GTK_STOCK_DIALOG_INFO, - g_strdup_printf(_("You are acting on behalf of %s"), backend_address)); - else + tpage->priv->subscriber_info_text = g_markup_printf_escaped (_("You are acting on behalf of %s"), backend_address); + + task_page_set_info_string (tpage, GTK_STOCK_DIALOG_INFO, tpage->priv->subscriber_info_text); + } else { + g_free (tpage->priv->subscriber_info_text); + tpage->priv->subscriber_info_text = NULL; + task_page_set_info_string (tpage, NULL, NULL); + } } void |