Adaptive Fourier-Galerkin methods