+/** TODO: This doesn't work because hildon_number_editor_get_value() does not work until
+ * focus has been lost:
+ * See https://bugs.maemo.org/show_bug.cgi?id=1806.
+ */
+static gboolean
+check_hildon_number_editor_and_warn_value_not_in_range (HildonNumberEditor *widget, gint min, gint max)
+{
+ g_return_val_if_fail (widget, FALSE);
+
+ const gint port = hildon_number_editor_get_value (widget);
+ /* printf ("DEBUG: %s, port=%d\n", __FUNCTION__, port); */
+ if (port < PORT_MIN ||
+ port > PORT_MAX) {
+
+ /* Warn the user via a dialog: */
+ /*show_error (GTK_WINDOW (self), _("mcen_ib_invalid_email"));*/
+ gchar *message = g_strdup_printf (_CS("ckct_ib_set_a_value_within_range"),
+ min,
+ max);
+ hildon_banner_show_information (GTK_WIDGET (widget), NULL, message);
+ g_free (message);
+ message = NULL;
+
+ /* Return focus to the email address entry: */
+ gtk_widget_grab_focus (GTK_WIDGET (widget));
+
+ return FALSE;
+ }
+
+ return TRUE;
+}