- priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE(self);
- assistant = modest_account_assistant_new (modest_runtime_get_account_mgr());
- gtk_window_set_transient_for (GTK_WINDOW(assistant),
- GTK_WINDOW(self));
-
- gtk_widget_show (GTK_WIDGET(assistant));
+ /* there is no such wizard yet */
+ wizard = GTK_DIALOG (modest_account_assistant_new (modest_runtime_get_account_mgr ()));
+ modest_window_mgr_set_modal (modest_runtime_get_window_mgr(),
+ GTK_WINDOW (wizard));
+
+ /* if there is already another modal dialog, make it non-modal */
+ if (dialog)
+ gtk_window_set_modal (GTK_WINDOW(dialog), FALSE);
+
+ gtk_window_set_modal (GTK_WINDOW (wizard), TRUE);
+ gtk_window_set_transient_for (GTK_WINDOW (wizard), GTK_WINDOW (self));
+ /* Destroy the dialog when it is closed: */
+ g_signal_connect (G_OBJECT (wizard), "response", G_CALLBACK
+ (on_wizard_response), self);
+ gtk_widget_show (GTK_WIDGET (wizard));