Implement the new settings dialog

(nearly finished, remains a few polishing)  #36