mirror of
https://github.com/TomHarte/CLK.git
synced 2025-04-09 15:39:08 +00:00
Ensures the Mac doesn't show the 'Insert...' option for machines that can't accept an insertion.
This commit is contained in:
parent
60ac9b49ea
commit
c61b9dca17
@ -301,6 +301,7 @@ class MachineDocument:
|
||||
switch item.action {
|
||||
case #selector(self.useKeyboardAsKeyboard):
|
||||
if machine == nil || !machine.hasKeyboard {
|
||||
menuItem.state = .off
|
||||
return false
|
||||
}
|
||||
|
||||
@ -309,6 +310,7 @@ class MachineDocument:
|
||||
|
||||
case #selector(self.useKeyboardAsJoystick):
|
||||
if machine == nil || !machine.hasJoystick {
|
||||
menuItem.state = .off
|
||||
return false
|
||||
}
|
||||
|
||||
@ -318,6 +320,9 @@ class MachineDocument:
|
||||
case #selector(self.showActivity(_:)):
|
||||
return self.activityPanel != nil
|
||||
|
||||
case #selector(self.insertMedia(_:)):
|
||||
return self.machine != nil && self.machine.canInsertMedia
|
||||
|
||||
default: break
|
||||
}
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ typedef NS_ENUM(NSInteger, CSMachineKeyboardInputMode) {
|
||||
@interface CSMachine : NSObject
|
||||
|
||||
- (nonnull instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/*!
|
||||
Initialises an instance of CSMachine.
|
||||
|
||||
@ -70,6 +71,8 @@ typedef NS_ENUM(NSInteger, CSMachineKeyboardInputMode) {
|
||||
@property (nonatomic, assign) CSMachineVideoSignal videoSignal;
|
||||
@property (nonatomic, assign) BOOL useAutomaticTapeMotorControl;
|
||||
|
||||
@property (nonatomic, readonly) BOOL canInsertMedia;
|
||||
|
||||
- (bool)supportsVideoSignal:(CSMachineVideoSignal)videoSignal;
|
||||
|
||||
// Input control.
|
||||
|
@ -516,6 +516,10 @@ struct ActivityObserver: public Activity::Observer {
|
||||
return [[NSString stringWithUTF8String:name.c_str()] lowercaseString];
|
||||
}
|
||||
|
||||
- (BOOL)canInsertMedia {
|
||||
return !!_machine->media_target();
|
||||
}
|
||||
|
||||
#pragma mark - Special machines
|
||||
|
||||
- (CSAtari2600 *)atari2600 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user