Preferences dialog done. Updated version