Refactor dlgProfilePreferences.h/cpp.

Now there is less code duplication. This also fixes a bug where the 'set
colors to default' button didn't work for the map panel.