#include "modest-serversecurity-picker.h"
#include "modest-secureauth-picker.h"
#include "modest-maemo-utils.h"
-#include <hildon/hildon-number-editor.h>
+#include <modest-number-editor.h>
#include <hildon/hildon-check-button.h>
#include "modest-hildon-includes.h"
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);
}
}
ppriv->security_view);
if (ppriv->full) {
- ppriv->port_view = GTK_WIDGET (hildon_number_editor_new (PORT_MIN, PORT_MAX));
+ 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);
}
G_CALLBACK (on_security_changed), self);
/* Pack into container */
- 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, 0);
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,
- FALSE, FALSE, MODEST_MARGIN_HALF);
+ gtk_box_pack_start (GTK_BOX (self), ppriv->security_view,
+ FALSE, FALSE, 0);
/* Show widgets */
if (ppriv->full) {
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;
}
+
+ if (!missing && ppriv->full && !modest_number_editor_is_valid (MODEST_NUMBER_EDITOR (ppriv->port_view)))
+ missing = TRUE;
/* Emit a signal to notify if mandatory data is missing */
g_signal_emit_by_name (G_OBJECT (self), "missing_mandatory_data",
missing, NULL);
}
+void
+on_valid_changed (ModestNumberEditor *editor,
+ gboolean valid,
+ ModestSecurityOptionsView *self)
+{
+ on_entry_changed (NULL, (gpointer) self);
+}
+
static void
create_outgoing_security (ModestSecurityOptionsView* self,
GtkSizeGroup *title_size_group,
user_label = g_strdup_printf("%s*", _("mail_fi_username"));
user_caption = modest_maemo_utils_create_captioned (title_size_group,
value_size_group,
- user_label,
+ user_label,
+ FALSE,
ppriv->user_entry);
g_free (user_label);
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),
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));
+ 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);
}
G_CALLBACK (on_auth_changed), self);
g_signal_connect (G_OBJECT (ppriv->user_entry), "changed",
G_CALLBACK (on_entry_changed), self);
+ g_signal_connect (G_OBJECT (ppriv->port_view), "valid-changed",
+ G_CALLBACK (on_valid_changed), self);
}
/* Initialize widgets */
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 */
} 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 */
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));
}
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);