- if (!win)
- win = modest_window_mgr_get_main_window (modest_runtime_get_window_mgr ());
-
- g_return_val_if_fail (MODEST_IS_WINDOW(win), FALSE);
+ wizard = modest_window_mgr_get_easysetup_dialog
+ (modest_runtime_get_window_mgr());
+ if (wizard) {
+ /* old wizard is active already; present it and
+ * act as if the user cancelled the non-existing
+ * new one
+ */
+ printf ("wizard already active\n");
+ return FALSE;
+ } else {
+ /* there is no such wizard yet */
+ wizard = GTK_DIALOG(modest_easysetup_wizard_dialog_new ());
+ modest_window_mgr_set_easysetup_dialog
+ (modest_runtime_get_window_mgr(), GTK_DIALOG(wizard));
+ }
+