From e2869d83b0f48e6e9408ccdb7f1ab6b227789044 Mon Sep 17 00:00:00 2001 From: Silvan Marco Fin Date: Fri, 9 Jun 2006 12:49:59 +0000 Subject: [PATCH 1/1] * install_test_account no longer used in modest-main.c * added wizard to modest_ui_new with some reasonable testing if no accounts are defined * the wizard_dialog methos has to be exported in modest-ui-wizard.h pmo-trunk-r211 --- src/gtk-glade/modest-ui-wizard.h | 2 ++ src/gtk-glade/modest-ui.c | 10 ++++++++++ src/modest-main.c | 17 +++++++---------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/gtk-glade/modest-ui-wizard.h b/src/gtk-glade/modest-ui-wizard.h index bb97ff8..bd8369e 100644 --- a/src/gtk-glade/modest-ui-wizard.h +++ b/src/gtk-glade/modest-ui-wizard.h @@ -6,6 +6,8 @@ #include "modest-ui-glade.h" +void wizard_account_dialog(ModestUI *); + void new_wizard_account (GtkWidget *, gpointer); diff --git a/src/gtk-glade/modest-ui.c b/src/gtk-glade/modest-ui.c index 4d0dfa0..b33b1ce 100644 --- a/src/gtk-glade/modest-ui.c +++ b/src/gtk-glade/modest-ui.c @@ -196,6 +196,8 @@ modest_ui_new (ModestConf *modest_conf) ModestAccountMgr *modest_acc_mgr; ModestIdentityMgr *modest_id_mgr; TnyAccountStoreIface *account_store_iface; + GSList *account_names_list; + GSList *identities_list; g_return_val_if_fail (modest_conf, NULL); @@ -250,6 +252,14 @@ modest_ui_new (ModestConf *modest_conf) g_signal_connect (priv->modest_window_mgr, "last_window_closed", G_CALLBACK(modest_ui_last_window_closed), NULL); + + account_names_list=modest_account_mgr_server_account_names(modest_acc_mgr, NULL, MODEST_PROTO_TYPE_ANY, NULL, FALSE); + identities_list=modest_identity_mgr_identity_names(modest_id_mgr, NULL); + if (!(account_names_list!=NULL || identities_list!=NULL)) + wizard_account_dialog(obj); + g_slist_free(account_names_list); + g_slist_free(identities_list); + return obj; } diff --git a/src/modest-main.c b/src/modest-main.c index c1fab8b..75854ed 100644 --- a/src/modest-main.c +++ b/src/modest-main.c @@ -73,25 +73,22 @@ main (int argc, char *argv[]) goto cleanup; } + gtk_init (&argc, &argv); + + modest_icon_factory_init (); + if (reinstall) { modest_conf_remove_key (modest_conf, MODEST_CONF_NAMESPACE, NULL); install_basic_conf_settings (modest_conf); - install_test_account (modest_conf); goto cleanup; } - - - gtk_init (&argc, &argv); - - modest_icon_factory_init (); - modest_ui = MODEST_UI(modest_ui_new (modest_conf)); if (!modest_ui) { g_warning ("failed to initialize ui"); goto cleanup; } - + { gboolean ok; gtk_init (&argc, &argv); @@ -185,7 +182,7 @@ install_test_account (ModestConf *conf) NULL, "imap"); modest_account_mgr_add_server_account (acc_mgr, "mytransport", "localhost", NULL, NULL, "smtp"); - + } id_mgr = MODEST_IDENTITY_MGR(modest_identity_mgr_new (conf)); if (modest_identity_mgr_identity_exists(id_mgr, "myidentity", NULL)) { @@ -198,7 +195,7 @@ install_test_account (ModestConf *conf) "user@localhost", "", "", FALSE, NULL, FALSE )) g_warning ("failed to add test identity"); - + g_object_unref (G_OBJECT(acc_mgr)); g_object_unref (G_OBJECT(id_mgr)); } -- 1.7.9.5