This is a manual merge of branch drop split view intro trunk.
[modest] / src / hildon2 / modest-easysetup-wizard-dialog.c
index c070370..8670ead 100644 (file)
@@ -58,7 +58,7 @@
 #include "modest-utils.h"
 #include "modest-hildon-includes.h"
 #include "modest-maemo-security-options-view.h"
-#include <modest-account-protocol.h>
+#include "modest-account-protocol.h"
 
 /* Include config.h so that _() works: */
 #ifdef HAVE_CONFIG_H
@@ -71,7 +71,8 @@ G_DEFINE_TYPE (ModestEasysetupWizardDialog, modest_easysetup_wizard_dialog, MODE
                                                    MODEST_TYPE_EASYSETUP_WIZARD_DIALOG, \
                                                    ModestEasysetupWizardDialogPrivate))
 
-#define LABELS_WIDTH -1
+#define LABELS_WIDTH 480
+#define DIALOG_WIDTH LABELS_WIDTH + MODEST_MARGIN_DOUBLE
 
 typedef struct _ModestEasysetupWizardDialogPrivate ModestEasysetupWizardDialogPrivate;
 
@@ -261,13 +262,15 @@ on_picker_button_value_changed (HildonPickerButton *widget, gpointer user_data)
  */
 static GtkWidget* 
 create_captioned (ModestEasysetupWizardDialog *self,
-                 GtkSizeGroup *group,
+                 GtkSizeGroup *title_size_group,
+                 GtkSizeGroup *value_size_group,
                  const gchar *value,
                  GtkWidget *control)
 {
 
        GtkWidget *result;
-       result = modest_maemo_utils_create_captioned (group, value, control);
+       result = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+                                                     value, control);
 
        /* Connect to the appropriate changed signal for the widget, 
         * so we can ask for the prev/next buttons to be enabled/disabled appropriately:
@@ -293,6 +296,7 @@ create_page_welcome (ModestEasysetupWizardDialog *self)
        gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
        /* So that it is not truncated: */
        gtk_widget_set_size_request (label, LABELS_WIDTH, -1);
+       gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
        gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
        gtk_widget_show (label);
        gtk_widget_show (GTK_WIDGET (box));
@@ -338,7 +342,7 @@ update_user_email_from_provider (ModestEasysetupWizardDialog *self)
                domain_name = g_strdup (MODEST_EXAMPLE_EMAIL_ADDRESS);
                
        if (priv->entry_user_email)
-               gtk_entry_set_text (GTK_ENTRY (priv->entry_user_email), domain_name);
+               hildon_entry_set_text (HILDON_ENTRY (priv->entry_user_email), domain_name);
                
        g_free (domain_name);
        
@@ -380,12 +384,14 @@ create_page_account_details (ModestEasysetupWizardDialog *self)
        /* Create a size group to be used by all captions.
         * Note that HildonCaption does not create a default size group if we do not specify one.
         * We use GTK_SIZE_GROUP_HORIZONTAL, so that the widths are the same. */
-       GtkSizeGroup* sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+       GtkSizeGroup* title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+       GtkSizeGroup* value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
 
        /* The country widgets: */
        priv->account_country_picker = GTK_WIDGET (modest_country_picker_new (MODEST_EDITABLE_SIZE,
-                                                                             MODEST_EDITABLE_ARRANGEMENT));
-       hildon_button_set_title (HILDON_BUTTON (priv->account_country_picker), _("mcen_fi_country"));
+                                                                             HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
+       modest_maemo_utils_set_hbutton_layout (title_sizegroup, value_sizegroup, 
+                                              _("mcen_fi_country"), priv->account_country_picker);
        g_signal_connect (G_OBJECT (priv->account_country_picker), "value-changed",
                          G_CALLBACK (on_picker_button_value_changed), self);
        gtk_box_pack_start (GTK_BOX (box), priv->account_country_picker, FALSE, FALSE, MODEST_MARGIN_HALF);
