}
static void
-on_entry_invalid_character (ModestValidatingEntry *self, const gchar* character, gpointer user_data)
+on_entry_invalid_account_title_character (ModestValidatingEntry *self, const gchar* character, gpointer user_data)
{
- /* ModestEasysetupWizardDialog *dialog = MODEST_EASYSETUP_WIZARD_DIALOG (user_data); */
- /* We could add a special case for whitespace here
- if (character == NULL) ...
- */
- /* TODO: Should this show just this one bad character or all the not-allowed characters? */
- gchar *message = g_strdup_printf (_CS("ckdg_ib_illegal_characters_entered"), character);
+ gchar *message = g_strdup_printf (_CS("ckdg_ib_illegal_characters_entered"),
+ "\\ / : * ? \" < > | ^");
show_error (GTK_WIDGET (self), message);
}
static void
+on_entry_invalid_fullname_character (ModestValidatingEntry *self, const gchar* character, gpointer user_data)
+{
+ gchar *message = g_strdup_printf (_CS("ckdg_ib_illegal_characters_entered"),
+ "< >");
+ show_error (GTK_WIDGET (self), message);
+}
+
+
+
+static void
on_entry_max (ModestValidatingEntry *self, gpointer user_data)
{
/* ModestAccountSettingsDialog *dialog = MODEST_ACCOUNT_SETTINGS_DIALOG (user_data); */
list_prevent = g_list_append (list_prevent, ":");
list_prevent = g_list_append (list_prevent, "*");
list_prevent = g_list_append (list_prevent, "?");
- list_prevent = g_list_append (list_prevent, "\""); /* The UI spec mentions “, but maybe means ", maybe both. */
- list_prevent = g_list_append (list_prevent, "“");
+ list_prevent = g_list_append (list_prevent, "\"");
list_prevent = g_list_append (list_prevent, "<");
list_prevent = g_list_append (list_prevent, ">");
list_prevent = g_list_append (list_prevent, "|");
MODEST_VALIDATING_ENTRY (self->entry_account_title), list_prevent);
g_list_free (list_prevent);
modest_validating_entry_set_func(MODEST_VALIDATING_ENTRY(self->entry_account_title),
- on_entry_invalid_character, self);
+ on_entry_invalid_account_title_character, self);
/* Set max length as in the UI spec:
* The UI spec seems to want us to show a dialog if we hit the maximum. */
/* The name widgets: */
self->entry_user_name = GTK_WIDGET (modest_validating_entry_new ());
+
/* Auto-capitalization is the default, so let's turn it off: */
hildon_gtk_entry_set_input_mode (GTK_ENTRY (self->entry_user_name), HILDON_GTK_INPUT_MODE_FULL);
/* Set max length as in the UI spec:
connect_for_modified (self, self->entry_user_name);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_widget_show (caption);
-
+
+
/* Prevent the use of some characters in the name,
* as required by our UI specification: */
GList *list_prevent = NULL;
modest_validating_entry_set_unallowed_characters (
MODEST_VALIDATING_ENTRY (self->entry_user_name), list_prevent);
g_list_free (list_prevent);
+ modest_validating_entry_set_func(MODEST_VALIDATING_ENTRY(self->entry_user_name),
+ on_entry_invalid_fullname_character, self);
/* The username widgets: */
self->entry_user_username = GTK_WIDGET (modest_validating_entry_new ());
return FALSE;
}
}
-
+
/* Check that the email address is valid: */
const gchar* email_address = gtk_entry_get_text (GTK_ENTRY (self->entry_user_email));
if ((!email_address) || (strlen(email_address) == 0))