#include "modest-account-protocol.h"
#include "widgets/modest-ui-constants.h"
#include "widgets/modest-validating-entry.h"
-#include "widgets/modest-serversecurity-combo-box.h"
-#include "widgets/modest-secureauth-combo-box.h"
-#ifdef MODEST_HAVE_HILDON0_WIDGETS
-#include <hildon-widgets/hildon-caption.h>
-#include <hildon-widgets/hildon-number-editor.h>
-#else
+#include "modest-serversecurity-picker.h"
+#include "modest-secureauth-picker.h"
#include <hildon/hildon-caption.h>
#include <hildon/hildon-number-editor.h>
-#endif /*MODEST_HAVE_HILDON0_WIDGETS*/
#define PORT_MIN 1
#define PORT_MAX 65535
static void on_entry_changed (GtkEditable *editable, gpointer user_data);
-/* Tracks changes in the incoming security combo box */
+/* Tracks changes in the incoming security picker */
static void
on_security_changed (GtkWidget *widget,
ModestMaemoSecurityOptionsView *self)
{
ModestSecurityOptionsViewPrivate* ppriv;
- ModestServersecurityComboBox *combo;
+ 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 ();
- combo = MODEST_SERVERSECURITY_COMBO_BOX (ppriv->security_view);
- proto_type = modest_serversecurity_combo_box_get_active_serversecurity (combo);
+ picker = MODEST_SERVERSECURITY_PICKER (ppriv->security_view);
+ proto_type = modest_serversecurity_picker_get_active_serversecurity (picker);
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_combo_box_get_active_serversecurity_port (MODEST_SERVERSECURITY_COMBO_BOX (ppriv->security_view));
+ 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),
ModestMaemoSecurityOptionsView *self)
{
ModestSecurityOptionsViewPrivate* ppriv;
- ModestSecureauthComboBox *combo;
+ ModestSecureauthPicker *picker;
ModestProtocolRegistry *protocol_registry;
ModestProtocolType auth_proto;
gboolean secureauth_used;
ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
protocol_registry = modest_runtime_get_protocol_registry ();
- combo = MODEST_SECUREAUTH_COMBO_BOX (ppriv->auth_view);
+ picker = MODEST_SECUREAUTH_PICKER (ppriv->auth_view);
- auth_proto = modest_secureauth_combo_box_get_active_secureauth (combo);
+ auth_proto = modest_secureauth_picker_get_active_secureauth (picker);
secureauth_used = modest_protocol_registry_protocol_type_is_secure (protocol_registry,
auth_proto);
GtkSizeGroup *size_group)
{
ModestSecurityOptionsViewPrivate *ppriv;
- GtkWidget *combo_caption, *check_caption, *entry_caption = NULL;
+ GtkWidget *check_caption, *entry_caption = NULL;
ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
/* Create widgets for incoming security */
- ppriv->security_view = GTK_WIDGET (modest_serversecurity_combo_box_new ());
- combo_caption = hildon_caption_new (size_group, _("mcen_li_emailsetup_secure_connection"),
- ppriv->security_view, NULL,
- HILDON_CAPTION_OPTIONAL);
+ ppriv->security_view = GTK_WIDGET (modest_serversecurity_picker_new ());
+ hildon_button_set_title (HILDON_BUTTON (ppriv->security_view), _("mcen_li_emailsetup_secure_connection"));
if (ppriv->full) {
ppriv->port_view = GTK_WIDGET (hildon_number_editor_new (PORT_MIN, PORT_MAX));
ppriv->auth_view, NULL, HILDON_CAPTION_OPTIONAL);
/* Track changes in UI */
- g_signal_connect (G_OBJECT (ppriv->security_view), "changed",
+ 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), combo_caption,
+ gtk_box_pack_start (GTK_BOX (self), ppriv->security_view,
FALSE, FALSE, MODEST_MARGIN_HALF);
if (ppriv->full)
gtk_box_pack_start (GTK_BOX (self), entry_caption,
}
gtk_widget_show (ppriv->security_view);
gtk_widget_show (ppriv->auth_view);
- gtk_widget_show (combo_caption);
gtk_widget_show (check_caption);
}
}
/*
- * TODO: call this whenever the auth combo changes. If we set it
+ * TODO: call this whenever the auth picker changes. If we set it
* explicitely at the beggining to a value then there is no need to
* call this handler directly at the beginning
*/
ModestSecurityOptionsView* self;
ModestSecurityOptionsViewPrivate *ppriv;
ModestProtocolType auth_proto;
- ModestSecureauthComboBox *combo;
+ ModestSecureauthPicker *picker;
gboolean is_secure, missing;
ModestProtocolRegistry *protocol_registry;
protocol_registry = modest_runtime_get_protocol_registry ();
/* Outgoing username is mandatory if outgoing auth is secure */
- combo = MODEST_SECUREAUTH_COMBO_BOX (ppriv->auth_view);
- auth_proto = modest_secureauth_combo_box_get_active_secureauth (combo);
+ picker = MODEST_SECUREAUTH_PICKER (ppriv->auth_view);
+ auth_proto = modest_secureauth_picker_get_active_secureauth (picker);
is_secure = modest_protocol_registry_protocol_type_is_secure (protocol_registry,
auth_proto);
GtkSizeGroup *size_group)
{
ModestSecurityOptionsViewPrivate *ppriv;
- GtkWidget *sec_caption, *auth_caption, *user_caption = NULL;
+ GtkWidget *user_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_combo_box_new ());
- modest_serversecurity_combo_box_fill (MODEST_SERVERSECURITY_COMBO_BOX (ppriv->security_view),
+ ppriv->security_view = GTK_WIDGET (modest_serversecurity_picker_new ());
+ modest_serversecurity_picker_fill (MODEST_SERVERSECURITY_PICKER (ppriv->security_view),
MODEST_PROTOCOLS_TRANSPORT_SMTP);
- sec_caption = hildon_caption_new (size_group, _("mcen_li_emailsetup_secure_connection"),
- ppriv->security_view, NULL, HILDON_CAPTION_OPTIONAL);
+ hildon_button_set_title (HILDON_BUTTON (ppriv->security_view), _("mcen_li_emailsetup_secure_connection"));
/* The secure authentication widgets */
- ppriv->auth_view = GTK_WIDGET (modest_secureauth_combo_box_new ());
- auth_caption = hildon_caption_new (size_group, _("mcen_li_emailsetup_secure_authentication"),
- ppriv->auth_view, NULL, HILDON_CAPTION_OPTIONAL);
+ ppriv->auth_view = GTK_WIDGET (modest_secureauth_picker_new ());
+ hildon_button_set_title (HILDON_BUTTON (ppriv->auth_view), _("mcen_li_emailsetup_secure_authentication"));
if (ppriv->full) {
gchar *user_label;
}
/* Track changes in UI */
- g_signal_connect (G_OBJECT (ppriv->security_view), "changed",
+ 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), "changed",
+ g_signal_connect (G_OBJECT (ppriv->auth_view), "value-changed",
G_CALLBACK (on_auth_changed), self);
g_signal_connect (G_OBJECT (ppriv->user_entry), "changed",
G_CALLBACK (on_entry_changed), self);
}
/* Initialize widgets */
- modest_serversecurity_combo_box_set_active_serversecurity (
- MODEST_SERVERSECURITY_COMBO_BOX (ppriv->security_view),
+ modest_serversecurity_picker_set_active_serversecurity (
+ MODEST_SERVERSECURITY_PICKER (ppriv->security_view),
MODEST_PROTOCOLS_CONNECTION_NONE);
- modest_secureauth_combo_box_set_active_secureauth (
- MODEST_SECUREAUTH_COMBO_BOX (ppriv->auth_view),
+ modest_secureauth_picker_set_active_secureauth (
+ MODEST_SECUREAUTH_PICKER (ppriv->auth_view),
MODEST_PROTOCOLS_AUTH_NONE);
/* Pack into container */
if (ppriv->full) {
- gtk_box_pack_start (GTK_BOX (self), auth_caption, 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), user_caption, FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_box_pack_start (GTK_BOX (self), pwd_caption, FALSE, FALSE, MODEST_MARGIN_HALF);
- gtk_box_pack_start (GTK_BOX (self), sec_caption, FALSE, FALSE, MODEST_MARGIN_HALF);
+ 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), sec_caption, FALSE, FALSE, MODEST_MARGIN_HALF);
- gtk_box_pack_start (GTK_BOX (self), auth_caption, FALSE, FALSE, MODEST_MARGIN_HALF);
+ 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);
}
/* Show widgets */
}
gtk_widget_show (ppriv->security_view);
gtk_widget_show (ppriv->auth_view);
- gtk_widget_show (sec_caption);
- gtk_widget_show (auth_caption);
}
GtkWidget *
if (ppriv->full) {
server_port = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR (ppriv->port_view));
} else {
- server_port = modest_serversecurity_combo_box_get_active_serversecurity_port (MODEST_SERVERSECURITY_COMBO_BOX (ppriv->security_view));
+ server_port = modest_serversecurity_picker_get_active_serversecurity_port (MODEST_SERVERSECURITY_PICKER (ppriv->security_view));
}
modest_server_account_settings_set_port (server_settings, server_port);