show_error (GTK_WIDGET (self), _CS("ckdg_ib_maximum_characters_reached"));
}
-static void
-on_entry_invalid_character (ModestValidatingEntry *self, const gchar* character, gpointer user_data)
-{
- const gchar *show_char = NULL;
- if (character)
- show_char = character;
- else {
- show_char = "' '";
- }
-
- /* 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"), show_char);
- show_error (GTK_WIDGET (self), message);
-}
-
static gint
get_default_country_code(void)
{
g_list_free (list_prevent);
list_prevent = NULL;
modest_validating_entry_set_func(MODEST_VALIDATING_ENTRY(priv->entry_account_title),
- on_entry_invalid_character, self);
+ modest_maemo_utils_on_entry_invalid_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. */
modest_validating_entry_set_unallowed_characters (
MODEST_VALIDATING_ENTRY (priv->entry_user_name), list_prevent);
modest_validating_entry_set_func(MODEST_VALIDATING_ENTRY(priv->entry_user_name),
- on_entry_invalid_character, self);
+ modest_maemo_utils_on_entry_invalid_character, self);
g_list_free (list_prevent);
/* The username widgets: */
modest_validating_entry_set_unallowed_characters_whitespace (
MODEST_VALIDATING_ENTRY (priv->entry_user_username));
modest_validating_entry_set_func(MODEST_VALIDATING_ENTRY(priv->entry_user_username),
- on_entry_invalid_character, self);
+ modest_maemo_utils_on_entry_invalid_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. */
* as required by our UI specification: */
modest_validating_entry_set_unallowed_characters_whitespace (
MODEST_VALIDATING_ENTRY (self->entry_user_username));
+ modest_validating_entry_set_func (MODEST_VALIDATING_ENTRY (self->entry_user_username),
+ modest_maemo_utils_on_entry_invalid_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. */
#include <modest-defs.h>
#include "modest-maemo-utils.h"
+#include "modest-text-utils.h"
#include "modest-platform.h"
/*
return new_menu;
}
+
+void
+modest_maemo_utils_on_entry_invalid_character (ModestValidatingEntry *self,
+ const gchar* character,
+ gpointer user_data)
+{
+ gchar *message = NULL;
+ const gchar *show_char = NULL;
+
+ if (character)
+ show_char = character;
+ else {
+ show_char = "' '";
+ }
+
+ message = g_strdup_printf (_CS("ckdg_ib_illegal_characters_entered"), show_char);
+ hildon_banner_show_information(GTK_WIDGET (self), NULL, message);
+}
#include <tny-fs-stream.h>
#include <libosso.h>
#include "widgets/modest-global-settings-dialog.h"
+#include "widgets/modest-validating-entry.h"
#define MODEST_MAEMO_UTILS_MYDOCS_FOLDER "MyDocs"
#define MODEST_MAEMO_UTILS_DEFAULT_IMAGE_FOLDER ".images"
*/
GtkWidget *modest_maemo_utils_get_manager_menubar_as_menu (GtkUIManager *manager, const gchar *item_name);
+void modest_maemo_utils_on_entry_invalid_character (ModestValidatingEntry *self,
+ const gchar* character,
+ gpointer user_data);
+
#endif /*__MODEST_MAEMO_UTILS_H__*/