/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Authors: * Jeffrey Stedfast * Dan Winship * Iain Holmes * * Copyright 2001 Ximian, Inc. (www.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 #endif #include #include #include #include #include #include #include #include #include #include #include #include "mail-config-druid.h" #include "mail-config.h" #include "mail-ops.h" #include "mail.h" #include "mail-session.h" #include #include #include #include #include #include static void mail_config_druid_class_init (MailConfigDruidClass *class); static void mail_config_druid_finalize (GtkObject *obj); static GtkWindowClass *parent_class; /* These globals need fixed FIXME FIXME FIXME FIXME*/ static GHashTable *page_hash = NULL; static GList *page_list = NULL; static EvolutionWizard *account_wizard; #define WIZARD_IID "OAFIID:GNOME_Evolution_Mail_Wizard_Factory" typedef enum { MAIL_CONFIG_WIZARD_PAGE_NONE = -1, MAIL_CONFIG_WIZARD_PAGE_IDENTITY, MAIL_CONFIG_WIZARD_PAGE_SOURCE, MAIL_CONFIG_WIZARD_PAGE_EXTRA, MAIL_CONFIG_WIZARD_PAGE_TRANSPORT, MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT, } MailConfigWizardPage; typedef struct { MailAccountGui *gui; MailConfigAccount *account; EvolutionWizard *wizard; gboolean identity_copied; CamelProvider *last_source; MailConfigWizardPage page; } MailConfigWizard; GtkType mail_config_druid_get_type (void) { static GtkType type = 0; if (!type) { GtkTypeInfo type_info = { "MailConfigDruid", sizeof (MailConfigDruid), sizeof (MailConfigDruidClass), (GtkClassInitFunc) mail_config_druid_class_init, (GtkObjectInitFunc) NULL, (GtkArgSetFunc) NULL, (GtkArgGetFunc) NULL }; type = gtk_type_unique (gtk_window_get_type (), &type_info); } return type; } static void mail_config_druid_class_init (MailConfigDruidClass *class) { GtkObjectClass *object_class; object_class = (GtkObjectClass *) class; parent_class = gtk_type_class (gtk_window_get_type ()); /* override methods */ object_class->finalize = mail_config_druid_finalize; } static void mail_config_druid_finalize (GtkObject *obj) { MailConfigDruid *druid = (MailConfigDruid *) obj; CORBA_Environment ev; gtk_object_destroy (GTK_OBJECT (druid->xml)); CORBA_exception_init (&ev); Bonobo_EventSource_removeListener ((Bonobo_EventSource) druid->event_source, druid->id, &ev); CORBA_exception_free (&ev); bonobo_object_release_unref ((Bonobo_Unknown) druid->event_source, &ev); bonobo_object_unref (BONOBO_OBJECT (druid->listener)); ((GtkObjectClass *)(parent_class))->finalize (obj); } static struct { char *name; char *text; } info[] = { { "identity_html", N_("Please enter your name and email address below. The \"optional\" fields below do not need to be filled in,\nunless you wish to include this information in email you send.") }, { "source_html", N_("Please enter information about your incoming mail server below. If you are not sure, ask your system\nadministrator or Internet Service Provider.") }, { "extra_html", N_("Please select among the following options") }, { "transport_html", N_("Please enter information about the way you will send mail. If you are not sure, ask your system\nadministrator or Internet Service Provider.") }, { "management_html", N_("You are almost done with the mail configuration process. The identity, incoming mail server and\noutgoing mail transport method which you provided will be grouped together to\nmake an Evolution mail account. Please enter a name for this account in the space below.\nThis name will be used for display purposes only.") } }; static int num_info = (sizeof (info) / sizeof (info[0])); static GtkWidget * create_label (const char *name) { GtkWidget *widget, *align; int i; for (i = 0; i < num_info; i++) { if (!strcmp (name, info[i].name)) break; } g_return_val_if_fail (i != num_info, NULL); widget = gtk_label_new (_(info[i].text)); align = gtk_alignment_new (0.0, 0.5, 1.0, 1.0); gtk_container_add (GTK_CONTAINER (align), widget); gtk_widget_show_all (align); return align; } static void druid_cancel (GnomeDruid *druid, gpointer user_data) { MailConfigDruid *config = user_data; GNOME_Evolution_Wizard wiz; CORBA_Environment ev; wiz = bonobo_object_corba_objref (BONOBO_OBJECT (account_wizard)); CORBA_exception_init (&ev); GNOME_Evolution_Wizard_notifyAction (wiz, 0, GNOME_Evolution_Wizard_CANCEL, &ev); CORBA_exception_free (&ev); if (page_list != NULL) { g_list_free (page_list); page_list = NULL; } if (page_hash != NULL) { g_hash_table_destroy (page_hash); page_hash = NULL; } gtk_widget_destroy (GTK_WIDGET (config)); } static void druid_finish (GnomeDruidPage *page, gpointer arg1, gpointer user_data) { MailConfigDruid *druid = user_data; gtk_object_set_data (GTK_OBJECT (account_wizard), "account-data", NULL); if (page_list != NULL) { g_list_free (page_list); page_list = NULL; } if (page_hash != NULL) { g_hash_table_destroy (page_hash); page_hash = NULL; } gtk_widget_destroy (GTK_WIDGET (druid)); } /* Identity Page */ static void identity_changed (GtkWidget *widget, gpointer data) { MailConfigWizard *gui = data; GtkWidget *incomplete; gboolean next_sensitive; if (gui->page != MAIL_CONFIG_WIZARD_PAGE_IDENTITY) return; next_sensitive = mail_account_gui_identity_complete (gui->gui, &incomplete); evolution_wizard_set_buttons_sensitive (gui->wizard, TRUE, next_sensitive, TRUE, NULL); if (!next_sensitive) gtk_widget_grab_focus (incomplete); } static void identity_prepare (EvolutionWizard *wizard, gpointer data) { MailConfigWizard *gui = data; const char *name; gui->page = MAIL_CONFIG_WIZARD_PAGE_IDENTITY; name = gtk_entry_get_text (gui->gui->full_name); if (!name) { name = g_get_real_name (); gtk_entry_set_text (gui->gui->full_name, name ? name : ""); gtk_entry_select_region (gui->gui->full_name, 0, -1); } gtk_widget_grab_focus (GTK_WIDGET (gui->gui->full_name)); identity_changed (NULL, data); } static gboolean identity_next (EvolutionWizard *wizard, gpointer data) { MailConfigWizard *gui = data; if (!gui->identity_copied) { char *username; /* Copy the username part of the email address into * the Username field of the source and transport pages. */ username = gtk_entry_get_text (gui->gui->email_address); username = g_strndup (username, strcspn (username, "@")); gtk_entry_set_text (gui->gui->source.username, username); gtk_entry_set_text (gui->gui->transport.username, username); g_free (username); gui->identity_copied = TRUE; } return FALSE; } /* Incoming mail Page */ static void source_changed (GtkWidget *widget, gpointer data) { MailConfigWizard *gui = data; GtkWidget *incomplete; gboolean next_sensitive; if (gui->page != MAIL_CONFIG_WIZARD_PAGE_SOURCE) return; next_sensitive = mail_account_gui_source_complete (gui->gui, &incomplete); evolution_wizard_set_buttons_sensitive (gui->wizard, TRUE, next_sensitive, TRUE, NULL); if (!next_sensitive) gtk_widget_grab_focus (incomplete); } static void source_prepare (EvolutionWizard *wizard, gpointer data) { MailConfigWizard *gui = data; gui->page = MAIL_CONFIG_WIZARD_PAGE_SOURCE; source_changed (NULL, gui); } static gboolean source_next (EvolutionWizard *wizard, gpointer data) { MailConfigWizard *gui = data; /* FIXME: if online, check that the data is good. */ if (gui->gui->source.provider && gui->gui->source.provider->extra_conf) return FALSE; /* Otherwise, skip to transport page. */ evolution_wizard_set_page (gui->wizard, MAIL_CONFIG_WIZARD_PAGE_TRANSPORT, NULL); return TRUE; } /* Extra Config Page */ static void extra_prepare (EvolutionWizard *wizard, gpointer data) { MailConfigWizard *gui = data; gui->page = MAIL_CONFIG_WIZARD_PAGE_EXTRA; if (gui->gui->source.provider != gui->last_source) { gui->last_source = gui->gui->source.provider; mail_account_gui_build_extra_conf (gui->gui, NULL); } } /* Transport Page */ static gboolean transport_next (EvolutionWizard *wizard, gpointer data) { /* FIXME: if online, check that the data is good. */ return FALSE; } static gboolean transport_back (EvolutionWizard *wizard, gpointer data) { MailConfigWizard *gui = data; if (gui->gui->source.provider && gui->gui->source.provider->extra_conf) return FALSE; else { evolution_wizard_set_page (wizard, MAIL_CONFIG_WIZARD_PAGE_SOURCE, NULL); return TRUE; } } static void transport_changed (GtkWidget *widget, gpointer data) { MailConfigWizard *gui = data; GtkWidget *incomplete; gboolean next_sensitive; if (gui->page != MAIL_CONFIG_WIZARD_PAGE_TRANSPORT) return; next_sensitive = mail_account_gui_transport_complete (gui->gui, &incomplete); evolution_wizard_set_buttons_sensitive (gui->wizard, TRUE, next_sensitive, TRUE, NULL); if (!next_sensitive) gtk_widget_grab_focus (incomplete); } static void transport_prepare (EvolutionWizard *wizard, gpointer data) { MailConfigWizard *gui = data; gui->page = MAIL_CONFIG_WIZARD_PAGE_TRANSPORT; transport_changed (NULL, data); } /* Management page */ static void management_check (MailConfigWizard *wizard) { gboolean next_sensitive; char *text; text = gtk_entry_get_text (wizard->gui->account_name); next_sensitive = text && *text; /* no accounts with the same name */ if (next_sensitive && mail_config_get_account_by_name (text)) next_sensitive = FALSE; evolution_wizard_set_buttons_sensitive (wizard->wizard, TRUE, next_sensitive, TRUE, NULL); } static void management_prepare (EvolutionWizard *wizard, gpointer data) { MailConfigWizard *gui = data; const char *name; gui->page = MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT; name = gtk_entry_get_text (gui->gui->email_address); if (name && *name) { if (mail_config_get_account_by_name (name)) { char *template; unsigned int i = 1, len; /* length of name + 1 char for ' ' + 1 char for '(' + 10 chars for %d + 1 char for ')' + 1 char for nul */ len = strlen (name); template = alloca (len + 14); strcpy (template, name); name = template; do { sprintf (template + len, " (%d)", i++); } while (mail_config_get_account_by_name (name) && i != 0); } gtk_entry_set_text (gui->gui->account_name, name); } management_check (gui); } static void management_changed (GtkWidget *widget, gpointer data) { MailConfigWizard *gui = data; if (gui->page != MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT) return; management_check (gui); gtk_widget_grab_focus (GTK_WIDGET (gui->gui->account_name)); } static MailConfigAccount * make_account (void) { MailConfigAccount *account; char *name, *user; struct utsname uts; account = g_new0 (MailConfigAccount, 1); account->id = g_new0 (MailConfigIdentity, 1); name = g_get_real_name (); account->id->name = e_utf8_from_locale_string (name); user = g_get_user_name (); if (user && !uname (&uts) && strchr (uts.nodename, '.')) account->id->address = g_strdup_printf ("%s@%s", user, uts.nodename); if (mail_config_get_default_transport ()) account->transport = service_copy (mail_config_get_default_transport ()); return account; } static const char *pages[] = { "identity_page", "source_page", "extra_page", "transport_page", "management_page", "finish_page", NULL }; static int page_to_num (gpointer page) { gpointer r; r = g_hash_table_lookup (page_hash, page); if (r == NULL) { return 0; } return GPOINTER_TO_INT (r); } static gboolean next_func (GnomeDruidPage *page, GnomeDruid *druid, gpointer data) { GNOME_Evolution_Wizard wiz; CORBA_Environment ev; int pagenum; wiz = bonobo_object_corba_objref (BONOBO_OBJECT (account_wizard)); CORBA_exception_init (&ev); pagenum = page_to_num (page); GNOME_Evolution_Wizard_notifyAction (wiz, pagenum, GNOME_Evolution_Wizard_NEXT, &ev); CORBA_exception_free (&ev); if (pagenum < 5-1) return TRUE; return FALSE; } static gboolean prepare_func (GnomeDruidPage *page, GnomeDruid *druid, gpointer data) { GNOME_Evolution_Wizard wiz; CORBA_Environment ev; int pagenum; wiz = bonobo_object_corba_objref (BONOBO_OBJECT (account_wizard)); CORBA_exception_init (&ev); pagenum = page_to_num (page); GNOME_Evolution_Wizard_notifyAction (wiz, pagenum, GNOME_Evolution_Wizard_PREPARE, &ev); CORBA_exception_free (&ev); return FALSE; } static gboolean back_func (GnomeDruidPage *page, GnomeDruid *druid, gpointer data) { GNOME_Evolution_Wizard wiz; CORBA_Environment ev; int pagenum; wiz = bonobo_object_corba_objref (BONOBO_OBJECT (account_wizard)); CORBA_exception_init (&ev); pagenum = page_to_num (page); GNOME_Evolution_Wizard_notifyAction (wiz, pagenum, GNOME_Evolution_Wizard_BACK, &ev); CORBA_exception_free (&ev); if (pagenum > 0) return TRUE; return FALSE; } static gboolean finish_func (GnomeDruidPage *page, GnomeDruid *druid, gpointer data) { GNOME_Evolution_Wizard wiz; CORBA_Environment ev; int pagenum; wiz = bonobo_object_corba_objref (BONOBO_OBJECT (account_wizard)); CORBA_exception_init (&ev); pagenum = page_to_num (page); GNOME_Evolution_Wizard_notifyAction (wiz, 0, GNOME_Evolution_Wizard_FINISH, &ev); CORBA_exception_free (&ev); druid_finish (page, druid, data); return FALSE; } static void wizard_listener_event (BonoboListener *listener, char *event_name, BonoboArg *event_data, CORBA_Environment *ev, MailConfigDruid *druid) { CORBA_short buttons, pagenum; GnomeDruidPage *page; if (strcmp (event_name, EVOLUTION_WIZARD_SET_BUTTONS_SENSITIVE) == 0) { buttons = (int) *((CORBA_short *)event_data->_value); gnome_druid_set_buttons_sensitive (GNOME_DRUID (druid->druid), (buttons & 4) >> 2, (buttons & 2) >> 1, (buttons & 1)); } else if (strcmp (event_name, EVOLUTION_WIZARD_SET_SHOW_FINISH) == 0) { gnome_druid_set_show_finish (GNOME_DRUID (druid->druid), (gboolean) *((CORBA_boolean *)event_data->_value)); } else if (strcmp (event_name, EVOLUTION_WIZARD_SET_PAGE) == 0) { pagenum = (int) *((CORBA_short *) event_data->_value); page = g_list_nth_data (page_list, pagenum); gnome_druid_set_page (GNOME_DRUID (druid->druid), page); } } static void construct (MailConfigDruid *druid) { GtkWidget *widget; GNOME_Evolution_Wizard corba_wizard; Bonobo_Listener corba_listener; CORBA_Environment ev; int i; /* Start account wizard */ CORBA_exception_init (&ev); corba_wizard = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Mail_Wizard", 0, NULL, &ev); CORBA_exception_free (&ev); g_assert (account_wizard != NULL); druid->xml = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", NULL); /* get our toplevel widget and reparent it */ widget = glade_xml_get_widget (druid->xml, "druid"); gtk_widget_reparent (widget, GTK_WIDGET (druid)); druid->druid = GNOME_DRUID (widget); /* set window title */ gtk_window_set_title (GTK_WINDOW (druid), _("Evolution Account Assistant")); gtk_window_set_policy (GTK_WINDOW (druid), FALSE, TRUE, FALSE); gtk_window_set_modal (GTK_WINDOW (druid), FALSE); gtk_object_set (GTK_OBJECT (druid), "type", GTK_WINDOW_DIALOG, NULL); druid->listener = bonobo_listener_new (NULL, NULL); gtk_signal_connect (GTK_OBJECT (druid->listener), "event-notify", GTK_SIGNAL_FUNC (wizard_listener_event), druid); corba_listener = bonobo_object_corba_objref (BONOBO_OBJECT (druid->listener)); CORBA_exception_init (&ev); druid->event_source = (Bonobo_Unknown) bonobo_object_query_interface ( BONOBO_OBJECT (account_wizard), "IDL:Bonobo/EventSource:1.0"); g_assert (druid->event_source != CORBA_OBJECT_NIL); druid->id = Bonobo_EventSource_addListener ((Bonobo_EventSource) druid->event_source, corba_listener, &ev); if (BONOBO_EX (&ev)) { g_warning ("Error adding listener (%s)", CORBA_exception_id (&ev)); } CORBA_exception_free (&ev); if (page_hash != NULL) { g_hash_table_destroy (page_hash); } page_hash = g_hash_table_new (NULL, NULL); for (i = 0; pages[i] != NULL; i++) { GtkWidget *page; GnomeDruidPageStandard *dpage; page = glade_xml_get_widget (druid->xml, pages[i]); /* Store pages */ g_hash_table_insert (page_hash, page, GINT_TO_POINTER (i)); page_list = g_list_append (page_list, page); gtk_signal_connect (GTK_OBJECT (page), "next", GTK_SIGNAL_FUNC (next_func), druid); gtk_signal_connect (GTK_OBJECT (page), "prepare", GTK_SIGNAL_FUNC (prepare_func), druid); gtk_signal_connect (GTK_OBJECT (page), "back", GTK_SIGNAL_FUNC (back_func), druid); gtk_signal_connect (GTK_OBJECT (page), "finish", GTK_SIGNAL_FUNC (finish_func), druid); if (i != 5) { Bonobo_Control control; GtkWidget *w; CORBA_Environment ev; dpage = GNOME_DRUID_PAGE_STANDARD (page); CORBA_exception_init (&ev); control = GNOME_Evolution_Wizard_getControl (corba_wizard, i, &ev); if (BONOBO_EX (&ev)) { g_warning ("Error getting page %d: %s", i, CORBA_exception_id (&ev)); CORBA_exception_free (&ev); continue; } w = bonobo_widget_new_control_from_objref (control, CORBA_OBJECT_NIL); gtk_box_pack_start (GTK_BOX (dpage->vbox), w, TRUE, TRUE, 0); gtk_widget_show_all (w); } } gtk_signal_connect (GTK_OBJECT (druid->druid), "cancel", druid_cancel, druid); gnome_druid_set_buttons_sensitive (druid->druid, FALSE, TRUE, TRUE); } MailConfigDruid * mail_config_druid_new (GNOME_Evolution_Shell shell) { MailConfigDruid *new; new = (MailConfigDruid *) gtk_type_new (mail_config_druid_get_type ()); construct (new); new->shell = shell; return new; } static BonoboControl * get_fn (EvolutionWizard *wizard, int page_num, void *closure) { MailConfigWizard *gui = closure; BonoboControl *control; GtkWidget *vbox, *widget; static gboolean first_time = TRUE; if (gui->gui == NULL) { if (gui->account == NULL) { gui->account = make_account (); gtk_object_set_data (GTK_OBJECT (wizard), "account-data", gui->account); } gui->gui = mail_account_gui_new (gui->account, NULL); /* set up signals, etc */ gtk_signal_connect (GTK_OBJECT (gui->gui->account_name), "changed", management_changed, gui); gtk_signal_connect (GTK_OBJECT (gui->gui->full_name), "changed", identity_changed, gui); gtk_signal_connect (GTK_OBJECT (gui->gui->email_address), "changed", identity_changed, gui); gtk_signal_connect (GTK_OBJECT (gui->gui->source.hostname), "changed", source_changed, gui); gtk_signal_connect (GTK_OBJECT (gui->gui->source.username), "changed", source_changed, gui); gtk_signal_connect (GTK_OBJECT (gui->gui->source.path), "changed", source_changed, gui); gtk_signal_connect (GTK_OBJECT (gui->gui->transport.hostname), "changed", transport_changed, gui); gtk_signal_connect (GTK_OBJECT (gui->gui->transport.username), "changed", transport_changed, gui); first_time = TRUE; } /* Fill in the druid pages */ vbox = gtk_vbox_new (FALSE, 0); switch (page_num) { case 0: widget = create_label ("identity_html"); gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0); widget = glade_xml_get_widget (gui->gui->xml, "identity_required_frame"); gtk_widget_reparent (widget, vbox); gtk_box_set_child_packing (GTK_BOX (vbox), widget, FALSE, FALSE, 0, GTK_PACK_START); widget = glade_xml_get_widget (gui->gui->xml, "identity_optional_frame"); gtk_widget_reparent (widget, vbox); gtk_box_set_child_packing (GTK_BOX (vbox), widget, FALSE, FALSE, 0, GTK_PACK_START); break; case 1: widget = create_label ("source_html"); gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0); widget = glade_xml_get_widget (gui->gui->xml, "source_vbox"); gtk_widget_reparent (widget, vbox); gtk_widget_show (widget); break; case 2: widget = create_label ("extra_html"); gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0); widget = glade_xml_get_widget (gui->gui->xml, "extra_vbox"); gtk_widget_reparent (widget, vbox); break; case 3: widget = create_label ("transport_html"); gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0); widget = glade_xml_get_widget (gui->gui->xml, "transport_vbox"); gtk_widget_reparent (widget, vbox); gtk_widget_show (widget); break; case 4: widget = glade_xml_get_widget (gui->gui->xml, "management_frame"); gtk_widget_reparent (widget, vbox); break; default: return NULL; } gtk_widget_show (vbox); control = bonobo_control_new (vbox); if (first_time) { mail_account_gui_setup (gui->gui, NULL); first_time = FALSE; } return control; } typedef gboolean (*NextFunc)(EvolutionWizard *wizard, gpointer data); static struct { NextFunc next_func; GtkSignalFunc prepare_func; NextFunc back_func; GtkSignalFunc finish_func; GtkSignalFunc help_func; } wizard_pages[] = { { identity_next, GTK_SIGNAL_FUNC (identity_prepare), NULL, GTK_SIGNAL_FUNC (NULL), GTK_SIGNAL_FUNC (NULL) }, { source_next, GTK_SIGNAL_FUNC (source_prepare), NULL, GTK_SIGNAL_FUNC (NULL), GTK_SIGNAL_FUNC (NULL) }, { NULL, GTK_SIGNAL_FUNC (extra_prepare), NULL, GTK_SIGNAL_FUNC (NULL), GTK_SIGNAL_FUNC (NULL) }, { transport_next, GTK_SIGNAL_FUNC (transport_prepare), transport_back, GTK_SIGNAL_FUNC (NULL), GTK_SIGNAL_FUNC (NULL) }, { NULL, GTK_SIGNAL_FUNC (management_prepare), NULL, GTK_SIGNAL_FUNC (NULL), GTK_SIGNAL_FUNC (NULL) } }; static void wizard_next_cb (EvolutionWizard *wizard, int page_num, MailConfigWizard *gui) { if (wizard_pages[page_num].next_func == NULL || !(wizard_pages[page_num].next_func (wizard, gui))) { if (page_num < 5-1) { evolution_wizard_set_page(wizard, page_num+1, NULL); } } } static void wizard_prepare_cb (EvolutionWizard *wizard, int page_num, MailConfigWizard *gui) { if (wizard_pages[page_num].prepare_func != NULL) { wizard_pages[page_num].prepare_func (wizard, gui); } } static void wizard_back_cb (EvolutionWizard *wizard, int page_num, MailConfigWizard *gui) { if (wizard_pages[page_num].back_func == NULL || !(wizard_pages[page_num].back_func (wizard, gui))) { if (page_num > 0) evolution_wizard_set_page(wizard, page_num-1, NULL); } } static void wizard_finish_cb (EvolutionWizard *wizard, int page_num, MailConfigWizard *w) { MailAccountGui *gui = w->gui; /* Save the settings for that account */ if (mail_account_gui_save (gui) == FALSE) /* problem. Um, how to keep the druid alive? */ return; if (gui->account->source) gui->account->source->enabled = TRUE; /* Write out the config info */ mail_config_write (); mail_account_gui_destroy (gui); w->gui = NULL; w->account = NULL; } static void wizard_cancel_cb (EvolutionWizard *wizard, int page_num, MailConfigWizard *gui) { mail_account_gui_destroy (gui->gui); gui->gui = NULL; } static void wizard_help_cb (EvolutionWizard *wizard, int page_num, MailConfigWizard *gui) { } static void wizard_free (MailConfigWizard *wizard) { if (wizard->gui) mail_account_gui_destroy (wizard->gui); if (wizard->account) account_destroy (wizard->account); g_free (wizard); } static BonoboObject * evolution_mail_config_wizard_factory_fn (BonoboGenericFactory *factory, void *closure) { EvolutionWizard *wizard; MailConfigAccount *account; MailConfigWizard *gui; account = make_account (); gui = g_new (MailConfigWizard, 1); gui->gui = NULL; gui->account = account; gui->identity_copied = FALSE; gui->last_source = NULL; gui->page = MAIL_CONFIG_WIZARD_PAGE_NONE; wizard = evolution_wizard_new (get_fn, 5, gui); account_wizard = wizard; gtk_object_set_data_full (GTK_OBJECT (account_wizard), "account-data", gui, (GtkDestroyNotify) wizard_free); gui->wizard = wizard; gtk_signal_connect (GTK_OBJECT (wizard), "next", GTK_SIGNAL_FUNC (wizard_next_cb), gui); gtk_signal_connect (GTK_OBJECT (wizard), "prepare", GTK_SIGNAL_FUNC (wizard_prepare_cb), gui); gtk_signal_connect (GTK_OBJECT (wizard), "back", GTK_SIGNAL_FUNC (wizard_back_cb), gui); gtk_signal_connect (GTK_OBJECT (wizard), "finish", GTK_SIGNAL_FUNC (wizard_finish_cb), gui); gtk_signal_connect (GTK_OBJECT (wizard), "cancel", GTK_SIGNAL_FUNC (wizard_cancel_cb), gui); gtk_signal_connect (GTK_OBJECT (wizard), "help", GTK_SIGNAL_FUNC (wizard_help_cb), gui); return BONOBO_OBJECT (wizard); } void evolution_mail_config_wizard_init (void) { BonoboGenericFactory *factory; factory = bonobo_generic_factory_new (WIZARD_IID, evolution_mail_config_wizard_factory_fn, NULL); if (factory == NULL) { g_warning ("Error starting factory"); return; } bonobo_running_context_auto_exit_unref (BONOBO_OBJECT (factory)); } tions'>-2/+14 * added $(BONOBO_CONF_LIBS) to get it to compile.Damon Chaplin2001-07-032-0/+6 * Added $(BONOBO_CONF_LIBS).Christopher James Lahey2001-07-034-12/+14 * srcdir != builddir compile fix.Peter Williams2001-07-025-0/+15 * Turned off wombatification of the categories master list here.Christopher James Lahey2001-07-022-0/+15 * use ECARD_UID_LINK_PREFIX.Chris Toshok2001-07-026-3/+73 * Added related_contacts field.Christopher James Lahey2001-07-029-140/+284 * Fall back to use the name field if all else fails (which can happen withJon Trowbridge2001-07-022-0/+10 * Fix for the "recipient not specified" bug --- we were not correctlyJon Trowbridge2001-07-022-1/+13 * Check args. Somewhere in the code (somewhere in the minicard stuff) thisJon Trowbridge2001-07-012-0/+7 * I was accidentally comparing characters and strings here, and didn't seeJon Trowbridge2001-07-012-13/+29 * Marked strings for translation.Chyla Zbigniew2001-06-302-3/+8 * Make the standard for considering two cards to be match stricter.Jon Trowbridge2001-06-309-64/+429 * Added a search field to the query here. (e_select_names_init): Update theChristopher James Lahey2001-06-304-105/+148 * Change the uri here to have addressbook.db at the end.Christopher James Lahey2001-06-303-3/+15 * Change the query when the "Update List" button is pushed.Christopher James Lahey2001-06-304-19/+70 * add EVOLUTION_IMAGESDIR define.Chris Toshok2001-06-294-1/+52 * sJose Maria Celorio2001-06-291-0/+1 * pop up list editor for lists, contact editor otherwise.Chris Toshok2001-06-295-10/+48 * remove ancient e-table include, and add include for contact-editor so weChris Toshok2001-06-294-18/+52 * add support for X-EVOLUTION-LIST and X-EVOLUTION-LIST-SHOW-ADDRESSES.Chris Toshok2001-06-293-0/+94 * Add method `ShellComponent::handleExternalURI' and anEttore Perazzoli2001-06-282-1/+8 * track storage change - we're only using 1 array now.Chris Toshok2001-06-286-76/+365 * Oops. Can't use the wombat version of the master categories list yet.Christopher James Lahey2001-06-272-2/+8 * memmove counts were off in this function. (remove_card, modify_card):Christopher James Lahey2001-06-272-5/+16 * Added a categories combo here. It's not used yet.Christopher James Lahey2001-06-274-6/+61 * Added category searching to the advanced search dialog here.Christopher James Lahey2001-06-272-0/+27 * Added category searching to the file backend.Christopher James Lahey2001-06-273-0/+39 * Capitalized fields. Added X-EVOLUTION-RELATED-CONTACTS field.Chris Lahey2001-06-271-2/+3 * libwombat:Peter Williams2001-06-272-0/+5 * Added a note about the use of this file.Chris Lahey2001-06-261-0/+5 * Added this file for fields we need to add to ECard.Chris Lahey2001-06-261-0/+3 * change layout slightly, the icon no longer pushes everything to the left,Chris Toshok2001-06-266-112/+327 * Add a huge steaming pile of code to handle the case of single-addressJon Trowbridge2001-06-254-31/+723 * correct path to libecontacteditor.a. (minicard_widget_test_LDADD): same.Chris Toshok2001-06-2537-7238/+1315 * Update the copyrights, replacing Helix Code with Ximian andEttore Perazzoli2001-06-23103-206/+206 * Renamed. (The old name, edit_contact_info_have_book_cb was a hold-overJon Trowbridge2001-06-225-52/+170 * fix a refcounting memleak.Chris Toshok2001-06-212-3/+12 * fix memory leak.Chris Toshok2001-06-212-1/+7 * add prototype for close_dialog to remove warnings.Chris Toshok2001-06-213-0/+7 * Changed attachData to accept a sequence of chars rather than a string.Dave Camp2001-06-212-3/+13 * track change to e_addressbook_show_contact_editor signature.Chris Toshok2001-06-2011-98/+82 * rename ce_book_found_fields to this, remove the fetching of fields (theChris Toshok2001-06-2021-292/+664 * Oops --- wrong e-mail address in ChangeLog entry.Jon Trowbridge2001-06-191-1/+1 * Serious de-crufting, removal of gtk_object_set_data() hacks, simplified byJon Trowbridge2001-06-195-242/+293 * tweaked for some gnome-pilot api changesEskil Heyn Olsen2001-06-192-4/+7 * implement this properly, using base and (objectclass=*).Chris Toshok2001-06-152-19/+14 * save ourselves a function call - call close_dialog instead ofChris Toshok2001-06-153-2/+7 * Set the "expoted_dnd_types" to NULL in the folder_types.Jeffrey Stedfast2001-06-152-1/+6 * Add a workaround for an EText bug. (e_select_names_completion_begin): FixDan Winship2001-06-122-3/+15 * Added e-card-merging-book-commit-duplicate-detected.glade here.Christopher James Lahey2001-06-118-19/+361 * Made e_card_simple_get_id return const char *.Christopher James Lahey2001-06-118-10/+28 * Made this handle the "id" property in searches.Christopher James Lahey2001-06-113-4/+30 * Rolled back the change 2 ago, dated 06/11/2001 01:51 in CVS, involvingChristopher James Lahey2001-06-114-101/+73 * Made it so that all of these functions queue their ops before callingChristopher James Lahey2001-06-112-16/+68 * Added this function to put a response back into the queue.Christopher James Lahey2001-06-114-62/+113 * Added this function to let you do slightly more complicated searches.Christopher James Lahey2001-06-114-6/+70 * Removed unused email variable.Christopher James Lahey2001-06-092-1/+5 * Null terminate the strv here. (e_card_locate_match): ref here instead ofChristopher James Lahey2001-06-0921-40/+512 * remove the gtk_widget_show call... (e_contact_editor_show): and put itChris Toshok2001-06-0913-326/+295 * Remove references to ECategoryMasterListWombat.Christopher James Lahey2001-06-063-12/+5 * Make this work when multiple names are selected then right click->Remove.Jason Leach2001-06-062-4/+36 * Oh yeah, the ChangeLog.Chris Lahey2001-06-06