* install_test_account no longer used in modest-main.c
authorSilvan Marco Fin <silvan@kernelconcepts.de>
Fri, 9 Jun 2006 12:49:59 +0000 (12:49 +0000)
committerSilvan Marco Fin <silvan@kernelconcepts.de>
Fri, 9 Jun 2006 12:49:59 +0000 (12:49 +0000)
* 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
src/gtk-glade/modest-ui.c
src/modest-main.c

index bb97ff8..bd8369e 100644 (file)
@@ -6,6 +6,8 @@
 
 #include "modest-ui-glade.h"
 
+void wizard_account_dialog(ModestUI *);
+
 void new_wizard_account (GtkWidget *,
                          gpointer);
 
index 4d0dfa0..b33b1ce 100644 (file)
@@ -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;
 }
 
index c1fab8b..75854ed 100644 (file)
@@ -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));
 }