@@ -397,8 +403,10 @@ create_page_account_details (ModestEasysetupWizardDialog *self)
             
        /* The service provider widgets: */     
        priv->account_serviceprovider_picker = GTK_WIDGET (modest_provider_picker_new (MODEST_EDITABLE_SIZE,
-                                                                                      MODEST_EDITABLE_ARRANGEMENT));
-       hildon_button_set_title (HILDON_BUTTON (priv->account_serviceprovider_picker), _("mcen_fi_serviceprovider"));
+                                                                                      HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
+       modest_maemo_utils_set_hbutton_layout (title_sizegroup, value_sizegroup,
+                                              _("mcen_fi_serviceprovider"), 
+                                              priv->account_serviceprovider_picker);
        g_signal_connect (G_OBJECT (priv->account_serviceprovider_picker), "value-changed",
                          G_CALLBACK (on_picker_button_value_changed), self);
        gtk_box_pack_start (GTK_BOX (box), priv->account_serviceprovider_picker, FALSE, FALSE, MODEST_MARGIN_HALF);
@@ -420,11 +428,11 @@ create_page_account_details (ModestEasysetupWizardDialog *self)
        g_free (default_account_name_start);
        default_account_name_start = NULL;
        
-       gtk_entry_set_text( GTK_ENTRY (priv->entry_account_title), default_account_name);
+       hildon_entry_set_text (HILDON_ENTRY (priv->entry_account_title), default_account_name);
        g_free (default_account_name);
        default_account_name = NULL;
 
-       caption = create_captioned (self, sizegroup, _("mcen_fi_account_title"), 
+       caption = create_captioned (self, title_sizegroup, value_sizegroup, _("mcen_fi_account_title"), 
                                    priv->entry_account_title);
        gtk_widget_show (priv->entry_account_title);
        gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
@@ -458,6 +466,9 @@ create_page_account_details (ModestEasysetupWizardDialog *self)
                                              on_entry_max, self);
        
        gtk_widget_show (GTK_WIDGET (box));
+
+       g_object_unref (title_sizegroup);
+       g_object_unref (value_sizegroup);
        
        return GTK_WIDGET (box);
 }
@@ -465,7 +476,8 @@ create_page_account_details (ModestEasysetupWizardDialog *self)
 static GtkWidget*
 create_page_user_details (ModestEasysetupWizardDialog *self)
 {
-       GtkSizeGroup* sizegroup;
+       GtkSizeGroup* title_sizegroup;
+       GtkSizeGroup* value_sizegroup;
        GtkWidget *box;
        ModestEasysetupWizardDialogPrivate *priv;
 
@@ -475,7 +487,8 @@ create_page_user_details (ModestEasysetupWizardDialog *self)
         * Note that HildonCaption does not create a default size group if we do not specify one.
         * We use GTK_SIZE_GROUP_HORIZONTAL, so that the widths are the same. */
        box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
-       sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+       title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+       value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
         
        /* The name widgets: (use auto cap) */
        priv->entry_user_name = GTK_WIDGET (modest_validating_entry_new ());
@@ -487,7 +500,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self)
        gtk_entry_set_max_length (GTK_ENTRY (priv->entry_user_name), 64);
        modest_validating_entry_set_max_func (MODEST_VALIDATING_ENTRY (priv->entry_user_name), 
                                              on_entry_max, self);
-       GtkWidget *caption = create_captioned (self, sizegroup, 
+       GtkWidget *caption = create_captioned (self, title_sizegroup, value_sizegroup,
                                               _("mcen_li_emailsetup_name"), priv->entry_user_name);
        g_signal_connect(G_OBJECT(priv->entry_user_name), "changed", 
                         G_CALLBACK(on_easysetup_changed), self);
@@ -511,7 +524,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self)
        /* Auto-capitalization is the default, so let's turn it off: */
        hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_username), 
                                         HILDON_GTK_INPUT_MODE_FULL);
