Fix for the GNOME build
[modest] / src / gnome / modest-account-settings-dialog.c
index 1c095b6..5f7e83f 100644 (file)
@@ -137,9 +137,6 @@ modest_account_settings_dialog_finalize (GObject *object)
        if (self->account_manager)
                g_object_unref (G_OBJECT (self->account_manager));
                
-       if (self->specific_window)
-               gtk_widget_destroy (self->specific_window);
-               
        if (self->signature_dialog)
                gtk_widget_destroy (self->signature_dialog);
 
@@ -1605,6 +1602,29 @@ enable_buttons (ModestAccountSettingsDialog *self)
 }
 
 void
+modest_account_settings_dialog_check_allow_changes (ModestAccountSettingsDialog *self)
+{
+       ModestServerAccountSettings *incoming_settings;
+       const gchar *server_account_name;
+       gboolean username_known;
+
+       if (!G_IS_OBJECT (self->settings))
+               return;
+
+       incoming_settings = modest_account_settings_get_store_settings (self->settings);
+       server_account_name = modest_server_account_settings_get_account_name (incoming_settings);
+
+       username_known = modest_account_mgr_get_server_account_username_has_succeeded (self->account_manager, 
+                                                                                      server_account_name);
+
+       /* Enable or disable widgets */
+       gtk_widget_set_sensitive (self->entry_user_username, !username_known);
+       gtk_widget_set_sensitive (self->entry_incomingserver, !username_known);
+       gtk_widget_set_sensitive (self->entry_outgoingserver, !username_known);
+       gtk_widget_set_sensitive (self->entry_outgoing_username, !username_known);
+}
+
+void
 modest_account_settings_dialog_save_password (ModestAccountSettingsDialog *dialog)
 {
        g_return_if_fail (MODEST_IS_ACCOUNT_SETTINGS_DIALOG (dialog));