From 908dc40569125da1141086baf0e87a8689b1f676 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 8 Sep 2016 07:38:34 -0400 Subject: [PATCH] If loading automatically, assume that whatever was in the machine target set up the machine and don't override it. Too dodgy? More thought required. --- .../Documents/Vic20Document.swift | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/OSBindings/Mac/Clock Signal/Documents/Vic20Document.swift b/OSBindings/Mac/Clock Signal/Documents/Vic20Document.swift index 6eb656b3b..23dd816e4 100644 --- a/OSBindings/Mac/Clock Signal/Documents/Vic20Document.swift +++ b/OSBindings/Mac/Clock Signal/Documents/Vic20Document.swift @@ -161,18 +161,21 @@ class Vic20Document: MachineDocument { vic20.shouldLoadAutomatically = loadAutomatically self.loadAutomaticallyButton?.state = loadAutomatically ? NSOnState : NSOffState - let memorySize = standardUserDefaults.integerForKey(self.memorySizeUserDefaultsKey) - var indexToSelect: Int? - switch memorySize { - case 32: indexToSelect = 2 - case 8: indexToSelect = 1 - default: indexToSelect = 0 - } - if let indexToSelect = indexToSelect { - self.memorySizeButton?.selectItemAtIndex(indexToSelect) - setMemorySize(indexToSelect) + if !loadAutomatically { + let memorySize = standardUserDefaults.integerForKey(self.memorySizeUserDefaultsKey) + var indexToSelect: Int? + switch memorySize { + case 32: indexToSelect = 2 + case 8: indexToSelect = 1 + default: indexToSelect = 0 + } + if let indexToSelect = indexToSelect { + self.memorySizeButton?.selectItemAtIndex(indexToSelect) + setMemorySize(indexToSelect) + } } + // TODO: this should be part of the configuration let country = standardUserDefaults.integerForKey(self.countryUserDefaultsKey) setCountry(country) self.countryButton?.selectItemAtIndex(country)