-       caption = create_captioned (self, sizegroup, _("mail_fi_username"), 
+       caption = create_captioned (self, title_sizegroup, value_sizegroup, _("mail_fi_username"), 
                                    priv->entry_user_username);
        gtk_widget_show (priv->entry_user_username);
        gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
@@ -533,13 +546,13 @@ create_page_user_details (ModestEasysetupWizardDialog *self)
                                              on_entry_max, self);
        
        /* The password widgets: */     
-       priv->entry_user_password = gtk_entry_new ();
+       priv->entry_user_password = hildon_entry_new (MODEST_EDITABLE_SIZE);
        /* Auto-capitalization is the default, so let's turn it off: */
        hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_password), 
                                         HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE);
        gtk_entry_set_visibility (GTK_ENTRY (priv->entry_user_password), FALSE);
        /* gtk_entry_set_invisible_char (GTK_ENTRY (priv->entry_user_password), '*'); */
-       caption = create_captioned (self, sizegroup, 
+       caption = create_captioned (self, title_sizegroup, value_sizegroup,
                                    _("mail_fi_password"), priv->entry_user_password);
        g_signal_connect(G_OBJECT(priv->entry_user_password), "changed", 
                         G_CALLBACK(on_easysetup_changed), self);
@@ -551,7 +564,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self)
        priv->entry_user_email = GTK_WIDGET (modest_validating_entry_new ());
        /* Auto-capitalization is the default, so let's turn it off: */
        hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_email), HILDON_GTK_INPUT_MODE_FULL);
-       caption = create_captioned (self, sizegroup, 
+       caption = create_captioned (self, title_sizegroup, value_sizegroup,
                                    _("mcen_li_emailsetup_email_address"), priv->entry_user_email);
        update_user_email_from_provider (self);
        gtk_widget_show (priv->entry_user_email);
@@ -568,6 +581,8 @@ create_page_user_details (ModestEasysetupWizardDialog *self)
        
        
        gtk_widget_show (GTK_WIDGET (box));
+       g_object_unref (title_sizegroup);
+       g_object_unref (value_sizegroup);
        
        return GTK_WIDGET (box);
 }
@@ -623,7 +638,6 @@ update_incoming_server_title (ModestEasysetupWizardDialog *self)
                protocol_display_name = modest_protocol_get_display_name (modest_protocol_registry_get_protocol_by_type (protocol_registry, protocol_type));
                
                incomingserver_title = g_strdup_printf(_("mcen_li_emailsetup_servertype"), protocol_display_name);
-               g_object_set (G_OBJECT (priv->caption_incoming), "label", incomingserver_title, NULL);
                g_free(incomingserver_title);
        }
 }
@@ -689,7 +703,8 @@ create_page_custom_incoming (ModestEasysetupWizardDialog *self)
        GtkWidget *box; 
        GtkWidget *scrolled_window;
        GtkWidget *label;
-       GtkSizeGroup *sizegroup;
+       GtkSizeGroup *title_sizegroup;
+       GtkSizeGroup *value_sizegroup;
 
        priv = MODEST_EASYSETUP_WIZARD_DIALOG_GET_PRIVATE(self);
        protocol_registry = modest_runtime_get_protocol_registry ();
@@ -711,11 +726,12 @@ create_page_custom_incoming (ModestEasysetupWizardDialog *self)
        /* Create a size group to be used by all captions.
         * Note that HildonCaption does not create a default size group if we do not specify one.
         * We use GTK_SIZE_GROUP_HORIZONTAL, so that the widths are the same. */
