Split gui.h/gui.cpp into multiple files.

Put the dialog classes into their own files.
Combine Preferences into single dialog.

Make a single dialog with a QStackedWidget which holds all
preference widgets and can be selected via a QListWidget.