diff options
author | Suman Manjunath <msuman@src.gnome.org> | 2008-01-06 00:42:34 +0800 |
---|---|---|
committer | Suman Manjunath <msuman@src.gnome.org> | 2008-01-06 00:42:34 +0800 |
commit | c922073e07108cd81b51ff10cc6e26fb08bfd66d (patch) | |
tree | 553efd1f5ad02da215d8893f402d4bcbb52c27c1 /calendar/gui | |
parent | c81607264ef1e648a9ad468ef3b03314fda494ed (diff) | |
download | gsoc2013-evolution-c922073e07108cd81b51ff10cc6e26fb08bfd66d.tar.gz gsoc2013-evolution-c922073e07108cd81b51ff10cc6e26fb08bfd66d.tar.zst gsoc2013-evolution-c922073e07108cd81b51ff10cc6e26fb08bfd66d.zip |
Fixes bug #270605 (Hide disabled accounts in memo-editor) + Show organizers of assigned tasks correctly.
svn path=/trunk/; revision=34763
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 20 | ||||
-rw-r--r-- | calendar/gui/dialogs/memo-page.c | 37 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 29 |
3 files changed, 52 insertions, 34 deletions
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 2c1eea16ce..10dbd5cbec 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -83,7 +83,6 @@ struct _EventPagePrivate { EAccountList *accounts; GList *address_strings; EMeetingAttendee *ia; - char *default_address; char *user_add; ECalComponent *comp; @@ -256,7 +255,6 @@ event_page_init (EventPage *epage) priv->accounts = NULL; priv->address_strings = NULL; priv->ia = NULL; - priv->default_address = NULL; priv->invite = NULL; priv->model = NULL; @@ -3136,6 +3134,7 @@ event_page_select_organizer (EventPage *epage, const char *backend_address) GList *l; EAccount *def_account; gchar *def_address = NULL; + const char *default_address; gboolean subscribed_cal = FALSE; ESource *source = NULL; const char *user_addr = NULL; @@ -3155,25 +3154,27 @@ event_page_select_organizer (EventPage *epage, const char *backend_address) else user_addr = (backend_address && *backend_address) ? backend_address : NULL; - priv->default_address = NULL; + default_address = NULL; if (user_addr) - for (l = priv->address_strings; l != NULL && user_addr; l = l->next) + for (l = priv->address_strings; l != NULL; l = l->next) if (g_strrstr ((gchar *) l->data, user_addr) != NULL) { - priv->default_address = (gchar *) l->data; + default_address = (const char *) l->data; break; } - if (!priv->default_address && def_address) - priv->default_address = def_address; + if (!default_address && def_address) + default_address = def_address; - if (priv->default_address) { + if (default_address) { if (!priv->comp || !e_cal_component_has_organizer (priv->comp)) { - gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), priv->default_address); + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), default_address); /* FIXME: Use accessor functions to access private members of a GtkCombo widget */ gtk_widget_set_sensitive (GTK_WIDGET (GTK_COMBO (priv->organizer)->button), !subscribed_cal); } } else g_warning ("No potential organizers!"); + + g_free (def_address); } /** @@ -3224,7 +3225,6 @@ event_page_construct (EventPage *epage, EMeetingStore *model, ECal *client) a = (EAccount *)e_iterator_get(it); - /* skip disabled accounts */ if (!a->enabled) continue; diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 4696e82428..93b6239c6d 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -98,7 +98,6 @@ struct _MemoPagePrivate { GtkWidget *source_selector; GList *address_strings; - char *default_address; ENameSelector *name_selector; @@ -178,7 +177,6 @@ memo_page_init (MemoPage *mpage) priv->updating = FALSE; priv->address_strings = NULL; - priv->default_address = NULL; } /* Destroy handler for the memo page */ @@ -931,7 +929,7 @@ source_changed_cb (ESourceComboBox *source_combo_box, MemoPage *mpage) e_cal_get_cal_address(client, &backend_addr, NULL); - if (backend_addr && (COMP_EDITOR_PAGE (mpage)->flags & COMP_EDITOR_PAGE_IS_SHARED)) + if (COMP_EDITOR_PAGE (mpage)->flags & COMP_EDITOR_PAGE_IS_SHARED) memo_page_select_organizer (mpage, backend_addr); set_subscriber_info_string (mpage, backend_addr); @@ -1114,12 +1112,13 @@ memo_page_select_organizer (MemoPage *mpage, const char *backend_address) GList *l; EAccount *def_account; gchar *def_address = NULL; + const char *default_address; gboolean subscribed_cal = FALSE; ESource *source = NULL; const char *user_addr = NULL; def_account = itip_addresses_get_default(); - if (def_account) + if (def_account && def_account->enabled) def_address = g_strdup_printf("%s <%s>", def_account->id->name, def_account->id->address); priv = mpage->priv; @@ -1131,26 +1130,29 @@ memo_page_select_organizer (MemoPage *mpage, const char *backend_address) if (user_addr) subscribed_cal = TRUE; else - user_addr = backend_address; + user_addr = (backend_address && *backend_address) ? backend_address : NULL; - priv->default_address = NULL; - for (l = priv->address_strings; l != NULL; l = l->next) - if (g_strrstr ((gchar *) l->data, user_addr) != NULL) { - priv->default_address = (gchar *) l->data; - break; - } + default_address = NULL; + if (user_addr) + for (l = priv->address_strings; l != NULL; l = l->next) + if (g_strrstr ((gchar *) l->data, user_addr) != NULL) { + default_address = (const char *) l->data; + break; + } - if (!priv->default_address && def_account) - priv->default_address = def_address; + if (!default_address && def_account) + default_address = def_address; - if (priv->default_address) { + if (default_address) { if (COMP_EDITOR_PAGE (mpage)->flags & COMP_EDITOR_PAGE_NEW_ITEM) { - gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->org_combo)->entry), priv->default_address); + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->org_combo)->entry), default_address); /* FIXME: Use accessor functions to access private members of a GtkCombo widget */ gtk_widget_set_sensitive (GTK_WIDGET (GTK_COMBO (priv->org_combo)->button), !subscribed_cal); } } else g_warning ("No potential organizers!"); + + g_free (def_address); } /** @@ -1199,6 +1201,11 @@ memo_page_construct (MemoPage *mpage) gchar *full = NULL; a = (EAccount *)e_iterator_get(it); + + /* skip disabled accounts */ + if (!a->enabled) + continue; + full = g_strdup_printf("%s <%s>", a->id->name, a->id->address); priv->address_strings = g_list_append(priv->address_strings, full); diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index f4cf1ecd3b..6b004294f9 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -70,7 +70,6 @@ struct _TaskPagePrivate { EAccountList *accounts; GList *address_strings; EMeetingAttendee *ia; - char *default_address; char *user_add; ECalComponent *comp; @@ -215,7 +214,6 @@ task_page_init (TaskPage *tpage) priv->accounts = NULL; priv->address_strings = NULL; priv->ia = NULL; - priv->default_address = NULL; priv->invite = NULL; priv->model = NULL; @@ -699,6 +697,8 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) if (organizer.value != NULL) { const gchar *strip = itip_strip_mailto (organizer.value); gchar *string; + GList *list = NULL; + if (itip_organizer_is_user (comp, page->client) || itip_sentby_is_user (comp)) { if (e_cal_get_static_capability ( page->client, @@ -722,7 +722,14 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) else string = g_strdup (strip); + if (!priv->user_org) { + list = g_list_append (list, string); + gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), list); + gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->organizer)->entry), FALSE); + } + g_free (string); + g_list_free (list); priv->existing = TRUE; } } else { @@ -2070,6 +2077,7 @@ task_page_select_organizer (TaskPage *tpage, const char *backend_address) GList *l; EAccount *def_account; gchar *def_address = NULL; + const char *default_address; gboolean subscribed_cal = FALSE; ESource *source = NULL; const char *user_addr = NULL; @@ -2089,25 +2097,27 @@ task_page_select_organizer (TaskPage *tpage, const char *backend_address) else user_addr = (backend_address && *backend_address) ? backend_address : NULL; - priv->default_address = NULL; + default_address = NULL; if (user_addr) - for (l = priv->address_strings; l != NULL && user_addr; l = l->next) + for (l = priv->address_strings; l != NULL; l = l->next) if (g_strrstr ((gchar *) l->data, user_addr) != NULL) { - priv->default_address = (gchar *) l->data; + default_address = (const char *) l->data; break; } - if (!priv->default_address && def_address) - priv->default_address = def_address; + if (!default_address && def_address) + default_address = def_address; - if (priv->default_address) { + if (default_address) { if (!priv->comp || !e_cal_component_has_organizer (priv->comp)) { - gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), priv->default_address); + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), default_address); /* FIXME: Use accessor functions to access private members of a GtkCombo widget */ gtk_widget_set_sensitive (GTK_WIDGET (GTK_COMBO (priv->organizer)->button), !subscribed_cal); } } else g_warning ("No potential organizers!"); + + g_free (def_address); } /** @@ -2158,6 +2168,7 @@ task_page_construct (TaskPage *tpage, EMeetingStore *model, ECal *client) a = (EAccount *)e_iterator_get(it); + /* skip disabled accounts */ if (!a->enabled) continue; |