-       sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+       title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+       value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
         
        /* The incoming server widgets: */
        priv->incoming_servertype_picker = GTK_WIDGET (modest_servertype_picker_new (MODEST_EDITABLE_SIZE,
-                                                                                    MODEST_EDITABLE_ARRANGEMENT,
+                                                                                    HILDON_BUTTON_ARRANGEMENT_HORIZONTAL,
                                                                                     TRUE));
        hildon_button_set_title (HILDON_BUTTON (priv->incoming_servertype_picker), _("mcen_li_emailsetup_type"));
        g_signal_connect (G_OBJECT (priv->incoming_servertype_picker), "value-changed",
@@ -723,7 +739,7 @@ create_page_custom_incoming (ModestEasysetupWizardDialog *self)
        gtk_box_pack_start (GTK_BOX (box), priv->incoming_servertype_picker, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (priv->incoming_servertype_picker);
        
-       priv->entry_incomingserver = gtk_entry_new ();
+       priv->entry_incomingserver = hildon_entry_new (MODEST_EDITABLE_SIZE);
        g_signal_connect(G_OBJECT(priv->entry_incomingserver), "changed", G_CALLBACK(on_easysetup_changed), self);
        /* Auto-capitalization is the default, so let's turn it off: */
        hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_incomingserver), HILDON_GTK_INPUT_MODE_FULL);
@@ -732,7 +748,7 @@ create_page_custom_incoming (ModestEasysetupWizardDialog *self)
        /* The caption title will be updated in update_incoming_server_title().
         * so this default text will never be seen: */
        /* (Note: Changing the title seems pointless. murrayc) */
-       priv->caption_incoming = create_captioned (self, sizegroup, 
+       priv->caption_incoming = create_captioned (self, title_sizegroup, value_sizegroup,
                                                   "Incoming Server", 
                                                   priv->entry_incomingserver);
        update_incoming_server_title (self);
@@ -754,9 +770,10 @@ create_page_custom_incoming (ModestEasysetupWizardDialog *self)
           protocols with security */   
        priv->incoming_security = 
                modest_maemo_security_options_view_new (MODEST_SECURITY_OPTIONS_INCOMING,
-                                                       FALSE, sizegroup);
+                                                       FALSE, title_sizegroup, value_sizegroup);
        gtk_box_pack_start (GTK_BOX (box), priv->incoming_security, 
                            FALSE, FALSE, MODEST_MARGIN_HALF);
+       gtk_widget_show_all (priv->incoming_security);
 
        /* Set default selection */
        modest_servertype_picker_set_active_servertype (
@@ -769,29 +786,32 @@ create_page_custom_incoming (ModestEasysetupWizardDialog *self)
        gtk_widget_show (GTK_WIDGET (box));
        gtk_widget_show (scrolled_window);
 
+       g_object_unref (title_sizegroup);
+       g_object_unref (value_sizegroup);
+
        return GTK_WIDGET (scrolled_window);
 }
 
 static void
-on_toggle_button_changed (GtkToggleButton *togglebutton, gpointer user_data)
+on_check_button_changed (HildonCheckButton *button, gpointer user_data)
 {
        GtkWidget *widget = GTK_WIDGET (user_data);
        
-       /* Enable the widget only if the toggle button is active: */
-       const gboolean enable = gtk_toggle_button_get_active (togglebutton);
+       /* Enable the widget only if the check button is active: */
+       const gboolean enable = hildon_check_button_get_active (button);
        gtk_widget_set_sensitive (widget, enable);
 }
 
-/* Make the sensitivity of a widget depend on a toggle button.
+/* Make the sensitivity of a widget depend on a check button.
  */
 static void
-enable_widget_for_togglebutton (GtkWidget *widget, GtkToggleButton* button)
+enable_widget_for_checkbutton (GtkWidget *widget, HildonCheckButton* button)
 {
        g_signal_connect (G_OBJECT (button), "toggled",
-                         G_CALLBACK (on_toggle_button_changed), widget);
+                         G_CALLBACK (on_check_button_changed), widget);
        
        /* Set the starting sensitivity: */
-       on_toggle_button_changed (button, widget);
+       on_check_button_changed (button, widget);
 }
 
 static void
@@ -831,16 +851,17 @@ create_page_custom_outgoing (ModestEasysetupWizardDialog *self)
        /* Create a size group to be used by all captions.
         * Note that HildonCaption does not create a default size group if we do not specify one.
         * We use GTK_SIZE_GROUP_HORIZONTAL, so that the widths are the same. */
