* Remove non-common code to prepare moving the include to common
[modest] / src / maemo / modest-account-settings-dialog.c
index 14fcc44..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: */
@@ -1572,10 +1574,10 @@ enable_buttons (ModestAccountSettingsDialog *self)
        
        /* The account details title is mandatory: */
        if (entry_is_empty(self->entry_account_title))
-                       enable_ok = FALSE;
+               enable_ok = FALSE;
 
        /* The user details username is mandatory: */
-       if (entry_is_empty(self->entry_user_username))
+       if (enable_ok && entry_is_empty(self->entry_user_username))
                enable_ok = FALSE;
                
        /* The user details email address is mandatory: */
@@ -1583,7 +1585,11 @@ enable_buttons (ModestAccountSettingsDialog *self)
                enable_ok = FALSE;
 
        /* The custom incoming server is mandatory: */
-       if (entry_is_empty(self->entry_incomingserver))
+       if (enable_ok && entry_is_empty(self->entry_incomingserver))
+               enable_ok = FALSE;
+
+       /* The custom incoming server is mandatory: */
+       if (enable_ok && entry_is_empty(self->entry_outgoingserver))
                enable_ok = FALSE;
 
        /* Outgoing username is mandatory if outgoing auth is secure */
@@ -1605,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)
 {