+static gboolean
+on_timeout_show_advanced_edit(gpointer user_data)
+{
+ ModestEasysetupWizardDialog * self = MODEST_EASYSETUP_WIZARD_DIALOG (user_data);
+
+ if (!(self->saved_account_name))
+ return FALSE;
+
+ /* Show the Account Settings window: */
+ ModestAccountSettingsDialog *dialog = modest_account_settings_dialog_new ();
+ modest_account_settings_dialog_set_account_name (dialog, self->saved_account_name);
+
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (self));
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ /* TODO: The hide() is not necessary.
+ * It is just here to show that it doesn't work,
+ * just as destroy doesn't work.
+ */
+ gtk_widget_hide (GTK_WIDGET(dialog));
+
+ /* TODO: The dialog remains on screen, not allowing any interaction.
+ * But gtk_widget_destroy() should always destroy.
+ */
+ printf("debug: destroying settings dialog\n");
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+ printf("debug: after destroying settings dialog (doesn't seem to work).\n");
+
+ return FALSE; /* Do not call this timeout callback again. */
+}
+
+static void
+on_button_edit_advanced_settings (GtkButton *button, gpointer user_data)
+{
+ ModestEasysetupWizardDialog * self = MODEST_EASYSETUP_WIZARD_DIALOG (user_data);
+
+ /* Save the new account, so we can edit it with ModestAccountSettingsDialog,
+ * without recoding it to use non-gconf information.
+ * This account will be deleted if Finish is never actually clicked. */
+
+ gboolean saved = TRUE;
+ gboolean was_already_saved = TRUE;
+ if (!(self->saved_account_name)) {
+ saved = create_account (self, FALSE);
+ was_already_saved = FALSE;
+ }
+
+ if (!saved)
+ return;
+
+ if (!(self->saved_account_name))
+ return;
+
+ /* Show the Account Settings window: */
+ if (was_already_saved) {
+ /* Just show the dialog immediately: */
+ on_timeout_show_advanced_edit(self);
+ }
+ else
+ {
+ printf ("debug: waiting for gconf to update its local cache. "
+ "This is a hack to work around a maemo gconf bug in maemo bora.\n");
+
+ g_timeout_add (5000, on_timeout_show_advanced_edit, self);
+ }
+}