-       GtkSizeGroup *sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+       GtkSizeGroup *title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+       GtkSizeGroup *value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
         
        /* The outgoing server widgets: */
        priv = MODEST_EASYSETUP_WIZARD_DIALOG_GET_PRIVATE (self);
-       priv->entry_outgoingserver = gtk_entry_new ();
+       priv->entry_outgoingserver = hildon_entry_new (MODEST_EDITABLE_SIZE);
        g_signal_connect (G_OBJECT (priv->entry_outgoingserver), "changed",
                   G_CALLBACK (on_easysetup_changed), self);
        /* Auto-capitalization is the default, so let's turn it off: */
        hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_outgoingserver), HILDON_GTK_INPUT_MODE_FULL);
-       GtkWidget *caption = create_captioned (self, sizegroup, 
+       GtkWidget *caption = create_captioned (self, title_sizegroup, value_sizegroup,
                                               _("mcen_li_emailsetup_smtp"), priv->entry_outgoingserver);
        gtk_widget_show (priv->entry_outgoingserver);
        gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
@@ -851,49 +872,51 @@ create_page_custom_outgoing (ModestEasysetupWizardDialog *self)
           protocols with security */   
        priv->outgoing_security = 
                modest_maemo_security_options_view_new (MODEST_SECURITY_OPTIONS_OUTGOING,
-                                                       FALSE, sizegroup);
+                                                       FALSE, title_sizegroup, value_sizegroup);
        gtk_box_pack_start (GTK_BOX (box), priv->outgoing_security, 
                            FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (priv->outgoing_security);
-       
+
        GtkWidget *separator = gtk_hseparator_new ();
        gtk_box_pack_start (GTK_BOX (box), separator, FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (separator);
-       
+
        /* connection-specific checkbox: */
-       priv->checkbox_outgoing_smtp_specific = gtk_check_button_new ();
-       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->checkbox_outgoing_smtp_specific), 
-                                     FALSE);
+       priv->checkbox_outgoing_smtp_specific = hildon_check_button_new (HILDON_SIZE_FINGER_HEIGHT);
+       hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->checkbox_outgoing_smtp_specific), 
+                                       FALSE);
+       gtk_button_set_label (GTK_BUTTON (priv->checkbox_outgoing_smtp_specific),
+                             _("mcen_fi_advsetup_connection_smtp"));
+       gtk_button_set_alignment (GTK_BUTTON (priv->checkbox_outgoing_smtp_specific),
+                                 0.0, 0.5);
        g_signal_connect (G_OBJECT (priv->checkbox_outgoing_smtp_specific), "toggled",
                   G_CALLBACK (on_easysetup_changed), self);
 
-       caption = modest_maemo_utils_create_captioned (sizegroup, _("mcen_fi_advsetup_connection_smtp"), 
-                                                      priv->checkbox_outgoing_smtp_specific);
        gtk_widget_show (priv->checkbox_outgoing_smtp_specific);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
-       gtk_widget_show (caption);
-       
+       gtk_box_pack_start (GTK_BOX (box), priv->checkbox_outgoing_smtp_specific,
+                           FALSE, FALSE, MODEST_MARGIN_HALF);
+
        /* Connection-specific SMTP-Severs Edit button: */
-       priv->button_outgoing_smtp_servers = gtk_button_new_with_label (_("mcen_bd_edit"));
-       caption = modest_maemo_utils_create_captioned (sizegroup, _("mcen_fi_advsetup_optional_smtp"), 
-                                                      priv->button_outgoing_smtp_servers);
-       hildon_caption_set_child_expand (HILDON_CAPTION (caption), FALSE);
+       priv->button_outgoing_smtp_servers = gtk_button_new_with_label (_("mcen_bd_advsetup_optional_smtp"));
+       hildon_gtk_widget_set_theme_size (priv->button_outgoing_smtp_servers, 
+                                         HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);  
        gtk_widget_show (priv->button_outgoing_smtp_servers);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
