1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 18:30:21 +00:00

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.

This commit is contained in:
Thomas Harte 2016-09-08 07:38:34 -04:00
parent 8c84f3581a
commit 908dc40569

View File

@ -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)