diff options
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 6de55a14e2..8b5c02843e 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. */ @@ -1370,7 +1385,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); @@ -1803,13 +1818,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 |