-       gtk_widget_show (caption);
-       
+       gtk_box_pack_start (GTK_BOX (box), priv->button_outgoing_smtp_servers, 
+                           FALSE, FALSE, MODEST_MARGIN_HALF);
+
        /* Only enable the button when the checkbox is checked: */
-       enable_widget_for_togglebutton (priv->button_outgoing_smtp_servers, 
-                                       GTK_TOGGLE_BUTTON (priv->checkbox_outgoing_smtp_specific));
-               
+       enable_widget_for_checkbutton (priv->button_outgoing_smtp_servers, 
+                                      HILDON_CHECK_BUTTON (priv->checkbox_outgoing_smtp_specific));
+
        g_signal_connect (G_OBJECT (priv->button_outgoing_smtp_servers), "clicked",
                          G_CALLBACK (on_button_outgoing_smtp_servers), self);
 
        g_signal_connect (G_OBJECT (priv->entry_outgoingserver), "changed",
                          G_CALLBACK (on_entry_outgoing_servername_changed), self);
-       
-       
        gtk_widget_show (GTK_WIDGET (box));
+
+       g_object_unref (title_sizegroup);
+       g_object_unref (value_sizegroup);
        
        return GTK_WIDGET (box);
 }
@@ -935,7 +958,8 @@ create_page_complete_custom (ModestEasysetupWizardDialog *self)
 {
        GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
        GtkWidget *label = gtk_label_new(_("mcen_ia_emailsetup_setup_complete"));
-       GtkWidget *button_edit = gtk_button_new_with_label (_("mcen_bd_edit"));
+       GtkWidget *button_edit = gtk_button_new_with_label (_("mcen_fi_advanced_settings"));
+       hildon_gtk_widget_set_theme_size (button_edit, HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
        gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
        gtk_widget_set_size_request (label, LABELS_WIDTH, -1);
        gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
@@ -943,18 +967,14 @@ create_page_complete_custom (ModestEasysetupWizardDialog *self)
        gtk_widget_show (label);
        
        label = gtk_label_new (_("mcen_ia_customsetup_complete"));
-       gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+       gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
        gtk_widget_set_size_request (label, LABELS_WIDTH, -1);
        gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-       gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
        gtk_widget_show (label);
        
-       GtkWidget *caption = modest_maemo_utils_create_captioned (NULL, _("mcen_fi_advanced_settings"), 
-                                                                 button_edit);
-       hildon_caption_set_child_expand (HILDON_CAPTION (caption), FALSE);
        gtk_widget_show (button_edit);
-       gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
-       gtk_widget_show (caption);
+       gtk_box_pack_start (GTK_BOX (box), button_edit, FALSE, FALSE, MODEST_MARGIN_HALF);
        
        g_signal_connect (G_OBJECT (button_edit), "clicked", 
                          G_CALLBACK (on_button_edit_advanced_settings), self);
@@ -1148,6 +1168,7 @@ modest_easysetup_wizard_dialog_init (ModestEasysetupWizardDialog *self)
        /* Create the notebook to be used by the ModestWizardDialog base class:
         * Each page of the notebook will be a page of the wizard: */
        GtkNotebook *notebook = GTK_NOTEBOOK (gtk_notebook_new());
+       gtk_widget_set_size_request (GTK_WIDGET (notebook), DIALOG_WIDTH, -1);
        
        /* Set the notebook used by the ModestWizardDialog base class: */
        g_object_set (G_OBJECT(self), "wizard-notebook", notebook, NULL);
@@ -1225,9 +1246,6 @@ modest_easysetup_wizard_dialog_init (ModestEasysetupWizardDialog *self)
        g_object_ref (self);
        g_thread_create (presets_loader, self, FALSE, NULL);
 
-       hildon_help_dialog_help_enable (GTK_DIALOG(self), "applications_email_wizardwelcome",
-                                       modest_maemo_utils_get_osso_context()); 
-
        priv->settings = modest_account_settings_new ();
 }
 
@@ -1509,13 +1527,13 @@ set_default_custom_servernames (ModestEasysetupWizardDialog *self)
 
                /* This could happen when the combo box has still no active iter */
                if (protocol_type != MODEST_PROTOCOL_REGISTRY_TYPE_INVALID) {
-                       const gchar* email_address = gtk_entry_get_text (GTK_ENTRY(priv->entry_user_email));    
+                       const gchar* email_address = hildon_entry_get_text (HILDON_ENTRY(priv->entry_user_email));      
                        gchar* servername = util_get_default_servername_from_email_address (email_address, 
                                                                                            protocol_type);
 
                        /* Do not set the INCOMING_CHANGED flag because of this edit */
                        g_signal_handlers_block_by_func (G_OBJECT (priv->entry_incomingserver), G_CALLBACK (on_entry_incoming_servername_changed), self);
-                       gtk_entry_set_text (GTK_ENTRY (priv->entry_incomingserver), servername);
+                       hildon_entry_set_text (HILDON_ENTRY (priv->entry_incomingserver), servername);
                        g_signal_handlers_unblock_by_func (G_OBJECT (priv->entry_incomingserver), G_CALLBACK (on_entry_incoming_servername_changed), self);
                        
                        g_free (servername);
@@ -1530,13 +1548,13 @@ set_default_custom_servernames (ModestEasysetupWizardDialog *self)
                
        if (priv->entry_user_email
            && ((priv->server_changes & MODEST_EASYSETUP_WIZARD_DIALOG_OUTGOING_CHANGED) == 0)) {
-               const gchar* email_address = gtk_entry_get_text (GTK_ENTRY(priv->entry_user_email));
+               const gchar* email_address = hildon_entry_get_text (HILDON_ENTRY(priv->entry_user_email));
                
                gchar* servername = util_get_default_servername_from_email_address (email_address, MODEST_PROTOCOLS_TRANSPORT_SMTP);
 
                /* Do not set the OUTGOING_CHANGED flag because of this edit */
                g_signal_handlers_block_by_func (G_OBJECT (priv->entry_outgoingserver), G_CALLBACK (on_entry_outgoing_servername_changed), self);
-               gtk_entry_set_text (GTK_ENTRY (priv->entry_outgoingserver), servername);
+               hildon_entry_set_text (HILDON_ENTRY (priv->entry_outgoingserver), servername);
                g_signal_handlers_unblock_by_func (G_OBJECT (priv->entry_outgoingserver), G_CALLBACK (on_entry_outgoing_servername_changed), self);
 
                g_free (servername);
@@ -1550,7 +1568,7 @@ get_entered_account_title (ModestEasysetupWizardDialog *self)
        const gchar* account_title;
 
        priv = MODEST_EASYSETUP_WIZARD_DIALOG_GET_PRIVATE(self);
-       account_title = gtk_entry_get_text (GTK_ENTRY (priv->entry_account_title));
+       account_title = hildon_entry_get_text (HILDON_ENTRY (priv->entry_account_title));
 
        if (!account_title || (g_utf8_strlen (account_title, -1) == 0)) {
                return NULL;
@@ -1612,7 +1630,7 @@ on_before_next (ModestWizardDialog *dialog, GtkWidget *current_page, GtkWidget *
 
        } else if (current_page == priv->page_user_details) {
                /* Check that the email address is valud: */
-               const gchar* email_address = gtk_entry_get_text (GTK_ENTRY (priv->entry_user_email));
+               const gchar* email_address = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_email));
                if ((!email_address) || (g_utf8_strlen (email_address, -1) == 0))
                        return FALSE;
                        
@@ -1668,7 +1686,7 @@ static gboolean entry_is_empty (GtkWidget *entry)
        if (!entry)
                return FALSE;
                
-       const gchar* text = gtk_entry_get_text (GTK_ENTRY (entry));
+       const gchar* text = hildon_entry_get_text (HILDON_ENTRY (entry));
        if ((!text) || (g_utf8_strlen (text, -1) == 0))
                return TRUE;
        else {
@@ -1842,8 +1860,8 @@ save_to_settings (ModestEasysetupWizardDialog *self)
        }
 
        /* username and password (for both incoming and outgoing): */
-       username = gtk_entry_get_text (GTK_ENTRY (priv->entry_user_username));
-       password = gtk_entry_get_text (GTK_ENTRY (priv->entry_user_password));
+       username = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_username));
+       password = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_password));
 
        store_settings = modest_account_settings_get_store_settings (priv->settings);
        transport_settings = modest_account_settings_get_transport_settings (priv->settings);
