Commented: Settings dialog code