mirror of
https://github.com/TomHarte/CLK.git
synced 2024-10-05 23:56:33 +00:00
Merge pull request #850 from TomHarte/BigSurAgain
Takes a second stab at resolving Big Sur File -> New...
This commit is contained in:
commit
3207183f05
@ -5175,7 +5175,6 @@
|
|||||||
"$(USER_LIBRARY_DIR)/Frameworks",
|
"$(USER_LIBRARY_DIR)/Frameworks",
|
||||||
);
|
);
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@ -5198,7 +5197,6 @@
|
|||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GCC_OPTIMIZATION_LEVEL = 2;
|
GCC_OPTIMIZATION_LEVEL = 2;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = NDEBUG;
|
GCC_PREPROCESSOR_DEFINITIONS = NDEBUG;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
@ -5252,7 +5250,7 @@
|
|||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_PARAMETER = YES;
|
GCC_WARN_UNUSED_PARAMETER = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
@ -5305,7 +5303,7 @@
|
|||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_PARAMETER = YES;
|
GCC_WARN_UNUSED_PARAMETER = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
@ -5327,7 +5325,6 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = "Clock Signal/Clock Signal.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Clock Signal/Clock Signal.entitlements";
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
|
||||||
DEVELOPMENT_TEAM = DV3346VVUN;
|
DEVELOPMENT_TEAM = DV3346VVUN;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
@ -5373,7 +5370,6 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = "Clock Signal/Clock Signal.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Clock Signal/Clock Signal.entitlements";
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
|
||||||
DEVELOPMENT_TEAM = DV3346VVUN;
|
DEVELOPMENT_TEAM = DV3346VVUN;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
@ -5395,6 +5391,7 @@
|
|||||||
INFOPLIST_FILE = "Clock Signal/Info.plist";
|
INFOPLIST_FILE = "Clock Signal/Info.plist";
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||||
MTL_TREAT_WARNINGS_AS_ERRORS = YES;
|
MTL_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
OTHER_CPLUSPLUSFLAGS = (
|
OTHER_CPLUSPLUSFLAGS = (
|
||||||
"$(OTHER_CFLAGS)",
|
"$(OTHER_CFLAGS)",
|
||||||
"-Wreorder",
|
"-Wreorder",
|
||||||
@ -5416,7 +5413,6 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = "Clock Signal/Clock Signal.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Clock Signal/Clock Signal.entitlements";
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
ENABLE_HARDENED_RUNTIME = NO;
|
ENABLE_HARDENED_RUNTIME = NO;
|
||||||
INFOPLIST_FILE = "Clock SignalTests/Info.plist";
|
INFOPLIST_FILE = "Clock SignalTests/Info.plist";
|
||||||
@ -5440,7 +5436,6 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = "Clock Signal/Clock Signal.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Clock Signal/Clock Signal.entitlements";
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
ENABLE_HARDENED_RUNTIME = NO;
|
ENABLE_HARDENED_RUNTIME = NO;
|
||||||
GCC_OPTIMIZATION_LEVEL = 2;
|
GCC_OPTIMIZATION_LEVEL = 2;
|
||||||
@ -5458,7 +5453,6 @@
|
|||||||
4BB73ECD1B587A5100552FC2 /* Debug */ = {
|
4BB73ECD1B587A5100552FC2 /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
|
||||||
DEVELOPMENT_TEAM = CP2SKEB3XT;
|
DEVELOPMENT_TEAM = CP2SKEB3XT;
|
||||||
INFOPLIST_FILE = "Clock SignalUITests/Info.plist";
|
INFOPLIST_FILE = "Clock SignalUITests/Info.plist";
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
|
||||||
@ -5473,7 +5467,6 @@
|
|||||||
4BB73ECE1B587A5100552FC2 /* Release */ = {
|
4BB73ECE1B587A5100552FC2 /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
|
||||||
DEVELOPMENT_TEAM = CP2SKEB3XT;
|
DEVELOPMENT_TEAM = CP2SKEB3XT;
|
||||||
INFOPLIST_FILE = "Clock SignalUITests/Info.plist";
|
INFOPLIST_FILE = "Clock SignalUITests/Info.plist";
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
|
||||||
|
@ -88,14 +88,30 @@ class MachineDocument:
|
|||||||
}
|
}
|
||||||
|
|
||||||
override func close() {
|
override func close() {
|
||||||
|
// Close any dangling sheets.
|
||||||
|
//
|
||||||
|
// Be warned: in 11.0 at least, if there are any panels then posting the endSheet request
|
||||||
|
// will defer the close(), and close() will be called again at the end of that animation.
|
||||||
|
//
|
||||||
|
// So: MAKE SURE IT'S SAFE TO ENTER THIS FUNCTION TWICE. Hence the non-assumption here about
|
||||||
|
// any windows still existing.
|
||||||
|
if self.windowControllers.count > 0, let window = self.windowControllers[0].window {
|
||||||
|
for sheet in window.sheets {
|
||||||
|
window.endSheet(sheet)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stop the machine, if any.
|
||||||
machine?.stop()
|
machine?.stop()
|
||||||
|
|
||||||
|
// Dismiss panels.
|
||||||
activityPanel?.setIsVisible(false)
|
activityPanel?.setIsVisible(false)
|
||||||
activityPanel = nil
|
activityPanel = nil
|
||||||
|
|
||||||
optionsPanel?.setIsVisible(false)
|
optionsPanel?.setIsVisible(false)
|
||||||
optionsPanel = nil
|
optionsPanel = nil
|
||||||
|
|
||||||
|
// End the update cycle.
|
||||||
actionLock.lock()
|
actionLock.lock()
|
||||||
drawLock.lock()
|
drawLock.lock()
|
||||||
machine = nil
|
machine = nil
|
||||||
@ -103,6 +119,7 @@ class MachineDocument:
|
|||||||
actionLock.unlock()
|
actionLock.unlock()
|
||||||
drawLock.unlock()
|
drawLock.unlock()
|
||||||
|
|
||||||
|
// Let the document controller do its thing.
|
||||||
super.close()
|
super.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,35 +161,37 @@ class MachineDocument:
|
|||||||
private var interactionMode: InteractionMode = .notStarted
|
private var interactionMode: InteractionMode = .notStarted
|
||||||
|
|
||||||
// Attempting to show a sheet before the window is visible (such as when the NIB is loaded) results in
|
// Attempting to show a sheet before the window is visible (such as when the NIB is loaded) results in
|
||||||
// a sheet mysteriously floating on its own. For now, use windowDidUpdate as a proxy to know that the window
|
// a sheet mysteriously floating on its own. For now, use windowDidUpdate as a proxy to check whether
|
||||||
// is visible, though it's a little premature.
|
// the window is visible.
|
||||||
func windowDidUpdate(_ notification: Notification) {
|
func windowDidUpdate(_ notification: Notification) {
|
||||||
// Grab the regular window title, if it's not already stored.
|
if self.windowControllers.count > 0, let window = self.windowControllers[0].window, window.isVisible {
|
||||||
if self.unadornedWindowTitle.count == 0 {
|
// Grab the regular window title, if it's not already stored.
|
||||||
self.unadornedWindowTitle = self.windowControllers[0].window!.title
|
if self.unadornedWindowTitle.count == 0 {
|
||||||
}
|
self.unadornedWindowTitle = window.title
|
||||||
|
|
||||||
// If an interaction mode is not yet in effect, pick the proper one and display the relevant thing.
|
|
||||||
if self.interactionMode == .notStarted {
|
|
||||||
// If a full machine exists, just continue showing it.
|
|
||||||
if self.machine != nil {
|
|
||||||
self.interactionMode = .showingMachine
|
|
||||||
setupMachineOutput()
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a machine has been picked but is not showing, there must be ROMs missing.
|
// If an interaction mode is not yet in effect, pick the proper one and display the relevant thing.
|
||||||
if self.machineDescription != nil {
|
if self.interactionMode == .notStarted {
|
||||||
self.interactionMode = .showingROMRequester
|
// If a full machine exists, just continue showing it.
|
||||||
requestRoms()
|
if self.machine != nil {
|
||||||
return
|
self.interactionMode = .showingMachine
|
||||||
}
|
setupMachineOutput()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// If a machine hasn't even been picked yet, show the machine picker.
|
// If a machine has been picked but is not showing, there must be ROMs missing.
|
||||||
self.interactionMode = .showingMachinePicker
|
if self.machineDescription != nil {
|
||||||
Bundle.main.loadNibNamed("MachinePicker", owner: self, topLevelObjects: nil)
|
self.interactionMode = .showingROMRequester
|
||||||
self.machinePicker?.establishStoredOptions()
|
requestRoms()
|
||||||
self.windowControllers[0].window?.beginSheet(self.machinePickerPanel!, completionHandler: nil)
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// If a machine hasn't even been picked yet, show the machine picker.
|
||||||
|
self.interactionMode = .showingMachinePicker
|
||||||
|
Bundle.main.loadNibNamed("MachinePicker", owner: self, topLevelObjects: nil)
|
||||||
|
self.machinePicker?.establishStoredOptions()
|
||||||
|
window.beginSheet(self.machinePickerPanel!, completionHandler: nil)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,11 @@ class MachinePicker: NSObject {
|
|||||||
|
|
||||||
// Machine type
|
// Machine type
|
||||||
if let machineIdentifier = standardUserDefaults.string(forKey: "new.machine") {
|
if let machineIdentifier = standardUserDefaults.string(forKey: "new.machine") {
|
||||||
machineSelector?.selectTabViewItem(withIdentifier: machineIdentifier as Any)
|
// If I've changed my mind about visible tabs between versions, there may not be one that corresponds
|
||||||
|
// to the stored identifier. Make sure not to raise an NSRangeException in that scenario.
|
||||||
|
if let index = machineSelector?.indexOfTabViewItem(withIdentifier: machineIdentifier as Any), index != NSNotFound {
|
||||||
|
machineSelector?.selectTabViewItem(at: index)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apple II settings
|
// Apple II settings
|
||||||
|
Loading…
Reference in New Issue
Block a user