#include "modest-account-protocol.h"
#include "widgets/modest-ui-constants.h"
#include "widgets/modest-validating-entry.h"
-#include "modest-serversecurity-picker.h"
#include "modest-secureauth-picker.h"
#include "modest-maemo-utils.h"
#include "modest-hildon-includes.h"
ModestMaemoSecurityOptionsView *self)
{
ModestSecurityOptionsViewPrivate* ppriv;
- ModestServersecurityPicker *picker;
ModestProtocolType proto_type;
ModestProtocolRegistry *proto_registry;
gboolean is_secure;
ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
proto_registry = modest_runtime_get_protocol_registry ();
- picker = MODEST_SERVERSECURITY_PICKER (ppriv->security_view);
- proto_type = modest_serversecurity_picker_get_active_serversecurity (picker);
+ proto_type = modest_serversecurity_selector_get_active_serversecurity (ppriv->security_view);
is_secure = modest_protocol_registry_protocol_type_has_tag (proto_registry, proto_type,
MODEST_PROTOCOL_REGISTRY_SECURE_PROTOCOLS);
if (ppriv->full) {
gint port_number =
- modest_serversecurity_picker_get_active_serversecurity_port (MODEST_SERVERSECURITY_PICKER (ppriv->security_view));
+ modest_serversecurity_selector_get_active_serversecurity_port (ppriv->security_view);
if(port_number) {
modest_number_entry_set_value (ppriv->port_view,
ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
- /* Create widgets for incoming security */
- ppriv->security_view = GTK_WIDGET (modest_serversecurity_picker_new (MODEST_EDITABLE_SIZE,
- 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);
-
ppriv->auth_view = modest_toolkit_factory_create_check_button (modest_runtime_get_toolkit_factory (),
_("mcen_li_emailsetup_secure_authentication"));
+ gtk_box_pack_start (GTK_BOX (self), ppriv->auth_view, FALSE, FALSE, 0);
- /* Track changes in UI */
- g_signal_connect (G_OBJECT (ppriv->security_view), "value-changed",
- G_CALLBACK (on_security_changed), self);
+ /* Create widgets for incoming security */
+ ppriv->security_view = modest_toolkit_factory_create_serversecurity_selector (modest_runtime_get_toolkit_factory ());
+ modest_serversecurity_selector_fill (ppriv->security_view,
+ modest_protocol_registry_get_pop_type_id ());
+ if (GTK_IS_COMBO_BOX (ppriv->security_view)) {
+ GtkWidget *captioned;
+
+ captioned = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ _("mcen_li_emailsetup_secure_connection"), FALSE,
+ ppriv->security_view);
+ g_signal_connect (G_OBJECT (ppriv->security_view), "changed",
+ G_CALLBACK (on_security_changed), self);
+ gtk_box_pack_start (GTK_BOX (self), captioned, FALSE, FALSE, 0);
+ gtk_widget_show (captioned);
+ } else {
+ modest_maemo_utils_set_hbutton_layout (title_size_group,
+ value_size_group,
+ _("mcen_li_emailsetup_secure_connection"),
+ ppriv->security_view);
+ g_signal_connect (G_OBJECT (ppriv->security_view), "value-changed",
+ G_CALLBACK (on_security_changed), self);
+ gtk_box_pack_start (GTK_BOX (self), ppriv->security_view, FALSE, FALSE, 0);
+ }
/* Pack into container & show */
- gtk_box_pack_start (GTK_BOX (self), ppriv->auth_view, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (self), ppriv->security_view, FALSE, FALSE, 0);
gtk_widget_show (ppriv->security_view);
gtk_widget_show (ppriv->auth_view);
GtkSizeGroup *value_size_group)
{
ModestSecurityOptionsViewPrivate *ppriv;
- GtkWidget *user_caption = NULL;
+ GtkWidget *user_caption = NULL, *security_caption = NULL;
GtkWidget *pwd_caption = NULL, *port_caption = NULL;
ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
/* The secure connection widgets */
- ppriv->security_view = GTK_WIDGET (modest_serversecurity_picker_new (MODEST_EDITABLE_SIZE,
- HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
- modest_serversecurity_picker_fill (MODEST_SERVERSECURITY_PICKER (ppriv->security_view),
+ ppriv->security_view = modest_toolkit_factory_create_serversecurity (modest_runtime_get_toolkit_factory ());
+ modest_serversecurity_selector_fill (ppriv->security_view,
MODEST_PROTOCOLS_TRANSPORT_SMTP);
- modest_maemo_utils_set_hbutton_layout (title_size_group,
- value_size_group,
- _("mcen_li_emailsetup_secure_connection"),
- ppriv->security_view);
+ if (GTK_IS_COMBO_BOX (ppriv->security_view)) {
+ security_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ _("mcen_li_emailsetup_secure_connection"), FALSE,
+ ppriv->security_view);
+ } else {
+ modest_maemo_utils_set_hbutton_layout (title_size_group,
+ value_size_group,
+ _("mcen_li_emailsetup_secure_connection"),
+ ppriv->security_view);
+ security_caption = ppriv->security_view;
+ }
/* The secure authentication widgets */
ppriv->auth_view = GTK_WIDGET (modest_secureauth_picker_new (MODEST_EDITABLE_SIZE,
ppriv->user_entry = GTK_WIDGET (modest_validating_entry_new ());
/* Auto-capitalization is the default, so let's turn it off: */
+#ifdef MODEST_TOOLKIT_HILDON2
hildon_gtk_entry_set_input_mode (GTK_ENTRY (ppriv->user_entry),
HILDON_GTK_INPUT_MODE_FULL);
+#endif
user_label = g_strdup_printf("%s*", _("mail_fi_username"));
user_caption = modest_maemo_utils_create_captioned_with_size_type (title_size_group,
ppriv->pwd_entry = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ());
/* Auto-capitalization is the default, so let's turn it off */
+#ifdef MODEST_TOOLKIT_HILDON2
hildon_gtk_entry_set_input_mode (GTK_ENTRY (ppriv->pwd_entry),
HILDON_GTK_INPUT_MODE_FULL |
HILDON_GTK_INPUT_MODE_INVISIBLE);
+#endif
gtk_entry_set_visibility (GTK_ENTRY (ppriv->pwd_entry), FALSE);
pwd_caption =
MODEST_EDITABLE_SIZE);
}
- /* Track changes in UI */
- g_signal_connect (G_OBJECT (ppriv->security_view), "value-changed",
- G_CALLBACK (on_security_changed), self);
+ /* Track changes in UI */
+ if (GTK_IS_COMBO_BOX (ppriv->security_view)) {
+ g_signal_connect (G_OBJECT (ppriv->security_view), "changed",
+ G_CALLBACK (on_security_changed), self);
+ } else {
+ g_signal_connect (G_OBJECT (ppriv->security_view), "value-changed",
+ G_CALLBACK (on_security_changed), self);
+ }
if (ppriv->full) {
g_signal_connect (G_OBJECT (ppriv->auth_view), "value-changed",
G_CALLBACK (on_auth_changed), self);
}
/* Initialize widgets */
- modest_serversecurity_picker_set_active_serversecurity (
- MODEST_SERVERSECURITY_PICKER (ppriv->security_view),
+ modest_serversecurity_selector_set_active_serversecurity (
+ ppriv->security_view,
MODEST_PROTOCOLS_CONNECTION_NONE);
modest_secureauth_picker_set_active_secureauth (
MODEST_SECUREAUTH_PICKER (ppriv->auth_view),
if (ppriv->full) {
server_port = modest_number_entry_get_value (ppriv->port_view);
} else {
- server_port = modest_serversecurity_picker_get_active_serversecurity_port (MODEST_SERVERSECURITY_PICKER (ppriv->security_view));
+ server_port = modest_serversecurity_selector_get_active_serversecurity_port (ppriv->security_view);
}
modest_server_account_settings_set_port (server_settings, server_port);