diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-06-16 00:30:12 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-06-16 00:30:12 +0800 |
commit | b1562e75b0a51346d4a80d9799319b04ddf99cd1 (patch) | |
tree | 2b9615bd4bc21f59c7d7bf87dff07d7fdbf973a8 | |
parent | 1489dc4fd85172be1604b03666a5538ef8015bc7 (diff) | |
download | gsoc2013-evolution-b1562e75b0a51346d4a80d9799319b04ddf99cd1.tar.gz gsoc2013-evolution-b1562e75b0a51346d4a80d9799319b04ddf99cd1.tar.zst gsoc2013-evolution-b1562e75b0a51346d4a80d9799319b04ddf99cd1.zip |
cal-config-caldav: Hide host details for collection members.
-rw-r--r-- | modules/cal-config-caldav/evolution-cal-config-caldav.c | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/modules/cal-config-caldav/evolution-cal-config-caldav.c b/modules/cal-config-caldav/evolution-cal-config-caldav.c index f6da2dfec9..2f38c4622e 100644 --- a/modules/cal-config-caldav/evolution-cal-config-caldav.c +++ b/modules/cal-config-caldav/evolution-cal-config-caldav.c @@ -209,6 +209,7 @@ cal_config_caldav_insert_widgets (ESourceConfigBackend *backend, ESource *scratch_source) { ESourceConfig *config; + ESource *collection_source; ESourceExtension *extension; ECalClientSourceType source_type; GtkWidget *widget; @@ -218,20 +219,26 @@ cal_config_caldav_insert_widgets (ESourceConfigBackend *backend, const gchar *label; const gchar *uid; - context = cal_config_caldav_context_new (backend, scratch_source); - uid = e_source_get_uid (scratch_source); config = e_source_config_backend_get_config (backend); + collection_source = e_source_config_get_collection_source (config); + + e_cal_source_config_add_offline_toggle ( + E_CAL_SOURCE_CONFIG (config), scratch_source); + + /* If this data source is a collection member, + * just add a refresh interval and skip the rest. */ + if (collection_source != NULL) { + e_source_config_add_refresh_interval (config, scratch_source); + return; + } + + uid = e_source_get_uid (scratch_source); + context = cal_config_caldav_context_new (backend, scratch_source); g_object_set_data_full ( G_OBJECT (backend), uid, context, (GDestroyNotify) cal_config_caldav_context_free); - source_type = e_cal_source_config_get_source_type ( - E_CAL_SOURCE_CONFIG (config)); - - e_cal_source_config_add_offline_toggle ( - E_CAL_SOURCE_CONFIG (config), scratch_source); - widget = gtk_entry_new (); e_source_config_insert_widget ( config, scratch_source, _("Server:"), widget); @@ -254,6 +261,9 @@ cal_config_caldav_insert_widgets (ESourceConfigBackend *backend, e_source_config_add_user_entry (config, scratch_source); + source_type = e_cal_source_config_get_source_type ( + E_CAL_SOURCE_CONFIG (config)); + switch (source_type) { case E_CAL_CLIENT_SOURCE_TYPE_EVENTS: label = _("Find Calendars"); @@ -325,10 +335,18 @@ static gboolean cal_config_caldav_check_complete (ESourceConfigBackend *backend, ESource *scratch_source) { + ESourceConfig *config; + ESource *collection_source; Context *context; const gchar *uid; gboolean complete; + config = e_source_config_backend_get_config (backend); + collection_source = e_source_config_get_collection_source (config); + + if (collection_source != NULL) + return TRUE; + uid = e_source_get_uid (scratch_source); context = g_object_get_data (G_OBJECT (backend), uid); g_return_val_if_fail (context != NULL, FALSE); |