+2007-07-10 Murray Cumming,,, <murrayc@murrayc-desktop>
+
+ reviewed by: <delete if not using a buddy>
+
+ * ChangeLog2:
+ * src/maemo/easysetup/modest-easysetup-wizard.c:
+ (on_entry_invalid_character), (create_page_account_details),
+ (create_page_user_details), (show_error):
+ * src/maemo/modest-account-settings-dialog.c:
+ (on_entry_invalid_character), (on_entry_max),
+ (create_page_account_details), (check_data), (on_response),
+ (show_error):
+ * src/modest-tny-account-store.c: (modest_tny_account_store_alert):
+ * src/modest-tny-account.c:
+ (modest_tny_account_new_for_per_account_local_outbox_folder):
+
* please check the svn log instead
+2007-07-10 Murray Cumming <murrayc@murrayc.com>
+
+ * src/maemo/modest-account-settings-dialog.c:
+ (show_error): Use the same implementation as in
+ modest-easysetup-wizard.c:
+ (on_entry_invalid_character): The logical ID contains a %s.
+ Guessed what it should be.
+ (on_entry_max), (check_data), (on_response): Adapt to
+ changed show_error().
+ (create_page_account_details): Really call
+ modest_validating_entry_set_func() on the correct widgets.
+ * src/maemo/easysetup/modest-easysetup-wizard.c:
+ (on_entry_invalid_character): Fix the logical ID here too.
+ (create_page_account_details),
+ (create_page_user_details):
+ Really call
+ modest_validating_entry_set_func() on the correct widgets.
+
+ * src/modest-tny-account-store.c: (modest_tny_account_store_alert):
+ Do not try to use the account if it is NULL.
+
2007-07-10 Johannes Schmid <johannes.schmid@openismus.com>
* src/modest-ui-actions.c: (create_move_to_dialog),
/* We could add a special case for whitespace here
if (character == NULL) ...
*/
- show_error (GTK_WIDGET (self), _CS("ckdg_ib_illegal_characters_entered"));
+ /* 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);
+ show_error (GTK_WIDGET (self), message);
}
static GtkWidget*
modest_validating_entry_set_unallowed_characters (
MODEST_VALIDATING_ENTRY (self->entry_account_title), list_prevent);
g_list_free (list_prevent);
+ list_prevent = NULL;
modest_validating_entry_set_func(MODEST_VALIDATING_ENTRY(self->entry_account_title),
on_entry_invalid_character, self);
list_prevent = g_list_append (list_prevent, ">");
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_account_title),
+ modest_validating_entry_set_func(MODEST_VALIDATING_ENTRY(self->entry_user_name),
on_entry_invalid_character, self);
g_list_free (list_prevent);
* 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_account_title),
+ modest_validating_entry_set_func(MODEST_VALIDATING_ENTRY(self->entry_user_username),
on_entry_invalid_character, self);
/* Set max length as in the UI spec:
hildon_banner_show_information(parent_widget, NULL, text);
#if 0
- GtkDialog *dialog = GTK_DIALOG (hildon_note_new_information (parent_window, text));
+ GtkDialog *dialog = GTK_DIALOG (hildon_note_new_information (parent_window, text)); */
/*
GtkDialog *dialog = GTK_DIALOG (gtk_message_dialog_new (parent_window,
(GtkDialogFlags)0,
}
static void
-show_error (GtkWindow *parent_window, const gchar* text);
-
-static void
-show_ok (GtkWindow *parent_window, const gchar* text);
+show_error (GtkWidget *parent_widget, const gchar* text);
static void
on_combo_incoming_security_changed (GtkComboBox *widget, gpointer user_data);
return caption;
}
+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) ...
+ */
+ /* 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);
+ show_error (GTK_WIDGET (self), message);
+}
static void
on_entry_max (ModestValidatingEntry *self, gpointer user_data)
{
- ModestAccountSettingsDialog *dialog = MODEST_ACCOUNT_SETTINGS_DIALOG (user_data);
- show_error (GTK_WINDOW (dialog), _CS("ckdg_ib_maximum_characters_reached"));
+ /* ModestAccountSettingsDialog *dialog = MODEST_ACCOUNT_SETTINGS_DIALOG (user_data); */
+ show_error (GTK_WIDGET (self), _CS("ckdg_ib_maximum_characters_reached"));
}
static GtkWidget*
modest_validating_entry_set_unallowed_characters (
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);
/* Set max length as in the UI spec:
* The UI spec seems to want us to show a dialog if we hit the maximum. */
if(error == NULL || error->domain != modest_maemo_utils_get_supported_secure_authentication_error_quark() ||
error->code != MODEST_MAEMO_UTILS_GET_SUPPORTED_SECURE_AUTHENTICATION_ERROR_CANCELED)
{
- show_error (GTK_WINDOW (self), _("Could not discover supported secure authentication methods."));
+ show_error (GTK_WIDGET (self), _("Could not discover supported secure authentication methods."));
}
if(error != NULL)
const gboolean enabled =
modest_account_mgr_get_enabled (self->account_manager, self->account_name);
if (enabled)
- show_ok (GTK_WINDOW (self), _("mcen_ib_advsetup_settings_saved"));
+ show_error (GTK_WIDGET (self), _("mcen_ib_advsetup_settings_saved"));
}
else
- show_error (GTK_WINDOW (self), _("mail_ib_setting_failed"));
+ show_error (GTK_WIDGET (self), _("mail_ib_setting_failed"));
}
}
}
}
static void
-show_error (GtkWindow *parent_window, const gchar* text)
+show_error (GtkWidget *parent_widget, const gchar* text)
{
- GtkDialog *dialog = GTK_DIALOG (hildon_note_new_information (parent_window, text));
- /*
- GtkDialog *dialog = GTK_DIALOG (gtk_message_dialog_new (parent_window,
- (GtkDialogFlags)0,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- text ));
- */
+ hildon_banner_show_information(parent_widget, NULL, text);
+#if 0
+ GtkDialog *dialog = GTK_DIALOG (hildon_note_new_information (parent_widget, text);
+ /*
+ GtkDialog *dialog = GTK_DIALOG (gtk_message_dialog_new (parent_window,
+ (GtkDialogFlags)0,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK,
+ text ));
+ */
+
gtk_dialog_run (dialog);
gtk_widget_destroy (GTK_WIDGET (dialog));
-}
-
-static void
-show_ok (GtkWindow *parent_window, const gchar* text)
-{
- /* Don't show a dialog but Banner (NB #59248) */
- hildon_banner_show_information(GTK_WIDGET(
- gtk_widget_get_parent_window(GTK_WIDGET(parent_window))), NULL, text);
+#endif
}
if (!server_name)
server_name = _("Unknown Server");
- const ModestTransportStoreProtocol proto
- = modest_protocol_info_get_transport_store_protocol (tny_account_get_proto (account));
+ ModestTransportStoreProtocol proto = MODEST_PROTOCOL_STORE_POP; /* Arbitrary default. */
+ if (account) {
+ const gchar *proto_name = tny_account_get_proto (account);
+ if (proto_name)
+ proto = modest_protocol_info_get_transport_store_protocol (proto_name);
+ else {
+ g_warning("modest: %s: account with id=%s has no proto.\n", __FUNCTION__,
+ tny_account_get_id (account));
+ }
+ }
/* const gchar *prompt = NULL; */
gchar *prompt = NULL;
return NULL;
}
+ printf ("DEBUG: %s: Setting session for account: session=%p\n",
+ __FUNCTION__, session);
tny_camel_account_set_session (TNY_CAMEL_ACCOUNT(tny_account), session);
/* Make sure that the paths exists on-disk so that TnyCamelStoreAccount can