X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fhildon2%2Fmodest-maemo-security-options-view.c;h=01fd898b0d3e8cc1931f1b01e431be3aedd73179;hb=0113d736f835b317dd6f43dbf253e2defaed4c2b;hp=96b81e5ad51391f62cef11f3d0aee2bb54a7beef;hpb=c04bb053b183aa6ee0660cfd0f8bc3f3f5783e54;p=modest diff --git a/src/hildon2/modest-maemo-security-options-view.c b/src/hildon2/modest-maemo-security-options-view.c index 96b81e5..01fd898 100644 --- a/src/hildon2/modest-maemo-security-options-view.c +++ b/src/hildon2/modest-maemo-security-options-view.c @@ -38,7 +38,7 @@ #include "modest-serversecurity-picker.h" #include "modest-secureauth-picker.h" #include "modest-maemo-utils.h" -#include +#include #include #include "modest-hildon-includes.h" @@ -89,7 +89,7 @@ on_security_changed (GtkWidget *widget, modest_serversecurity_picker_get_active_serversecurity_port (MODEST_SERVERSECURITY_PICKER (ppriv->security_view)); if(port_number) { - hildon_number_editor_set_value (HILDON_NUMBER_EDITOR (ppriv->port_view), + modest_number_editor_set_value (MODEST_NUMBER_EDITOR (ppriv->port_view), port_number); } } @@ -128,7 +128,8 @@ on_auth_changed (GtkWidget *widget, static void create_incoming_security (ModestSecurityOptionsView* self, - GtkSizeGroup *size_group) + GtkSizeGroup *title_size_group, + GtkSizeGroup *value_size_group) { ModestSecurityOptionsViewPrivate *ppriv; GtkWidget *entry_caption = NULL; @@ -137,32 +138,38 @@ create_incoming_security (ModestSecurityOptionsView* self, /* Create widgets for incoming security */ ppriv->security_view = GTK_WIDGET (modest_serversecurity_picker_new (MODEST_EDITABLE_SIZE, - MODEST_EDITABLE_ARRANGEMENT)); - modest_maemo_utils_create_picker_layout (size_group, - _("mcen_li_emailsetup_secure_connection"), - ppriv->security_view); + HILDON_BUTTON_ARRANGEMENT_HORIZONTAL)); + modest_serversecurity_picker_fill (MODEST_SERVERSECURITY_PICKER (ppriv->security_view), + modest_protocol_registry_get_pop_type_id ()); + modest_maemo_utils_set_hbutton_layout (title_size_group, + value_size_group, + _("mcen_li_emailsetup_secure_connection"), + ppriv->security_view); if (ppriv->full) { - ppriv->port_view = GTK_WIDGET (hildon_number_editor_new (PORT_MIN, PORT_MAX)); - entry_caption = modest_maemo_utils_create_captioned (size_group, _("mcen_fi_emailsetup_port"), + ppriv->port_view = GTK_WIDGET (modest_number_editor_new (PORT_MIN, PORT_MAX)); + entry_caption = modest_maemo_utils_create_captioned (title_size_group, + value_size_group, + _("mcen_fi_emailsetup_port"), + FALSE, ppriv->port_view); } ppriv->auth_view = hildon_check_button_new (MODEST_EDITABLE_SIZE); gtk_button_set_label (GTK_BUTTON (ppriv->auth_view), _("mcen_li_emailsetup_secure_authentication")); - gtk_size_group_add_widget (size_group, ppriv->auth_view); + gtk_button_set_alignment (GTK_BUTTON (ppriv->auth_view), 0.0, 0.5); /* Track changes in UI */ g_signal_connect (G_OBJECT (ppriv->security_view), "value-changed", G_CALLBACK (on_security_changed), self); /* Pack into container */ - gtk_box_pack_start (GTK_BOX (self), ppriv->security_view, + gtk_box_pack_start (GTK_BOX (self), ppriv->auth_view, FALSE, FALSE, MODEST_MARGIN_HALF); if (ppriv->full) gtk_box_pack_start (GTK_BOX (self), entry_caption, FALSE, FALSE, MODEST_MARGIN_HALF); - gtk_box_pack_start (GTK_BOX (self), ppriv->auth_view, + gtk_box_pack_start (GTK_BOX (self), ppriv->security_view, FALSE, FALSE, MODEST_MARGIN_HALF); /* Show widgets */ @@ -209,7 +216,7 @@ on_entry_changed (GtkEditable *editable, auth_proto); if (is_secure && - !g_ascii_strcasecmp (gtk_entry_get_text (GTK_ENTRY (ppriv->user_entry)), "")) { + !g_ascii_strcasecmp (hildon_entry_get_text (HILDON_ENTRY (ppriv->user_entry)), "")) { missing = TRUE; } else { missing = FALSE; @@ -222,7 +229,8 @@ on_entry_changed (GtkEditable *editable, static void create_outgoing_security (ModestSecurityOptionsView* self, - GtkSizeGroup *size_group) + GtkSizeGroup *title_size_group, + GtkSizeGroup *value_size_group) { ModestSecurityOptionsViewPrivate *ppriv; GtkWidget *user_caption = NULL; @@ -232,17 +240,21 @@ create_outgoing_security (ModestSecurityOptionsView* self, /* The secure connection widgets */ ppriv->security_view = GTK_WIDGET (modest_serversecurity_picker_new (MODEST_EDITABLE_SIZE, - MODEST_EDITABLE_ARRANGEMENT)); + HILDON_BUTTON_ARRANGEMENT_HORIZONTAL)); modest_serversecurity_picker_fill (MODEST_SERVERSECURITY_PICKER (ppriv->security_view), MODEST_PROTOCOLS_TRANSPORT_SMTP); - modest_maemo_utils_create_picker_layout (size_group, _("mcen_li_emailsetup_secure_connection"), - ppriv->security_view); + modest_maemo_utils_set_hbutton_layout (title_size_group, + value_size_group, + _("mcen_li_emailsetup_secure_connection"), + ppriv->security_view); /* The secure authentication widgets */ ppriv->auth_view = GTK_WIDGET (modest_secureauth_picker_new (MODEST_EDITABLE_SIZE, - MODEST_EDITABLE_ARRANGEMENT)); - modest_maemo_utils_create_picker_layout (size_group, _("mcen_li_emailsetup_secure_authentication"), - ppriv->auth_view); + HILDON_BUTTON_ARRANGEMENT_HORIZONTAL)); + modest_maemo_utils_set_hbutton_layout (title_size_group, + value_size_group, + _("mcen_li_emailsetup_secure_authentication"), + ppriv->auth_view); if (ppriv->full) { gchar *user_label; @@ -255,7 +267,10 @@ create_outgoing_security (ModestSecurityOptionsView* self, HILDON_GTK_INPUT_MODE_FULL); user_label = g_strdup_printf("%s*", _("mail_fi_username")); - user_caption = modest_maemo_utils_create_captioned (size_group, user_label, + user_caption = modest_maemo_utils_create_captioned (title_size_group, + value_size_group, + user_label, + FALSE, ppriv->user_entry); g_free (user_label); @@ -268,7 +283,7 @@ create_outgoing_security (ModestSecurityOptionsView* self, on_entry_max, self); /* Password widgets */ - ppriv->pwd_entry = gtk_entry_new (); + ppriv->pwd_entry = 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 (ppriv->pwd_entry), @@ -276,11 +291,17 @@ create_outgoing_security (ModestSecurityOptionsView* self, HILDON_GTK_INPUT_MODE_INVISIBLE); gtk_entry_set_visibility (GTK_ENTRY (ppriv->pwd_entry), FALSE); - pwd_caption = modest_maemo_utils_create_captioned (size_group, _("mail_fi_password"), + pwd_caption = modest_maemo_utils_create_captioned (title_size_group, + value_size_group, + _("mail_fi_password"), + FALSE, ppriv->pwd_entry); - ppriv->port_view = GTK_WIDGET (hildon_number_editor_new (PORT_MIN, PORT_MAX)); - port_caption = modest_maemo_utils_create_captioned (size_group, _("mcen_fi_emailsetup_port"), + ppriv->port_view = GTK_WIDGET (modest_number_editor_new (PORT_MIN, PORT_MAX)); + port_caption = modest_maemo_utils_create_captioned (title_size_group, + value_size_group, + _("mcen_fi_emailsetup_port"), + FALSE, ppriv->port_view); } @@ -310,9 +331,8 @@ create_outgoing_security (ModestSecurityOptionsView* self, gtk_box_pack_start (GTK_BOX (self), ppriv->security_view, FALSE, FALSE, MODEST_MARGIN_HALF); gtk_box_pack_start (GTK_BOX (self), port_caption, FALSE, FALSE, MODEST_MARGIN_HALF); } else { - /* The order is different */ - gtk_box_pack_start (GTK_BOX (self), ppriv->security_view, FALSE, FALSE, MODEST_MARGIN_HALF); gtk_box_pack_start (GTK_BOX (self), ppriv->auth_view, FALSE, FALSE, MODEST_MARGIN_HALF); + gtk_box_pack_start (GTK_BOX (self), ppriv->security_view, FALSE, FALSE, MODEST_MARGIN_HALF); } /* Show widgets */ @@ -331,7 +351,8 @@ create_outgoing_security (ModestSecurityOptionsView* self, GtkWidget * modest_maemo_security_options_view_new (ModestSecurityOptionsType type, gboolean full, - GtkSizeGroup *size_group) + GtkSizeGroup *title_size_group, + GtkSizeGroup *value_size_group) { ModestSecurityOptionsView* self; ModestSecurityOptionsViewPrivate *ppriv; @@ -343,9 +364,9 @@ modest_maemo_security_options_view_new (ModestSecurityOptionsType type, ppriv->full = full; self->type = type; if (self->type == MODEST_SECURITY_OPTIONS_INCOMING) - create_incoming_security (self, size_group); + create_incoming_security (self, title_size_group, value_size_group); else - create_outgoing_security (self, size_group); + create_outgoing_security (self, title_size_group, value_size_group); return (GtkWidget *) self; } @@ -373,7 +394,7 @@ modest_maemo_security_options_view_load_settings (ModestSecurityOptionsView* sel } else if (ppriv->full) { /* Keep the user-entered port-number, or the * already-appropriate automatic port number */ - hildon_number_editor_set_value (HILDON_NUMBER_EDITOR (ppriv->port_view), + modest_number_editor_set_value (MODEST_NUMBER_EDITOR (ppriv->port_view), port_number); } /* Frees */ @@ -396,7 +417,7 @@ modest_maemo_security_options_view_save_settings (ModestSecurityOptionsView* sel server_settings = modest_account_settings_get_transport_settings (settings); if (ppriv->full) { - server_port = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR (ppriv->port_view)); + server_port = modest_number_editor_get_value (MODEST_NUMBER_EDITOR (ppriv->port_view)); } else { server_port = modest_serversecurity_picker_get_active_serversecurity_port (MODEST_SERVERSECURITY_PICKER (ppriv->security_view)); } @@ -427,7 +448,7 @@ modest_maemo_security_options_view_changed (ModestSecurityOptionsView* self, server_settings = modest_account_settings_get_transport_settings (settings); server_port = - hildon_number_editor_get_value (HILDON_NUMBER_EDITOR (ppriv->port_view)); + modest_number_editor_get_value (MODEST_NUMBER_EDITOR (ppriv->port_view)); /* Frees */ g_object_unref (server_settings);