From 0638f028b32698761d1e064ad0c0c5283dc4f8b9 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 23 Jul 2007 14:52:44 +0000 Subject: [PATCH] 2007-07-23 Murray Cumming * src/dbus_api/modest-dbus-callbacks.c: (on_idle_open_default_inbox): Make sure that the application UI is visible. * src/maemo/easysetup/modest-easysetup-wizard.c: (on_entry_invalid_character): Show the word whitespace instead of (null) in the banner when whitespace was entered. (show_error): Add a comment that this does not work in Maemo Bora, though we do not know why. pmo-trunk-r2773 --- ChangeLog2 | 11 +++++++++++ src/dbus_api/modest-dbus-callbacks.c | 6 ++++++ src/maemo/easysetup/modest-easysetup-wizard.c | 19 +++++++++++++------ src/widgets/modest-validating-entry.h | 3 +-- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ChangeLog2 b/ChangeLog2 index ab6782d..e2c3044 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,5 +1,16 @@ 2007-07-23 Murray Cumming + * src/dbus_api/modest-dbus-callbacks.c: + (on_idle_open_default_inbox): Make sure that the application UI is + visible. + * src/maemo/easysetup/modest-easysetup-wizard.c: + (on_entry_invalid_character): Show the word whitespace instead + of (null) in the banner when whitespace was entered. + (show_error): Add a comment that this does not work in + Maemo Bora, though we do not know why. + +2007-07-23 Murray Cumming + * src/modest-tny-account.c: (modest_tny_account_get_special_folder): Use an if instead of an assert for when the parent account name is NULL, because this diff --git a/src/dbus_api/modest-dbus-callbacks.c b/src/dbus_api/modest-dbus-callbacks.c index 6eeabb5..295c359 100644 --- a/src/dbus_api/modest-dbus-callbacks.c +++ b/src/dbus_api/modest-dbus-callbacks.c @@ -793,6 +793,8 @@ static gint on_send_receive(GArray * arguments, gpointer data, osso_rpc_t * retv return OSSO_OK; } +static gboolean on_idle_top_application (gpointer user_data); + static gboolean on_idle_open_default_inbox(gpointer user_data) { @@ -808,6 +810,10 @@ on_idle_open_default_inbox(gpointer user_data) gdk_threads_leave (); + /* This D-Bus method is obviously meant to result in the UI being visible, + * so show it, by calling this idle handler directly: */ + on_idle_top_application(user_data); + return FALSE; /* Do not call this callback again. */ } diff --git a/src/maemo/easysetup/modest-easysetup-wizard.c b/src/maemo/easysetup/modest-easysetup-wizard.c index ad46faf..70c6336 100644 --- a/src/maemo/easysetup/modest-easysetup-wizard.c +++ b/src/maemo/easysetup/modest-easysetup-wizard.c @@ -358,11 +358,17 @@ static void on_entry_invalid_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) ... - */ + + const gchar *show_char = NULL; + if (character) + show_char = character; + else { + /* TODO: We need a logical ID for this: */ + show_char = _("whitespace"); + } + /* 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_char); show_error (GTK_WIDGET (self), message); } @@ -542,7 +548,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self) modest_validating_entry_set_unallowed_characters ( MODEST_VALIDATING_ENTRY (self->entry_user_name), list_prevent); modest_validating_entry_set_func(MODEST_VALIDATING_ENTRY(self->entry_user_name), - on_entry_invalid_character, self); + on_entry_invalid_character, self); g_list_free (list_prevent); /* The username widgets: */ @@ -562,7 +568,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self) 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), - on_entry_invalid_character, self); + 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. */ @@ -1509,6 +1515,7 @@ modest_easysetup_wizard_dialog_class_init (ModestEasysetupWizardDialogClass *kla static void show_error (GtkWidget *parent_widget, const gchar* text) { + //TODO: Apparently this doesn't show anything in Maemo Bora: hildon_banner_show_information(parent_widget, NULL, text); #if 0 diff --git a/src/widgets/modest-validating-entry.h b/src/widgets/modest-validating-entry.h index 3571ac4..956cf2a 100644 --- a/src/widgets/modest-validating-entry.h +++ b/src/widgets/modest-validating-entry.h @@ -46,11 +46,10 @@ ModestValidatingEntry* modest_validating_entry_new (void); void modest_validating_entry_set_unallowed_characters (ModestValidatingEntry *self, GList *list); void modest_validating_entry_set_unallowed_characters_whitespace (ModestValidatingEntry *self); + typedef void (* EasySetupValidatingEntryFunc) (ModestValidatingEntry *self, const gchar* character, gpointer user_data); void modest_validating_entry_set_func (ModestValidatingEntry *self, EasySetupValidatingEntryFunc func, gpointer user_data); - - typedef void (* EasySetupValidatingEntryMaxFunc) (ModestValidatingEntry *self, gpointer user_data); void modest_validating_entry_set_max_func (ModestValidatingEntry *self, EasySetupValidatingEntryMaxFunc func, gpointer user_data); -- 1.7.9.5