Fixes NB#125952, "lose changes confirmation dialog" is now modal do easysetup wizard...
[modest] / src / hildon2 / modest-easysetup-wizard-dialog.c
index ff63170..de573a7 100644 (file)
@@ -369,8 +369,9 @@ create_captioned (ModestEasysetupWizardDialog *self,
 {
 
        GtkWidget *result;
-       result = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
-                                                     value, use_markup, control);
+       result = modest_maemo_utils_create_captioned_with_size_type (title_size_group, value_size_group,
+                                                                    value, use_markup, control,
+                                                                    MODEST_EDITABLE_SIZE);
 
        /* Connect to the appropriate changed signal for the widget,
         * so we can ask for the prev/next buttons to be enabled/disabled appropriately:
@@ -607,12 +608,19 @@ on_user_username_changed(GtkWidget* widget, ModestEasysetupWizardDialog *self)
                MODEST_PROVIDER_PICKER (priv->account_serviceprovider_picker));
 
        if (provider_id) {
+               const gchar *current_username;
                gchar *email_address;
                gchar *domain_name = modest_presets_get_domain (priv->presets, provider_id);
 
-               email_address = g_strdup_printf ("%s@%s",
-                                                hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_username)),
-                                                domain_name);
+               current_username = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_username));
+
+               if (current_username && strstr (current_username, "@")) {
+                       email_address = g_strdup (current_username);
+               } else {
+                       email_address = g_strdup_printf ("%s@%s",
+                                                        current_username,
+                                                        domain_name);
+               }
 
                /* Update the email address */
                hildon_entry_set_text (HILDON_ENTRY (priv->entry_user_email), email_address);
@@ -1222,12 +1230,17 @@ on_response_before (ModestWizardDialog *wizard_dialog,
                /* This is mostly copied from
                 * src/maemo/modest-account-settings-dialog.c */
                if (priv->dirty) {
-                       GtkDialog *dialog = GTK_DIALOG (hildon_note_new_confirmation (GTK_WINDOW (self),
-                               _("imum_nc_wizard_confirm_lose_changes")));
-                       /* TODO: These button names will be ambiguous, and not
-                        * specified in the UI specification. */
+                       gint dialog_response;
+                       GtkWidget *dialog;
+
+                       dialog = hildon_note_new_confirmation ((GtkWindow *) self,
+                                                              _("imum_nc_wizard_confirm_lose_changes"));
 
-                       const gint dialog_response = gtk_dialog_run (dialog);
+                       modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+                                                    (GtkWindow *) dialog,
+                                                    (GtkWindow *) wizard_dialog);
+
+                       dialog_response = gtk_dialog_run ((GtkDialog *) dialog);
                        gtk_widget_destroy (GTK_WIDGET (dialog));
 
                        if (dialog_response != GTK_RESPONSE_OK) {
@@ -1346,11 +1359,15 @@ modest_easysetup_wizard_dialog_append_page (GtkNotebook *notebook,
                                            const gchar *label)
 {
        gint index;
+
        /* Append page and set attributes */
        index = gtk_notebook_append_page (notebook, page, gtk_label_new (label));
        gtk_container_child_set (GTK_CONTAINER (notebook), page,
                                 "tab-expand", TRUE, "tab-fill", TRUE,
                                 NULL);
+
+       /* Give focus to page and show it */
+       gtk_container_set_focus_child (GTK_CONTAINER (notebook), page);
        gtk_widget_show (page);
 }
 
@@ -2316,6 +2333,11 @@ save_to_settings (ModestEasysetupWizardDialog *self)
        modest_account_settings_set_display_name (priv->settings, display_name);
        g_free (display_name);
        g_free (provider_id);
+
+       /* This values are hardcoded for Fremantle */
+       modest_account_settings_set_retrieve_type (priv->settings,
+                                                  MODEST_ACCOUNT_RETRIEVE_MESSAGES_AND_ATTACHMENTS);
+       modest_account_settings_set_retrieve_limit (priv->settings, 20);
 }