X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-ui-actions.c;h=2bd91beb17bd890cd4763b817431b85c3c5bb06b;hb=63041ac4267e92fe3d91db4cd77b192676a65781;hp=29440a7c5a661589c89dba964624e3ca40ad621a;hpb=136e8ca91dea441e09dce25175db851c51637cb3;p=modest diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 29440a7..2bd91be 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -205,14 +205,31 @@ modest_ui_actions_on_add_to_contacts (GtkAction *action, ModestWindow *win) void modest_ui_actions_on_accounts (GtkAction *action, ModestWindow *win) { + GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr()); + + gboolean accounts_exist = account_names != NULL; + g_slist_free (account_names); + /* This is currently only implemented for Maemo, * because it requires a providers preset file which is not publically available. */ #ifdef MODEST_PLATFORM_MAEMO /* Defined in config.h */ - GtkDialog *account_win = GTK_DIALOG(modest_account_view_window_new ()); - gtk_window_set_transient_for (GTK_WINDOW (account_win), GTK_WINDOW(win)); - gtk_dialog_run (account_win); - gtk_widget_destroy (GTK_WIDGET(account_win)); + /* To test, while modest_account_mgr_account_names() is broken: accounts_exist = TRUE; */ + if (!accounts_exist) { + /* If there are no accounts yet, just show the easy-setup wizard, as per the UI spec: */ + ModestEasysetupWizardDialog *wizard = modest_easysetup_wizard_dialog_new (); + gtk_window_set_transient_for (GTK_WINDOW (wizard), GTK_WINDOW (win)); + gtk_dialog_run (GTK_DIALOG (wizard)); + gtk_widget_destroy (GTK_WIDGET (wizard)); + } + else + { + /* Show the list of accounts: */ + GtkDialog *account_win = GTK_DIALOG(modest_account_view_window_new ()); + gtk_window_set_transient_for (GTK_WINDOW (account_win), GTK_WINDOW(win)); + gtk_dialog_run (account_win); + gtk_widget_destroy (GTK_WIDGET(account_win)); + } #else GtkWidget *dialog, *label; @@ -241,20 +258,6 @@ modest_ui_actions_on_accounts (GtkAction *action, ModestWindow *win) } void -modest_ui_actions_on_new_account (GtkAction *action, ModestWindow *win) -{ - /* This is currently only implemented for Maemo, - * because it requires a providers preset file which is not publically available. - */ -#ifdef MODEST_PLATFORM_MAEMO /* Defined in config.h */ - ModestEasysetupWizardDialog *wizard = modest_easysetup_wizard_dialog_new (); - gtk_window_set_transient_for (GTK_WINDOW (wizard), GTK_WINDOW (win)); - gtk_dialog_run (GTK_DIALOG (wizard)); - gtk_widget_destroy (GTK_WIDGET (wizard)); -#endif /* MODEST_PLATFORM_MAEMO */ -} - -void modest_ui_actions_on_new_msg (GtkAction *action, ModestWindow *win) { ModestWindow *msg_win;