settings dialog now working except that it doesn't remember the previous state