#include <gtk/gtkmessagedialog.h>
#include <gtk/gtkstock.h>
#include <hildon-widgets/hildon-caption.h>
-#include "maemo/easysetup/modest-easysetup-country-combo-box.h"
-#include "maemo/easysetup/modest-easysetup-provider-combo-box.h"
-#include "maemo/easysetup/modest-easysetup-servertype-combo-box.h"
-#include "widgets/modest-easysetup-serversecurity-combo-box.h"
-#include "widgets/modest-easysetup-secureauth-combo-box.h"
+#include <hildon-widgets/hildon-number-editor.h>
+#include "widgets/modest-serversecurity-combo-box.h"
+#include "widgets/modest-secureauth-combo-box.h"
#include "widgets/modest-validating-entry.h"
#include "widgets/modest-retrieve-combo-box.h"
#include "widgets/modest-limit-retrieve-combo-box.h"
/* Signature button: */
if (!self->button_signature)
- self->button_signature = gtk_button_new_with_label (_("mcen_bd_emailsetup_edit"));
+ self->button_signature = gtk_button_new_with_label (_("mcen_bd_edit"));
caption = hildon_caption_new (sizegroup, _("mcen_fi_email_signature"),
self->button_signature, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (self->button_signature);
{
/* Fill the combo with appropriately titled choices for POP or IMAP. */
/* The choices are the same, but the titles are different, as in the UI spec. */
- easysetup_serversecurity_combo_box_fill (
- EASYSETUP_SERVERSECURITY_COMBO_BOX (self->combo_incoming_security), protocol);
+ modest_serversecurity_combo_box_fill (
+ MODEST_SERVERSECURITY_COMBO_BOX (self->combo_incoming_security), protocol);
}
static GtkWidget* create_page_incoming (ModestAccountSettingsDialog *self)
/* The secure connection widgets: */
/* This will be filled by update_incoming_server_security_choices(). */
if (!self->combo_incoming_security)
- self->combo_incoming_security = GTK_WIDGET (easysetup_serversecurity_combo_box_new ());
+ self->combo_incoming_security = GTK_WIDGET (modest_serversecurity_combo_box_new ());
GtkWidget *caption = hildon_caption_new (sizegroup, _("mcen_li_emailsetup_secure_connection"),
self->combo_incoming_security, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (self->combo_incoming_security);
/* The port widgets: */
/* TODO: There are various rules about this in the UI spec. */
if (!self->entry_incoming_port)
- self->entry_incoming_port = GTK_WIDGET (gtk_entry_new ());
+ self->entry_incoming_port = GTK_WIDGET (hildon_number_editor_new (0, 10000 /* arbitrary min and max */));
caption = hildon_caption_new (sizegroup, _("mcen_fi_emailsetup_port"),
self->entry_incoming_port, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (self->entry_incoming_port);
ModestAccountSettingsDialog *self = MODEST_ACCOUNT_SETTINGS_DIALOG (user_data);
ModestProtocol protocol_security =
- easysetup_secureauth_combo_box_get_active_secureauth (
- EASYSETUP_SECUREAUTH_COMBO_BOX (self->combo_outgoing_auth));
+ modest_secureauth_combo_box_get_active_secureauth (
+ MODEST_SECUREAUTH_COMBO_BOX (self->combo_outgoing_auth));
const gboolean secureauth_used = protocol_security != MODEST_PROTOCOL_AUTH_NONE;
gtk_widget_set_sensitive (self->caption_outgoing_username, secureauth_used);
ModestAccountSettingsDialog *self = MODEST_ACCOUNT_SETTINGS_DIALOG (user_data);
const gint port_number =
- easysetup_serversecurity_combo_box_get_active_serversecurity_port (
- EASYSETUP_SERVERSECURITY_COMBO_BOX (self->combo_outgoing_security));
+ modest_serversecurity_combo_box_get_active_serversecurity_port (
+ MODEST_SERVERSECURITY_COMBO_BOX (self->combo_outgoing_security));
if(port_number != 0) {
- gchar* str = g_strdup_printf ("%d", port_number);
- gtk_entry_set_text (GTK_ENTRY (self->entry_outgoing_port), str);
- g_free (str);
+ hildon_number_editor_set_value (
+ HILDON_NUMBER_EDITOR (self->entry_outgoing_port), port_number);
}
}
ModestAccountSettingsDialog *self = MODEST_ACCOUNT_SETTINGS_DIALOG (user_data);
const gint port_number =
- easysetup_serversecurity_combo_box_get_active_serversecurity_port (
- EASYSETUP_SERVERSECURITY_COMBO_BOX (self->combo_incoming_security));
+ modest_serversecurity_combo_box_get_active_serversecurity_port (
+ MODEST_SERVERSECURITY_COMBO_BOX (self->combo_incoming_security));
if(port_number != 0) {
- gchar* str = g_strdup_printf ("%d", port_number);
- gtk_entry_set_text (GTK_ENTRY (self->entry_incoming_port), str);
- g_free (str);
+ hildon_number_editor_set_value (
+ HILDON_NUMBER_EDITOR (self->entry_incoming_port), port_number);
}
}
/* The secure authentication widgets: */
if (!self->combo_outgoing_auth)
- self->combo_outgoing_auth = GTK_WIDGET (easysetup_secureauth_combo_box_new ());
+ self->combo_outgoing_auth = GTK_WIDGET (modest_secureauth_combo_box_new ());
caption = hildon_caption_new (sizegroup, _("mcen_li_emailsetup_secure_authentication"),
self->combo_outgoing_auth, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (self->combo_outgoing_auth);
gtk_widget_show (self->caption_outgoing_password);
/* The secure connection widgets: */
- /* This will be filled and set with easysetup_serversecurity_combo_box_fill()
- * and easysetup_serversecurity_combo_box_set_active_serversecurity().
+ /* This will be filled and set with modest_serversecurity_combo_box_fill()
+ * and modest_serversecurity_combo_box_set_active_serversecurity().
*/
if (!self->combo_outgoing_security)
- self->combo_outgoing_security = GTK_WIDGET (easysetup_serversecurity_combo_box_new ());
+ self->combo_outgoing_security = GTK_WIDGET (modest_serversecurity_combo_box_new ());
caption = hildon_caption_new (sizegroup, _("mcen_li_emailsetup_secure_connection"),
self->combo_outgoing_security, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (self->combo_outgoing_security);
/* The port widgets: */
if (!self->entry_outgoing_port)
- self->entry_outgoing_port = GTK_WIDGET (gtk_entry_new ());
+ self->entry_outgoing_port = GTK_WIDGET (hildon_number_editor_new (0, 10000 /* arbitrary min and max */));
caption = hildon_caption_new (sizegroup, _("mcen_fi_emailsetup_port"),
self->entry_outgoing_port, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (self->entry_outgoing_port);
/* Connection-specific SMTP-Severs Edit button: */
if (!self->button_outgoing_smtp_servers)
- self->button_outgoing_smtp_servers = gtk_button_new_with_label (_("mcen_bd_emailsetup_edit"));
+ self->button_outgoing_smtp_servers = gtk_button_new_with_label (_("mcen_bd_edit"));
caption = hildon_caption_new (sizegroup, _("mcen_fi_advsetup_optional_smtp"),
self->button_outgoing_smtp_servers, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (self->button_outgoing_smtp_servers);
const ModestProtocol security = modest_server_account_get_security (
dialog->account_manager, incoming_account->account_name);
- easysetup_serversecurity_combo_box_set_active_serversecurity (
- EASYSETUP_SERVERSECURITY_COMBO_BOX (dialog->combo_incoming_security), security);
+ modest_serversecurity_combo_box_set_active_serversecurity (
+ MODEST_SERVERSECURITY_COMBO_BOX (dialog->combo_incoming_security), security);
const gint port_num = modest_account_mgr_get_int (dialog->account_manager, incoming_account->account_name,
MODEST_ACCOUNT_PORT, TRUE /* server account */);
- gchar *port_str = g_strdup_printf ("%d", port_num);
- gtk_entry_set_text (GTK_ENTRY (dialog->entry_incoming_port), port_str);
- g_free (port_str);
-
- /* TODO:
- gchar *uri;
- ModestProtocol proto;
- gchar *password;
- time_t last_updated;
- GSList *options;
- */
+ hildon_number_editor_set_value (
+ HILDON_NUMBER_EDITOR (dialog->entry_incoming_port), port_num);
}
/* Get the secure-auth setting: */
const ModestProtocol secure_auth = modest_server_account_get_secure_auth(
dialog->account_manager, outgoing_account->account_name);
- easysetup_secureauth_combo_box_set_active_secureauth (
- EASYSETUP_SECUREAUTH_COMBO_BOX (dialog->combo_outgoing_auth), secure_auth);
+ modest_secureauth_combo_box_set_active_secureauth (
+ MODEST_SECUREAUTH_COMBO_BOX (dialog->combo_outgoing_auth), secure_auth);
on_combo_outgoing_auth_changed (GTK_COMBO_BOX (dialog->combo_outgoing_auth), dialog);
- easysetup_serversecurity_combo_box_fill (
- EASYSETUP_SERVERSECURITY_COMBO_BOX (dialog->combo_outgoing_security), outgoing_account->proto);
+ modest_serversecurity_combo_box_fill (
+ MODEST_SERVERSECURITY_COMBO_BOX (dialog->combo_outgoing_security), outgoing_account->proto);
/* Get the security setting: */
const ModestProtocol security = modest_server_account_get_security (
dialog->account_manager, outgoing_account->account_name);
- easysetup_serversecurity_combo_box_set_active_serversecurity (
- EASYSETUP_SERVERSECURITY_COMBO_BOX (dialog->combo_outgoing_security), security);
+ modest_serversecurity_combo_box_set_active_serversecurity (
+ MODEST_SERVERSECURITY_COMBO_BOX (dialog->combo_outgoing_security), security);
const gint port_num = modest_account_mgr_get_int (dialog->account_manager, outgoing_account->account_name,
MODEST_ACCOUNT_PORT, TRUE /* server account */);
- gchar *port_str = g_strdup_printf ("%d", port_num);
- gtk_entry_set_text (GTK_ENTRY (dialog->entry_outgoing_port), port_str);
- g_free (port_str);
+ hildon_number_editor_set_value (
+ HILDON_NUMBER_EDITOR (dialog->entry_outgoing_port), port_num);
}
/* account_data->is_enabled, */
: MODEST_PROTOCOL_AUTH_NONE;
modest_server_account_set_secure_auth (dialog->account_manager, incoming_account_name, protocol_authentication_incoming);
- const ModestProtocol protocol_security_incoming = easysetup_serversecurity_combo_box_get_active_serversecurity (
- EASYSETUP_SERVERSECURITY_COMBO_BOX (dialog->combo_incoming_security));
+ const ModestProtocol protocol_security_incoming = modest_serversecurity_combo_box_get_active_serversecurity (
+ MODEST_SERVERSECURITY_COMBO_BOX (dialog->combo_incoming_security));
modest_server_account_set_security (dialog->account_manager, incoming_account_name, protocol_security_incoming);
/* port: */
- const gchar* port_str = gtk_entry_get_text (GTK_ENTRY (dialog->entry_incoming_port));
- gint port_num = 0;
- if (port_str)
- port_num = atoi (port_str);
+ gint port_num = hildon_number_editor_get_value (
+ HILDON_NUMBER_EDITOR (dialog->entry_incoming_port));
modest_account_mgr_set_int (dialog->account_manager, incoming_account_name,
MODEST_ACCOUNT_PORT, port_num, TRUE /* server account */);
if (!test)
return FALSE;
- const ModestProtocol protocol_security_outgoing = easysetup_serversecurity_combo_box_get_active_serversecurity (
- EASYSETUP_SERVERSECURITY_COMBO_BOX (dialog->combo_outgoing_security));
+ const ModestProtocol protocol_security_outgoing = modest_serversecurity_combo_box_get_active_serversecurity (
+ MODEST_SERVERSECURITY_COMBO_BOX (dialog->combo_outgoing_security));
modest_server_account_set_security (dialog->account_manager, outgoing_account_name, protocol_security_outgoing);
- const ModestProtocol protocol_authentication_outgoing = easysetup_secureauth_combo_box_get_active_secureauth (
- EASYSETUP_SECUREAUTH_COMBO_BOX (dialog->combo_outgoing_auth));
+ const ModestProtocol protocol_authentication_outgoing = modest_secureauth_combo_box_get_active_secureauth (
+ MODEST_SECUREAUTH_COMBO_BOX (dialog->combo_outgoing_auth));
modest_server_account_set_secure_auth (dialog->account_manager, outgoing_account_name, protocol_authentication_outgoing);
/* port: */
- port_str = gtk_entry_get_text (GTK_ENTRY (dialog->entry_outgoing_port));
- port_num = 0;
- if (port_str)
- port_num = atoi (port_str);
+ port_num = hildon_number_editor_get_value (
+ HILDON_NUMBER_EDITOR (dialog->entry_outgoing_port));
modest_account_mgr_set_int (dialog->account_manager, outgoing_account_name,
MODEST_ACCOUNT_PORT, port_num, TRUE /* server account */);