diff options
author | Chris Toshok <toshok@ximian.com> | 2001-12-18 09:07:25 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2001-12-18 09:07:25 +0800 |
commit | 13299ab7e073cf4d412cec019e4240a7634c1cf5 (patch) | |
tree | 054c7b410081db5f159ad03c2557bf7d15922f0b /addressbook/gui/component | |
parent | 98a2c856275ec6b1f9ce60449e7b124a1dd7e7f0 (diff) | |
download | gsoc2013-evolution-13299ab7e073cf4d412cec019e4240a7634c1cf5.tar.gz gsoc2013-evolution-13299ab7e073cf4d412cec019e4240a7634c1cf5.tar.zst gsoc2013-evolution-13299ab7e073cf4d412cec019e4240a7634c1cf5.zip |
[ fixes bug 17355 ] if we're dealing with an LDAP folder, prepend [LDAP]
2001-12-17 Chris Toshok <toshok@ximian.com>
[ fixes bug 17355 ]
* gui/component/select-names/e-select-names.c (new_folder): if
we're dealing with an LDAP folder, prepend [LDAP] to it. Now that
we have 3 different places where folders are coming from, it helps
to be able to differentiate "Contacts" in ~/evolution and a
"Contacts" ldap server and a "Contacts" exchange folder.
(add_additional_select_names_uris): loop through the bonobo conf
settings for additional folders, adding them to the option menu.
(e_select_names_hookup_shell_listeners): call
add_additional_select_names_uris.
svn path=/trunk/; revision=15143
Diffstat (limited to 'addressbook/gui/component')
-rw-r--r-- | addressbook/gui/component/select-names/e-select-names.c | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index 5d6baa26fa..1ee8d345a4 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -413,7 +413,11 @@ new_folder (EvolutionStorageListener *storage_listener, || !strcmp(folder->type, "ldap-contacts")) { ESelectNamesFolder *e_folder = g_new(ESelectNamesFolder, 1); e_folder->description = g_strdup(folder->description ); - e_folder->display_name = g_strdup(folder->displayName); + if (!strcmp (folder->type, "ldap-contacts")) + e_folder->display_name = g_strdup_printf ("%s [LDAP]", folder->displayName); + else + e_folder->display_name = g_strdup(folder->displayName); + if (!strncmp (folder->physicalUri, "file:", 5)) e_folder->uri = g_strdup_printf ("%s/addressbook.db", folder->physicalUri); else @@ -504,6 +508,57 @@ hookup_listener (ESelectNames *e_select_names, } static void +add_additional_select_names_uris (ESelectNames *e_select_names, CORBA_Environment *ev) +{ + Bonobo_ConfigDatabase config_db; + guint32 num_additional_uris; + int i; + + config_db = addressbook_config_database (ev); + + num_additional_uris = bonobo_config_get_ulong_with_default (config_db, "/Addressbook/additional_select_names_folders/num", 0, ev); + for (i = 0; i < num_additional_uris; i ++) { + ESelectNamesFolder *e_folder; + char *config_path; + char *path; + char *name; + char *uri; + + config_path = g_strdup_printf ("/Addressbook/additional_select_names_folders/folder_%d_path", i); + path = bonobo_config_get_string (config_db, config_path, ev); + g_free (config_path); + + config_path = g_strdup_printf ("/Addressbook/additional_select_names_folders/folder_%d_name", i); + name = bonobo_config_get_string (config_db, config_path, ev); + g_free (config_path); + + config_path = g_strdup_printf ("/Addressbook/additional_select_names_folders/folder_%d_uri", i); + uri = bonobo_config_get_string (config_db, config_path, ev); + g_free (config_path); + + if (!path || !name || !uri) { + g_free (path); + g_free (name); + g_free (uri); + continue; + } + + e_folder = g_new(ESelectNamesFolder, 1); + e_folder->description = g_strdup(""); + e_folder->display_name = g_strdup(name); + if (!strncmp (uri, "file:", 5)) + e_folder->uri = g_strdup_printf ("%s/addressbook.db", uri); + else + e_folder->uri = g_strdup(uri); + g_hash_table_insert(e_select_names->folders, + g_strdup(path), e_folder); + } + + if (num_additional_uris) + update_option_menu(e_select_names); +} + +static void e_select_names_hookup_shell_listeners (ESelectNames *e_select_names) { EvolutionStorage *other_contact_storage; @@ -555,6 +610,12 @@ e_select_names_hookup_shell_listeners (ESelectNames *e_select_names) hookup_listener (e_select_names, storage, e_select_names->other_contacts_listener, &ev); } + /* XXX kludge to fill in folders for the exchange plugin. we + latch onto a set of bonobo-conf settings that are + maintained by the plugin and do the right magic to get the + folders displayed in the option menu */ + add_additional_select_names_uris (e_select_names, &ev); + CORBA_exception_free(&ev); } |