+2007-04-23 Murray Cumming <murrayc@murrayc.com>
+
+ * src/maemo/easysetup/modest-easysetup-wizard.c:
+ (set_default_custom_servernames):
+ * src/maemo/modest-account-settings-dialog.c:
+ (create_page_incoming), (on_combo_outgoing_security_changed),
+ (on_combo_incoming_security_changed), (create_page_outgoing),
+ (modest_account_settings_dialog_set_account_name),
+ (save_configuration):
+ * src/maemo/modest-connection-specific-smtp-edit-window.c:
+ (on_combo_security_changed),
+ (modest_connection_specific_smtp_edit_window_init),
+ (modest_connection_specific_smtp_edit_window_set_connection),
+ (modest_connection_specific_smtp_edit_window_get_settings):
+ Use HildonNumberEditor instead of GtkEntry for the port numbers so it has the - and + buttons,
+ as per the UI spec.
+
2007-04-20 Murray Cumming <murrayc@murrayc.com>
* po/en_GB.po:
#include <gtk/gtkmessagedialog.h>
#include <gtk/gtkstock.h>
#include <hildon-widgets/hildon-caption.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"
/* 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);
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);
}
}
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 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);
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);
}
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_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 */);
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 */);
#include "modest-connection-specific-smtp-edit-window.h"
#include <hildon-widgets/hildon-caption.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"
MODEST_SERVERSECURITY_COMBO_BOX (priv->combo_outgoing_security));
if(port_number != 0) {
- gchar* str = g_strdup_printf ("%d", port_number);
- gtk_entry_set_text (GTK_ENTRY (priv->entry_port), str);
- g_free (str);
+ hildon_number_editor_set_value (
+ HILDON_NUMBER_EDITOR (priv->entry_port), port_number);
}
}
/* The port number widgets: */
if (!priv->entry_port)
- priv->entry_port = gtk_entry_new ();
+ priv->entry_port = GTK_WIDGET (hildon_number_editor_new (0, 10000 /* arbitrary min and max */));
caption = hildon_caption_new (sizegroup,
_("mcen_li_emailsetup_smtp"), priv->entry_port, NULL, HILDON_CAPTION_OPTIONAL);
gtk_widget_show (priv->entry_port);
MODEST_SECUREAUTH_COMBO_BOX (priv->combo_outgoing_auth), data->secure_auth);
/* port: */
- gchar * port_str = g_strdup_printf ("%d", data->port);
- gtk_entry_set_text (GTK_ENTRY (priv->entry_port), port_str);
- g_free (port_str);
+ hildon_number_editor_set_value (
+ HILDON_NUMBER_EDITOR (priv->entry_port), data->port);
}
}
MODEST_SECUREAUTH_COMBO_BOX (priv->combo_outgoing_auth));
/* port: */
- const gchar * port_str = gtk_entry_get_text (GTK_ENTRY (priv->entry_port));
- if (port_str)
- result->port = atoi (port_str);
+ result->port = hildon_number_editor_get_value (
+ HILDON_NUMBER_EDITOR (priv->entry_port));
return result;
}