Implemented the preferences dialog button actions.