mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-18 16:30:29 +00:00
Merge pull request #518 from TomHarte/MacInsertDisplay
Tweaks the Mac UI
This commit is contained in:
commit
c1d1c451ef
@ -222,6 +222,7 @@ class MachineDocument:
|
|||||||
|
|
||||||
@IBAction final func insertMedia(_ sender: AnyObject!) {
|
@IBAction final func insertMedia(_ sender: AnyObject!) {
|
||||||
let openPanel = NSOpenPanel()
|
let openPanel = NSOpenPanel()
|
||||||
|
openPanel.message = "Hint: you can also insert media by dragging and dropping it onto the machine's window."
|
||||||
openPanel.beginSheetModal(for: self.windowControllers[0].window!) { (response) in
|
openPanel.beginSheetModal(for: self.windowControllers[0].window!) { (response) in
|
||||||
if response == .OK {
|
if response == .OK {
|
||||||
for url in openPanel.urls {
|
for url in openPanel.urls {
|
||||||
@ -301,6 +302,7 @@ class MachineDocument:
|
|||||||
switch item.action {
|
switch item.action {
|
||||||
case #selector(self.useKeyboardAsKeyboard):
|
case #selector(self.useKeyboardAsKeyboard):
|
||||||
if machine == nil || !machine.hasKeyboard {
|
if machine == nil || !machine.hasKeyboard {
|
||||||
|
menuItem.state = .off
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,6 +311,7 @@ class MachineDocument:
|
|||||||
|
|
||||||
case #selector(self.useKeyboardAsJoystick):
|
case #selector(self.useKeyboardAsJoystick):
|
||||||
if machine == nil || !machine.hasJoystick {
|
if machine == nil || !machine.hasJoystick {
|
||||||
|
menuItem.state = .off
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -318,6 +321,9 @@ class MachineDocument:
|
|||||||
case #selector(self.showActivity(_:)):
|
case #selector(self.showActivity(_:)):
|
||||||
return self.activityPanel != nil
|
return self.activityPanel != nil
|
||||||
|
|
||||||
|
case #selector(self.insertMedia(_:)):
|
||||||
|
return self.machine != nil && self.machine.canInsertMedia
|
||||||
|
|
||||||
default: break
|
default: break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<string>bin</string>
|
<string>bin</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>cartridge</string>
|
<string>cartridge.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Atari 2600 Cartridge</string>
|
<string>Atari 2600 Cartridge</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -33,7 +33,7 @@
|
|||||||
<string>rom</string>
|
<string>rom</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>chip</string>
|
<string>chip.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>ROM Image</string>
|
<string>ROM Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
<string>uef.gz</string>
|
<string>uef.gz</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>cassette</string>
|
<string>cassette.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Electron/BBC UEF Image</string>
|
<string>Electron/BBC UEF Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -74,7 +74,7 @@
|
|||||||
<string>prg</string>
|
<string>prg</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>floppy525</string>
|
<string>floppy525.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Commodore Program</string>
|
<string>Commodore Program</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -94,7 +94,7 @@
|
|||||||
<string>tap</string>
|
<string>tap</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>cassette</string>
|
<string>cassette.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Tape Image</string>
|
<string>Tape Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -114,7 +114,7 @@
|
|||||||
<string>g64</string>
|
<string>g64</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>floppy525</string>
|
<string>floppy525.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Commodore Disk</string>
|
<string>Commodore Disk</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -134,7 +134,7 @@
|
|||||||
<string>d64</string>
|
<string>d64</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>floppy525</string>
|
<string>floppy525.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Commodore 1540/1 Disk</string>
|
<string>Commodore 1540/1 Disk</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -158,7 +158,7 @@
|
|||||||
<string>adm</string>
|
<string>adm</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>floppy35</string>
|
<string>floppy35.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Electron/BBC Disk Image</string>
|
<string>Electron/BBC Disk Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -178,7 +178,7 @@
|
|||||||
<string>dsk</string>
|
<string>dsk</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>floppy35</string>
|
<string>floppy35.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Disk Image</string>
|
<string>Disk Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -199,7 +199,7 @@
|
|||||||
<string>80</string>
|
<string>80</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>cassette</string>
|
<string>cassette.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>ZX80 Tape Image</string>
|
<string>ZX80 Tape Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -221,7 +221,7 @@
|
|||||||
<string>p81</string>
|
<string>p81</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>cassette</string>
|
<string>cassette.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>ZX81 Tape Image</string>
|
<string>ZX81 Tape Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -241,7 +241,7 @@
|
|||||||
<string>csw</string>
|
<string>csw</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>cassette</string>
|
<string>cassette.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Tape Image</string>
|
<string>Tape Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -261,7 +261,7 @@
|
|||||||
<string>tzx</string>
|
<string>tzx</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>cassette</string>
|
<string>cassette.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Tape Image</string>
|
<string>Tape Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -281,7 +281,7 @@
|
|||||||
<string>cdt</string>
|
<string>cdt</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>cassette</string>
|
<string>cassette.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Amstrad CPC Tape Image</string>
|
<string>Amstrad CPC Tape Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -301,7 +301,7 @@
|
|||||||
<string>hfe</string>
|
<string>hfe</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>floppy35</string>
|
<string>floppy35.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>HxC Disk Image</string>
|
<string>HxC Disk Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -321,7 +321,7 @@
|
|||||||
<string>cas</string>
|
<string>cas</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>cassette</string>
|
<string>cassette.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>MSX Tape Image</string>
|
<string>MSX Tape Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -341,7 +341,7 @@
|
|||||||
<string>dmk</string>
|
<string>dmk</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>floppy35</string>
|
<string>floppy35.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Disk Image</string>
|
<string>Disk Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -359,7 +359,7 @@
|
|||||||
<string>tsx</string>
|
<string>tsx</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>cassette</string>
|
<string>cassette.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>MSX Tape Image</string>
|
<string>MSX Tape Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -379,7 +379,7 @@
|
|||||||
<string>col</string>
|
<string>col</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>cartridge</string>
|
<string>cartridge.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>ColecoVision Cartridge</string>
|
<string>ColecoVision Cartridge</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
@ -402,7 +402,7 @@
|
|||||||
<string>po</string>
|
<string>po</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleTypeIconFile</key>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<string>floppy525</string>
|
<string>floppy525.png</string>
|
||||||
<key>CFBundleTypeName</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>Apple II Disk Image</string>
|
<string>Apple II Disk Image</string>
|
||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
|
@ -39,6 +39,7 @@ typedef NS_ENUM(NSInteger, CSMachineKeyboardInputMode) {
|
|||||||
@interface CSMachine : NSObject
|
@interface CSMachine : NSObject
|
||||||
|
|
||||||
- (nonnull instancetype)init NS_UNAVAILABLE;
|
- (nonnull instancetype)init NS_UNAVAILABLE;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Initialises an instance of CSMachine.
|
Initialises an instance of CSMachine.
|
||||||
|
|
||||||
@ -70,6 +71,8 @@ typedef NS_ENUM(NSInteger, CSMachineKeyboardInputMode) {
|
|||||||
@property (nonatomic, assign) CSMachineVideoSignal videoSignal;
|
@property (nonatomic, assign) CSMachineVideoSignal videoSignal;
|
||||||
@property (nonatomic, assign) BOOL useAutomaticTapeMotorControl;
|
@property (nonatomic, assign) BOOL useAutomaticTapeMotorControl;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) BOOL canInsertMedia;
|
||||||
|
|
||||||
- (bool)supportsVideoSignal:(CSMachineVideoSignal)videoSignal;
|
- (bool)supportsVideoSignal:(CSMachineVideoSignal)videoSignal;
|
||||||
|
|
||||||
// Input control.
|
// Input control.
|
||||||
|
@ -516,6 +516,10 @@ struct ActivityObserver: public Activity::Observer {
|
|||||||
return [[NSString stringWithUTF8String:name.c_str()] lowercaseString];
|
return [[NSString stringWithUTF8String:name.c_str()] lowercaseString];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)canInsertMedia {
|
||||||
|
return !!_machine->media_target();
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Special machines
|
#pragma mark - Special machines
|
||||||
|
|
||||||
- (CSAtari2600 *)atari2600 {
|
- (CSAtari2600 *)atari2600 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user