diff options
author | Dan Winship <danw@src.gnome.org> | 2002-10-23 23:16:30 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2002-10-23 23:16:30 +0800 |
commit | 253ba0c94e1b6515bbba4cf710e2bf6a09ffbbbe (patch) | |
tree | b5a56fb30b570c236427f5cb4fa4163d89a776e4 /addressbook | |
parent | a668b294887993db872ba94f5ecd3f0375b8c398 (diff) | |
download | gsoc2013-evolution-253ba0c94e1b6515bbba4cf710e2bf6a09ffbbbe.tar.gz gsoc2013-evolution-253ba0c94e1b6515bbba4cf710e2bf6a09ffbbbe.tar.zst gsoc2013-evolution-253ba0c94e1b6515bbba4cf710e2bf6a09ffbbbe.zip |
Set /Addressbook/select_names_uri in the configdb to the selected folder.
* gui/component/select-names/e-select-names.c
(folder_selected): Set /Addressbook/select_names_uri in the
configdb to the selected folder.
(e_select_names_init): Look for /Addressbook/select_names_uri
before /DefaultFolders/contacts_uri for the initial folder. So the
select names dialog now starts up using the same folder you used
last time, which is useful when you have an LDAP company directory
(which can't be your default contacts folder because it's
read-only).
svn path=/trunk/; revision=18416
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 12 | ||||
-rw-r--r-- | addressbook/gui/component/select-names/e-select-names.c | 36 |
2 files changed, 31 insertions, 17 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 35b87c3459..3146b5f8f0 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,15 @@ +2002-10-22 Dan Winship <danw@ximian.com> + + * gui/component/select-names/e-select-names.c + (folder_selected): Set /Addressbook/select_names_uri in the + configdb to the selected folder. + (e_select_names_init): Look for /Addressbook/select_names_uri + before /DefaultFolders/contacts_uri for the initial folder. So the + select names dialog now starts up using the same folder you used + last time, which is useful when you have an LDAP company directory + (which can't be your default contacts folder because it's + read-only). + 2002-10-21 Dan Winship <danw@ximian.com> * gui/component/addressbook-component.c (IS_CONTACT_TYPE): fix the diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index e1251fe0f6..e592999ef1 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -338,7 +338,12 @@ static void folder_selected (EvolutionFolderSelectorButton *button, GNOME_Evolution_Folder *folder, ESelectNames *e_select_names) { + Bonobo_ConfigDatabase db; + addressbook_model_set_uri(e_select_names, e_select_names->model, folder->physicalUri); + + db = addressbook_config_database (NULL); + bonobo_config_set_string (db, "/Addressbook/select_names_uri", folder->physicalUri, NULL); } static void @@ -468,8 +473,7 @@ e_select_names_init (ESelectNames *e_select_names) GtkWidget *widget, *button; const char *selector_types[] = { "contacts/*", NULL }; char *filename; - char *uri; - char *contacts_uri, *contacts_path; + char *contacts_uri; Bonobo_ConfigDatabase db; db = addressbook_config_database (NULL); @@ -541,25 +545,24 @@ e_select_names_init (ESelectNames *e_select_names) gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(update_query), e_select_names); - contacts_path = bonobo_config_get_string_with_default (db, "/DefaultFolders/contacts_path", - "evolution:/local/Contacts", - NULL); - - filename = gnome_util_prepend_user_home("evolution/local/Contacts"); - uri = g_strdup_printf("file://%s", filename); - - contacts_uri = bonobo_config_get_string_with_default (db, "/DefaultFolders/contacts_uri", - uri, - NULL); - - g_free (filename); - g_free (uri); + contacts_uri = bonobo_config_get_string_with_default (db, "/Addressbook/select_names_uri", + NULL, NULL); + if (!contacts_uri) { + contacts_uri = bonobo_config_get_string_with_default (db, "/DefaultFolders/contacts_uri", + NULL, + NULL); + } + if (!contacts_uri) { + filename = gnome_util_prepend_user_home("evolution/local/Contacts"); + contacts_uri = g_strdup_printf("file://%s", filename); + g_free (filename); + } button = glade_xml_get_widget (gui, "folder-selector"); evolution_folder_selector_button_construct (EVOLUTION_FOLDER_SELECTOR_BUTTON (button), global_shell_client, _("Find contact in"), - contacts_path, + contacts_uri, selector_types); if (button && EVOLUTION_IS_FOLDER_SELECTOR_BUTTON (button)) gtk_signal_connect(GTK_OBJECT(button), "selected", @@ -574,7 +577,6 @@ e_select_names_init (ESelectNames *e_select_names) addressbook_model_set_uri(e_select_names, e_select_names->model, contacts_uri); g_free (contacts_uri); - g_free (contacts_path); } static void e_select_names_child_free(char *key, ESelectNamesChild *child, ESelectNames *e_select_names) |