Added an "Apply" button to the preferences dialog