* src/maemo/modest-account-settings-dialog.[ch]:
authorJose Dapena Paz <jdapena@igalia.com>
Tue, 26 Feb 2008 12:30:20 +0000 (12:30 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Tue, 26 Feb 2008 12:30:20 +0000 (12:30 +0000)
        * Added methods to set the modified state, and to avoid showing
          the "settings saved" ib if we showed the dialog because of an
          auth error.
* src/modest-tny-account-store.c:
        * If an auth error has been produced and we want to show the
          account settings dialog, then we force the dialog to save its
          results always (fixes partially NB#81055).

pmo-trunk-r4226

src/maemo/modest-account-settings-dialog.c
src/maemo/modest-account-settings-dialog.h
src/modest-tny-account-store.c

index 7d28d4f..18d7834 100644 (file)
@@ -1125,7 +1125,8 @@ on_response (GtkDialog *wizard_dialog,
                                        g_object_unref (store_settings);
                                        g_object_unref (transport_settings);
                                        
-                                       hildon_banner_show_information(NULL, NULL, _("mcen_ib_advsetup_settings_saved"));
+                                       if (self->save_password)
+                                               hildon_banner_show_information(NULL, NULL, _("mcen_ib_advsetup_settings_saved"));
                                }
                        } else {
                                hildon_banner_show_information (NULL, NULL, _("mail_ib_setting_failed"));
@@ -1186,6 +1187,7 @@ modest_account_settings_dialog_init (ModestAccountSettingsDialog *self)
             G_CALLBACK (on_response), self); 
             
     self->modified = FALSE;
+    self->save_password = FALSE;
 
     /* When this window is shown, hibernation should not be possible, 
         * because there is no sensible way to save the state: */
@@ -1609,6 +1611,25 @@ enable_buttons (ModestAccountSettingsDialog *self)
                                           enable_ok);
 }
 
+void 
+modest_account_settings_dialog_set_modified (ModestAccountSettingsDialog *dialog, gboolean modified)
+{
+       g_return_if_fail (MODEST_IS_ACCOUNT_SETTINGS_DIALOG (dialog));
+
+       dialog->modified = modified;
+
+}
+
+void
+modest_account_settings_dialog_save_password (ModestAccountSettingsDialog *dialog)
+{
+       g_return_if_fail (MODEST_IS_ACCOUNT_SETTINGS_DIALOG (dialog));
+
+       dialog->save_password = TRUE;
+       dialog->modified = TRUE;
+}
+
+
 static void
 modest_account_settings_dialog_class_init (ModestAccountSettingsDialogClass *klass)
 {
index e60df5c..b2d74d5 100644 (file)
@@ -44,6 +44,7 @@ typedef struct {
        ModestAccountSettings *settings;
        
        gboolean modified;
+       gboolean save_password;
        gchar * account_name; /* This may not change. It is not user visible. */
        ModestTransportStoreProtocol incoming_protocol; /* This may not change. */
        ModestTransportStoreProtocol outgoing_protocol; /* This may not change. */
@@ -106,6 +107,10 @@ void modest_account_settings_dialog_set_account (ModestAccountSettingsDialog *di
 
 void modest_account_settings_dialog_switch_to_user_info (ModestAccountSettingsDialog *dialog);
 
+void modest_account_settings_dialog_set_modified (ModestAccountSettingsDialog *dialog, gboolean modified);
+
+void modest_account_settings_dialog_save_password (ModestAccountSettingsDialog *dialog);
+
 G_END_DECLS
 
 #endif /* _MODEST_ACCOUNT_SETTINGS_DIALOG */
index 5d8307e..34af16e 100644 (file)
@@ -539,6 +539,7 @@ show_wrong_password_dialog (TnyAccount *account)
        }
        
        dialog = modest_tny_account_store_show_account_settings_dialog (self, modest_account_name);
+       modest_account_settings_dialog_save_password (MODEST_ACCOUNT_SETTINGS_DIALOG (dialog));
        /* Show an explanatory temporary banner: */
        modest_platform_information_banner (GTK_WIDGET(dialog), NULL, _("mcen_ib_username_pw_incorrect"));
 }