Refactor dlgProfilePreferences.h/cpp so that there is less code duplication. I also fixed a bug where the 'set colors to default' button didn't work for the map panel.
Fix crash in the pref dialog.