aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/select-names/e-select-names-config.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2003-12-06 05:46:18 +0800
committerJP Rosevear <jpr@src.gnome.org>2003-12-06 05:46:18 +0800
commit4b5f82028ea07df810b81cf04bfe9e4792e1ecb2 (patch)
treebf0683a9d181cf802f4e11ad424b1b5c31ea7518 /addressbook/gui/component/select-names/e-select-names-config.c
parentb57968e1216d9bdeddb8e6e3fbc8e61ce101cc17 (diff)
downloadgsoc2013-evolution-4b5f82028ea07df810b81cf04bfe9e4792e1ecb2.tar.gz
gsoc2013-evolution-4b5f82028ea07df810b81cf04bfe9e4792e1ecb2.tar.zst
gsoc2013-evolution-4b5f82028ea07df810b81cf04bfe9e4792e1ecb2.zip
no more custom widget for the selection of the search source
2003-12-05 JP Rosevear <jpr@ximian.com> * gui/component/select-names/select-names.glade: no more custom widget for the selection of the search source * gui/component/select-names/e-select-names.h: add member * gui/component/select-names/e-select-names.etspec: update model column * gui/component/select-names/e-select-names.c (find_first_source): find the first source in the list (addressbook_model_set_source): we have the source to set directly now (source_selected): listen for the source item to change (e_select_names_init): create a source option menu and hook it up (e_select_names_dispose): destroy the source list (e_select_names_new): do away with the config setup here * gui/component/select-names/e-select-names-manager.h: update members * gui/component/select-names/e-select-names-manager.c (update_completion_books): add books based on source uid (config_completion_books_changed_cb): handle the completion list changing (config_min_query_length_changed_cb): handle minimum query length changing (e_select_names_manager_new): we don't do the settings stuff here any more (e_select_names_manager_init): do the initial set up here for the book loaded and listen for changes (e_select_names_manager_dispose): destroy the new stuff * gui/component/select-names/e-select-names-config.[hc]: config information * gui/component/select-names/e-select-names-config-keys.h: the config keys * gui/component/select-names/e-select-names-bonobo.c (impl_SelectNames_activate_dialog): do away with the shell client stuff * gui/component/select-names/Makefile.am: build new files svn path=/trunk/; revision=23654
Diffstat (limited to 'addressbook/gui/component/select-names/e-select-names-config.c')
-rw-r--r--addressbook/gui/component/select-names/e-select-names-config.c146
1 files changed, 146 insertions, 0 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names-config.c b/addressbook/gui/component/select-names/e-select-names-config.c
new file mode 100644
index 0000000000..1792a8a061
--- /dev/null
+++ b/addressbook/gui/component/select-names/e-select-names-config.c
@@ -0,0 +1,146 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * Authors :
+ * Damon Chaplin <damon@ximian.com>
+ * Rodrigo Moya <rodrigo@ximian.com>
+ *
+ * Copyright 2000, Ximian, Inc.
+ * Copyright 2000, Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+
+#include "e-select-names-config-keys.h"
+#include "e-select-names-config.h"
+
+static GConfClient *config = NULL;
+
+static void
+do_cleanup (void)
+{
+ g_object_unref (config);
+ config = NULL;
+}
+
+static void
+e_select_names_config_init (void)
+{
+ if (config)
+ return;
+
+ config = gconf_client_get_default ();
+ g_atexit ((GVoidFunc) do_cleanup);
+
+ gconf_client_add_dir (config, SELECT_NAMES_CONFIG_PREFIX, GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
+}
+
+void
+e_select_names_config_remove_notification (guint id)
+{
+ gconf_client_notify_remove (config, id);
+}
+
+/* The current list of completion books */
+GSList *
+e_select_names_config_get_completion_books (void)
+{
+ e_select_names_config_init ();
+
+ return gconf_client_get_list (config, SELECT_NAMES_CONFIG_COMPLETION_BOOKS, GCONF_VALUE_STRING, NULL);
+}
+
+void
+e_select_names_config_set_completion_books (GSList *selected)
+{
+ e_select_names_config_init ();
+
+ gconf_client_set_list (config, SELECT_NAMES_CONFIG_COMPLETION_BOOKS, GCONF_VALUE_STRING, selected, NULL);
+}
+
+guint
+e_select_names_config_add_notification_completion_books (GConfClientNotifyFunc func, gpointer data)
+{
+ guint id;
+
+ e_select_names_config_init ();
+
+ id = gconf_client_notify_add (config, SELECT_NAMES_CONFIG_COMPLETION_BOOKS, func, data, NULL, NULL);
+
+ return id;
+}
+
+char *
+e_select_names_config_get_last_completion_book (void)
+{
+ e_select_names_config_init ();
+
+ return gconf_client_get_string (config, SELECT_NAMES_CONFIG_LAST_COMPLETION_BOOK, NULL);
+}
+
+void
+e_select_names_config_set_last_completion_book (const char *last_completion_book)
+{
+ e_select_names_config_init ();
+
+ gconf_client_set_string (config, SELECT_NAMES_CONFIG_LAST_COMPLETION_BOOK, last_completion_book, NULL);
+}
+
+guint
+e_select_names_config_add_notification_last_completion_book (GConfClientNotifyFunc func, gpointer data)
+{
+ guint id;
+
+ e_select_names_config_init ();
+
+ id = gconf_client_notify_add (config, SELECT_NAMES_CONFIG_LAST_COMPLETION_BOOK, func, data, NULL, NULL);
+
+ return id;
+}
+
+gint
+e_select_names_config_get_min_query_length (void)
+{
+ e_select_names_config_init ();
+
+ return gconf_client_get_int (config, SELECT_NAMES_CONFIG_MIN_QUERY_LENGTH, NULL);
+}
+
+
+void
+e_select_names_config_set_min_query_length (gint day_end_hour)
+{
+ e_select_names_config_init ();
+
+ gconf_client_set_int (config, SELECT_NAMES_CONFIG_MIN_QUERY_LENGTH, day_end_hour, NULL);
+}
+
+guint
+e_select_names_config_add_notification_min_query_length (GConfClientNotifyFunc func, gpointer data)
+{
+ guint id;
+
+ e_select_names_config_init ();
+
+ id = gconf_client_notify_add (config, SELECT_NAMES_CONFIG_MIN_QUERY_LENGTH, func, data, NULL, NULL);
+
+ return id;
+}