+ /* Check if we have at least one remote account to create also
+ the folders window */
+ acc_store = modest_runtime_get_account_store ();
+ if (modest_tny_account_store_get_num_remote_accounts (acc_store) < 1) {
+ ModestAccountMgr *mgr;
+
+ /* Show first the accounts window to add it to the
+ stack. This has to be changed when the new
+ stackable API is available. There will be a method
+ to show all the windows that will only show the
+ last one to the user. The current code shows both
+ windows, one after the other */
+ gtk_widget_show (GTK_WIDGET (initial_window));
+
+ initial_window = MODEST_WINDOW (modest_folder_window_new (NULL));
+ mgr = modest_runtime_get_account_mgr ();
+ modest_folder_window_set_account (MODEST_FOLDER_WINDOW (initial_window),
+ modest_account_mgr_get_default_account (mgr));
+ modest_window_mgr_register_window (self, initial_window, NULL);
+ }
+
+ /* Connect to the account store "account-removed" signal". If
+ we're showing the accounts window and all the accounts are
+ deleted we need to move to folders window automatically */
+ priv = MODEST_HILDON2_WINDOW_MGR_GET_PRIVATE (self);
+ priv->accounts_handler = g_signal_connect (acc_store,
+ "account-removed",
+ G_CALLBACK (on_account_removed),
+ self);
+