aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/new-addressbook.c
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2003-12-01 21:21:40 +0800
committerHans Petter <hansp@src.gnome.org>2003-12-01 21:21:40 +0800
commit10c2d9dbf7617385024ba92ac158b29bb520d8e3 (patch)
tree5b98791677186956de36a2d9043d63799a3c40e2 /addressbook/gui/component/new-addressbook.c
parent8accc252992dfcd8deb55d0afe9bfe6986fa166e (diff)
downloadgsoc2013-evolution-10c2d9dbf7617385024ba92ac158b29bb520d8e3.tar
gsoc2013-evolution-10c2d9dbf7617385024ba92ac158b29bb520d8e3.tar.gz
gsoc2013-evolution-10c2d9dbf7617385024ba92ac158b29bb520d8e3.tar.bz2
gsoc2013-evolution-10c2d9dbf7617385024ba92ac158b29bb520d8e3.tar.lz
gsoc2013-evolution-10c2d9dbf7617385024ba92ac158b29bb520d8e3.tar.xz
gsoc2013-evolution-10c2d9dbf7617385024ba92ac158b29bb520d8e3.tar.zst
gsoc2013-evolution-10c2d9dbf7617385024ba92ac158b29bb520d8e3.zip
Remove addressbook-storage.[ch] and new-addressbook.[ch].
2003-12-01 Hans Petter Jansson <hpj@ximian.com> * gui/component/Makefile.am (libevolution_addressbook_la_SOURCES): Remove addressbook-storage.[ch] and new-addressbook.[ch]. * gui/component/addressbook-storage.[ch]: Removed from repository. * gui/component/new-addressbook.[ch]: Removed from repository. * gui/component/addressbook-component.c (load_uri_for_selection): Set source_uid property on view control, not folder_uri. (new_addressbook_cb): Call addressbook_config_create_new_source (). (edit_addressbook_cb): Implement. (fill_popup_menu_callback): Hook up edit_addressbook_cb (). (addressbook_component_init): Create the LDAP source group. * gui/component/addressbook-config.c (AddressbookSourceDialog): Take out the NEW_ADVANCED_UI stuff and add ESource related vars. (ldap_unparse_auth) (ldap_parse_auth) (ldap_unparse_scope) (ldap_unparse_ssl) (ldap_parse_ssl): Moved here from addressbook-storage.c. (addressbook_dialog_get_source) (addressbook_dialog_set_source) (objectclasses_create_server_table) (objectclasses_create_evolution_table) (objectclasses_add_foreach) (objectclasses_add) (objectclasses_sever_double_click) (objectclasses_remove_foreach) (objectclasses_remove) (objectclasses_evolution_double_click) (objectclasses_restore_default) (server_selection_model_changed) (evolution_selection_model_changed) (setup_objectclasses_tab): Nuke aging, unfinished NEW_ADVANCED_UI. (add_source_clicked) (edit_source_clicked) (delete_server) (delete_source_clicked) (ldap_config_control_destroy_callback) (ldap_config_control_apply_callback) (sources_selection_changed) (sources_table_row_activated) (ldap_dialog_new) (addressbook_dialog_create_sources_table) (ldap_config_control_new) (addressbook_config_control_new): Nuke config control. (create_source_dir) (dialog_to_source) (dialog_to_temp_source) (source_to_uri_parts) (source_to_dialog) (source_group_changed_cb) (source_group_menu_add_groups) (folder_page_forward) (finish_page_back): Implement. (addressbook_ldap_init): Take ESource instead of AddressbookSource. (addressbook_ldap_auth): Don't take a source, not needed. (addressbook_root_dse_query): Ditto. (addressbook_source_dialog_destroy): Clean up destroy function. (addressbook_add_server_druid_finish): Clean up, create ESource. (general_tab_check): If it's not LDAP, these options don't matter. (do_ldap_root_dse_query): Source no longer needed here. (query_for_supported_bases): Use a temp source generated from current dialog settings. (display_name_page_prepare): Renamed to folder_page_prepare (). (druid_display_name_page_modify_cb): Renamed to druid_folder_page_modify_cb (). (addressbook_add_server_druid): Set up source list, group selector. Make LDAP pages optional, dependent on selected group. Use ESource. (edit_dialog_store_change): Remove config control list stuff, export settings to ESource. (addressbook_edit_server_dialog): Renamed to addressbook_config_edit_source (), which takes an ESource. Remove config control list stuff, make LDAP pages show up only if we have an LDAP source. Remove NEW_ADVANCED_UI cruft. (addressbook_config_create_new_source): Just call addressbook_add_server_druid (). * gui/component/addressbook-config.h: Move LDAP enums here, from addressbook-storage.h. * gui/component/addressbook.c (control_activate_cb): uri -> source (addressbook_view_clear): Unref source list. (book_open_cb): Use ESource. (load_uri_auth_cb): Renamed to load_source_auth_cb (), manipulate ESource instead of URI. (get_remember_password): Implement. (set_remember_password): Implement. (addressbook_authenticate): Use ESource properties. (load_uri_cb): Renamed to load_source_cb (), ESource adaptation. (addressbook_load_uri): Renamed to addressbook_load_source (), takes ESource. (addressbook_load_default_book): ESource adaptation. (get_prop): folder_uri property -> source_uid property. (set_prop): folder_uri property -> source_uid property. Find ESource by UID. (addressbook_new_control): Set up source_uid property and ESourceList. * gui/component/component-factory.c (factory): Disable config control. * gui/component/ldap-config.glade: Druid and notebook dialogs generalized to deal with local sources as well as LDAP. This file should probably be renamed... * gui/component/select-names/e-select-names-manager.c (load_completion_books): Use addressbook_load_source (). However, this needs a bit more work to get source UIDs instead of URIs. * gui/component/select-names/e-select-names.c (addressbook_model_set_uri): Use addressbook_load_source (). However, this needs a bit more work to get source UIDs instead of URIs. svn path=/trunk/; revision=23521
Diffstat (limited to 'addressbook/gui/component/new-addressbook.c')
-rw-r--r--addressbook/gui/component/new-addressbook.c158
1 files changed, 0 insertions, 158 deletions
diff --git a/addressbook/gui/component/new-addressbook.c b/addressbook/gui/component/new-addressbook.c
deleted file mode 100644
index 4323ca6b1c..0000000000
--- a/addressbook/gui/component/new-addressbook.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* new-addressbook.c - Create a new addressbook
- *
- * Copyright (C) 2003 Novell, Inc.
- *
- * Author: Hans Petter Jansson <hpj@ximian.com>
- *
- * 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 <bonobo/bonobo-i18n.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtkoptionmenu.h>
-#include <glade/glade.h>
-#include <libedataserver/e-source-list.h>
-#include <e-util/e-dialog-utils.h>
-#include <e-util/e-url.h>
-#include "new-addressbook.h"
-
-static gboolean
-create_new_source_with_group (GtkWindow *parent,
- ESourceGroup *group,
- const char *source_name,
- const char *source_location)
-{
- ESource *source;
- char *new_dir;
-
- if (e_source_group_peek_source_by_name (group, source_name)) {
- e_notice (parent, GTK_MESSAGE_ERROR,
- _("Source with name '%s' already exists in the selected group"),
- source_name);
- return FALSE;
- }
-
- /* Local source */
-
- new_dir = g_build_filename (e_source_group_peek_base_uri (group),
- source_name, NULL);
- if (e_mkdir_hier (new_dir, 0700)) {
- g_free (new_dir);
- e_notice (parent, GTK_MESSAGE_ERROR,
- _("Could not create directory for new calendar"));
- return FALSE;
- }
-
- source = e_source_new (source_name, source_name);
- g_free (new_dir);
-
- e_source_group_add_source (group, source, -1);
- return TRUE;
-}
-
-/**
- * new_calendar_dialog
- *
- * Displays a dialog that allows the user to create a new calendar.
- */
-gboolean
-new_addressbook_dialog (GtkWindow *parent)
-{
- GtkWidget *dialog, *ab_group, *ab_name, *ab_location;
- GladeXML *xml;
- ESourceList *source_list;
- GConfClient *gconf_client;
- GSList *groups, *sl;
- gboolean result = FALSE, retry = TRUE;
-
- /* load the Glade file */
- xml = glade_xml_new (EVOLUTION_GLADEDIR "/new-addressbook.glade", "new-addressbook-dialog", NULL);
- if (!xml) {
- g_warning (G_STRLOC ": cannot load Glade file");
- return FALSE;
- }
-
- dialog = glade_xml_get_widget (xml, "new-addressbook-dialog");
- ab_group = glade_xml_get_widget (xml, "addressbook-group");
- ab_name = glade_xml_get_widget (xml, "addressbook-name");
-
- /* set up widgets */
- gconf_client = gconf_client_get_default ();
- source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/addressbook/sources");
-
- groups = e_source_list_peek_groups (source_list);
- for (sl = groups; sl != NULL; sl = sl->next) {
- GtkWidget *menu_item, *menu;
- ESourceGroup *group = sl->data;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (ab_group));
- if (!GTK_IS_MENU (menu)) {
- menu = gtk_menu_new ();
- gtk_option_menu_set_menu (GTK_OPTION_MENU (ab_group), menu);
- gtk_widget_show (menu);
- }
-
- menu_item = gtk_menu_item_new_with_label (e_source_group_peek_name (group));
- gtk_widget_show (menu_item);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
- }
-
- if (groups)
- gtk_option_menu_set_history (GTK_OPTION_MENU (ab_group), 0);
-
- /* run the dialog */
- do {
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
- const char *name;
- const char *location;
-
- name = gtk_entry_get_text (GTK_ENTRY (ab_name));
- location = gtk_entry_get_text (GTK_ENTRY (ab_location));
- sl = g_slist_nth (groups, gtk_option_menu_get_history (GTK_OPTION_MENU (ab_group)));
- if (sl) {
- if (create_new_source_with_group (GTK_WINDOW (dialog),
- sl->data,
- name,
- location))
- retry = FALSE;
- } else {
- e_notice (dialog, GTK_MESSAGE_ERROR,
- _("A group must be selected"));
- continue;
- }
- } else
- retry = FALSE; /* user pressed Cancel */
- } while (retry);
-
- /* free memory */
- g_object_unref (gconf_client);
- g_object_unref (source_list);
- gtk_widget_destroy (dialog);
-
- /* free memory */
- g_object_unref (xml);
-
- return result;
-}