Added an "apply" button to the preferences dialog