@@ -1884,10 +1902,15 @@ save_to_settings (ModestEasysetupWizardDialog *self)
 
                /* we check if there is a *special* port */
                special_port = modest_presets_get_port (priv->presets, provider_id, TRUE /* incoming */);
-               if (special_port != 0)
+               if (special_port != 0) {
                        store_port = special_port;
-               else 
-                       store_port = get_port_from_protocol(store_provider_server_type, store_security);
+               } else {
+                       gboolean use_alternate_port = FALSE;
+                       if (modest_protocol_registry_protocol_type_is_secure (modest_runtime_get_protocol_registry (),
+                                                                             store_security))
+                               use_alternate_port = TRUE;
+                       store_port = get_port_from_protocol(store_provider_server_type, use_alternate_port);
+               }
 
                modest_server_account_settings_set_security_protocol (store_settings, 
                                                                      store_security);
@@ -1897,7 +1920,7 @@ save_to_settings (ModestEasysetupWizardDialog *self)
                        modest_server_account_settings_set_port (store_settings, store_port);
        } else {
                /* Use custom pages because no preset was specified: */
-               store_hostname = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->entry_incomingserver) ));               
+               store_hostname = g_strdup (hildon_entry_get_text (HILDON_ENTRY (priv->entry_incomingserver) ));         
                store_protocol = modest_servertype_picker_get_active_servertype (
                        MODEST_SERVERTYPE_PICKER (priv->incoming_servertype_picker));           
 
