mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-24 12:29:06 +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 {
|
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 +310,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 +320,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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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…
Reference in New Issue
Block a user