aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-08-04 00:13:25 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-08-11 04:36:39 +0800
commit1295772b1ee9c3c106d1418884f6874d9ca06714 (patch)
tree1e3420dd26825825be67fc047a4c92d15cca0b75
parent8d32cc325ad6ce115c683342b7741816a69f41fa (diff)
downloadgsoc2013-evolution-1295772b1ee9c3c106d1418884f6874d9ca06714.tar.gz
gsoc2013-evolution-1295772b1ee9c3c106d1418884f6874d9ca06714.tar.zst
gsoc2013-evolution-1295772b1ee9c3c106d1418884f6874d9ca06714.zip
Bug #320071 - Unclear why you can't edit appointment in calendar
-rw-r--r--calendar/gui/dialogs/event-page.c30
-rw-r--r--calendar/gui/dialogs/memo-page.c30
-rw-r--r--calendar/gui/dialogs/task-page.c31
3 files changed, 76 insertions, 15 deletions
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index de62e687a8..caafdf1ab1 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -104,6 +104,7 @@ struct _EventPagePrivate {
GtkWidget *info_hbox;
GtkWidget *info_icon;
GtkWidget *info_string;
+ gchar *subscriber_info_text;
GtkWidget *summary;
GtkWidget *summary_label;
@@ -262,6 +263,7 @@ event_page_finalize (GObject *object)
g_ptr_array_free (priv->deleted_attendees, TRUE);
g_free (priv->old_summary);
+ g_free (priv->subscriber_info_text);
priv->alarm_list_dlg_widget = NULL;
@@ -745,6 +747,18 @@ sensitize_widgets (EventPage *epage)
sensitize = !read_only && sens;
+ if (read_only) {
+ gchar *tmp = g_strconcat ("<b>", _("Event cannot be edited, because the selected calendar is read only"), "</b>", NULL);
+ event_page_set_info_string (epage, GTK_STOCK_DIALOG_INFO, tmp);
+ g_free (tmp);
+ } else if (!sens) {
+ gchar *tmp = g_strconcat ("<b>", _("Event cannot be fully edited, because you are not the organizer"), "</b>", NULL);
+ event_page_set_info_string (epage, GTK_STOCK_DIALOG_INFO, tmp);
+ g_free (tmp);
+ } else {
+ event_page_set_info_string (epage, priv->subscriber_info_text ? GTK_STOCK_DIALOG_INFO : NULL, priv->subscriber_info_text);
+ }
+
alarm = e_dialog_combo_box_get (priv->alarm_time_combo, priv->alarm_map) != ALARM_NONE;
custom = is_custom_alarm_store (priv->alarm_list_store, priv->old_summary, priv->alarm_units, priv->alarm_interval, NULL) ||
e_dialog_combo_box_get (priv->alarm_time_combo, priv->alarm_map) == ALARM_CUSTOM ? TRUE:FALSE;
@@ -2161,7 +2175,7 @@ event_page_set_info_string (EventPage *epage, const gchar *icon, const gchar *ms
priv = epage->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);
@@ -2642,13 +2656,19 @@ set_subscriber_info_string (EventPage *epage, 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 (epage->priv->subscriber_info_text);
/* Translators: This string is used when we are creating an Event
(meeting or appointment) on behalf of some other user */
- event_page_set_info_string (epage, GTK_STOCK_DIALOG_INFO,
- g_strdup_printf(_("You are acting on behalf of %s"), backend_address));
- else
+ epage->priv->subscriber_info_text = g_markup_printf_escaped (_("You are acting on behalf of %s"), backend_address);
+
+ event_page_set_info_string (epage, GTK_STOCK_DIALOG_INFO, epage->priv->subscriber_info_text);
+ } else {
+ g_free (epage->priv->subscriber_info_text);
+ epage->priv->subscriber_info_text = NULL;
+
event_page_set_info_string (epage, NULL, NULL);
+ }
}
static void
diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c
index a510328af6..8e1c2b233b 100644
--- a/calendar/gui/dialogs/memo-page.c
+++ b/calendar/gui/dialogs/memo-page.c
@@ -72,6 +72,7 @@ struct _MemoPagePrivate {
GtkWidget *info_hbox;
GtkWidget *info_icon;
GtkWidget *info_string;
+ gchar *subscriber_info_text;
/* Organizer */
GtkWidget *org_label;
@@ -163,6 +164,8 @@ memo_page_finalize (GObject *object)
priv->xml = NULL;
}
+ g_free (priv->subscriber_info_text);
+
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (memo_page_parent_class)->finalize (object);
}
@@ -340,6 +343,18 @@ sensitize_widgets (MemoPage *mpage)
sensitize = (!read_only && sens);
+ if (read_only) {
+ gchar *tmp = g_strconcat ("<b>", _("Memo cannot be edited, because the selected memo list is read only"), "</b>", NULL);
+ memo_page_set_info_string (mpage, GTK_STOCK_DIALOG_INFO, tmp);
+ g_free (tmp);
+ } else if (!sens) {
+ gchar *tmp = g_strconcat ("<b>", _("Memo cannot be fully edited, because you are not the organizer"), "</b>", NULL);
+ memo_page_set_info_string (mpage, GTK_STOCK_DIALOG_INFO, tmp);
+ g_free (tmp);
+ } else {
+ memo_page_set_info_string (mpage, 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.
*/
@@ -732,7 +747,7 @@ memo_page_set_info_string (MemoPage *mpage, const gchar *icon, const gchar *msg)
priv = mpage->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);
@@ -888,13 +903,18 @@ set_subscriber_info_string (MemoPage *mpage,
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 (mpage->priv->subscriber_info_text);
/* Translators: This string is used when we are creating a Memo
on behalf of some other user */
- memo_page_set_info_string (mpage, GTK_STOCK_DIALOG_INFO,
- g_strdup_printf(_("You are acting on behalf of %s"), backend_address));
- else
+ mpage->priv->subscriber_info_text = g_markup_printf_escaped (_("You are acting on behalf of %s"), backend_address);
+ memo_page_set_info_string (mpage, GTK_STOCK_DIALOG_INFO, mpage->priv->subscriber_info_text);
+ } else {
+ g_free (mpage->priv->subscriber_info_text);
+ mpage->priv->subscriber_info_text = NULL;
+
memo_page_set_info_string (mpage, NULL, NULL);
+ }
}
static void
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