@@ -1968,7 +1991,7 @@ save_to_settings (ModestEasysetupWizardDialog *self)
 
                registry = modest_runtime_get_protocol_registry ();
                /* Use custom pages because no preset was specified: */
-               transport_hostname = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->entry_outgoingserver) ));
+               transport_hostname = g_strdup (hildon_entry_get_text (HILDON_ENTRY (priv->entry_outgoingserver) ));
 
                store_proto = modest_protocol_registry_get_protocol_by_type (registry, 
                                                                             store_protocol);
@@ -1995,8 +2018,8 @@ save_to_settings (ModestEasysetupWizardDialog *self)
        g_object_unref (transport_settings);
        g_free (transport_hostname);
        
-       fullname = gtk_entry_get_text (GTK_ENTRY (priv->entry_user_name));
-       email_address = gtk_entry_get_text (GTK_ENTRY (priv->entry_user_email));
+       fullname = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_name));
+       email_address = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_email));
        modest_account_settings_set_fullname (priv->settings, fullname);
        modest_account_settings_set_email_address (priv->settings, email_address);
        /* we don't set retrieve type to preserve advanced settings if
@@ -2005,7 +2028,7 @@ save_to_settings (ModestEasysetupWizardDialog *self)
        /* Save the connection-specific SMTP server accounts. */
         modest_account_settings_set_use_connection_specific_smtp 
                (priv->settings, 
-                gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->checkbox_outgoing_smtp_specific)));
+                hildon_check_button_get_active(HILDON_CHECK_BUTTON(priv->checkbox_outgoing_smtp_specific)));
 
        display_name = get_entered_account_title (self);
        modest_account_settings_set_display_name (priv->settings, display_name);