mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-12 21:30:07 +00:00
Added ReadOnly Switchs for disks
This commit is contained in:
parent
b6a9f667ef
commit
0fee86bc3c
@ -391,7 +391,7 @@ CA
|
||||
<toolbarItem implicitItemIdentifier="CBD2C3ED-B0AA-40F1-818F-B61B04F93E7F" label="Preferences" paletteLabel="Preferences" tag="-1" image="NSPreferencesGeneral" id="85b-WO-tks"/>
|
||||
<toolbarItem implicitItemIdentifier="1AF00BE2-1806-4F36-AA9B-EDCD8587D441" label="Reboot" paletteLabel="Reboot" tag="-1" image="NSRefreshTemplate" id="hOg-ec-Okz"/>
|
||||
<toolbarItem implicitItemIdentifier="NSToolbarFlexibleSpaceItem" id="372-hX-Xt1"/>
|
||||
<toolbarItem implicitItemIdentifier="ED8F052E-C9AE-42F6-BA6D-2A675E8390E5" label="Disks" paletteLabel="Disks" tag="-1" image="NSFolderSmart" id="jHk-qj-bmw"/>
|
||||
<toolbarItem implicitItemIdentifier="ED8F052E-C9AE-42F6-BA6D-2A675E8390E5" label="Disks" paletteLabel="Disks" tag="-1" image="Disks" id="jHk-qj-bmw"/>
|
||||
<toolbarItem implicitItemIdentifier="F7BDADA8-832A-4E26-8BA2-01F9393AB115" label="CPU" paletteLabel="CPU" id="Oc9-Aa-A6p">
|
||||
<nil key="toolTip"/>
|
||||
<size key="minSize" width="28" height="30"/>
|
||||
@ -1023,8 +1023,8 @@ DQ
|
||||
</customObject>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="Disks" width="32" height="32"/>
|
||||
<image name="NSExitFullScreenTemplate" width="15" height="15"/>
|
||||
<image name="NSFolderSmart" width="32" height="32"/>
|
||||
<image name="NSPreferencesGeneral" width="32" height="32"/>
|
||||
<image name="NSRefreshTemplate" width="11" height="15"/>
|
||||
<image name="NSUser" width="32" height="32"/>
|
||||
|
@ -1,16 +1,14 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"idiom" : "mac",
|
||||
"filename" : "floppy32.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"idiom" : "mac",
|
||||
"filename" : "floppy64.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
BIN
Apple2Mac/Apple2Mac/Images.xcassets/Disks.imageset/floppy32.png
vendored
Normal file
BIN
Apple2Mac/Apple2Mac/Images.xcassets/Disks.imageset/floppy32.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
BIN
Apple2Mac/Apple2Mac/Images.xcassets/Disks.imageset/floppy64.png
vendored
Normal file
BIN
Apple2Mac/Apple2Mac/Images.xcassets/Disks.imageset/floppy64.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
@ -1,17 +1,13 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"idiom" : "mac",
|
||||
"filename" : "StepForwardNormalBlue.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
@ -11,6 +11,8 @@
|
||||
@interface disksViewController : UIViewController<UIPickerViewDataSource, UIPickerViewDelegate>
|
||||
@property (retain, nonatomic) IBOutlet UIPickerView *disk1Picker;
|
||||
@property (retain, nonatomic) IBOutlet UIPickerView *disk2Picker;
|
||||
@property (retain, nonatomic) IBOutlet UISwitch *diskAProtection;
|
||||
@property (retain, nonatomic) IBOutlet UISwitch *diskBProtection;
|
||||
|
||||
@property (strong,nonatomic) NSArray *_disks;
|
||||
@property (retain,nonatomic) NSString *path;
|
||||
|
@ -20,7 +20,9 @@
|
||||
|
||||
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
self.path = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"Disks"];
|
||||
//self.path = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"Disks"];
|
||||
self.path = [paths objectAtIndex:0];
|
||||
NSLog(@"Path:%@",self.path);
|
||||
self._disks=[[NSFileManager defaultManager] contentsOfDirectoryAtPath:self.path error:NULL];
|
||||
|
||||
// Connect data
|
||||
@ -54,9 +56,23 @@
|
||||
{
|
||||
// This method is triggered whenever the user makes a change to the picker selection.
|
||||
// The parameter named row and component represents what was selected.
|
||||
NSLog(@"Selected Row %d %@", row,(NSString*)[self._disks objectAtIndex:row]);
|
||||
disk6_eject(0);
|
||||
const char *errMsg = disk6_insert(0, [[self.path stringByAppendingPathComponent:[self._disks objectAtIndex:row]] UTF8String], YES);
|
||||
int drive=0;
|
||||
BOOL ro=YES;
|
||||
|
||||
if(pickerView==self.disk1Picker)
|
||||
{
|
||||
drive=0;
|
||||
ro=self.diskAProtection.on;
|
||||
}
|
||||
if(pickerView==self.disk2Picker)
|
||||
{
|
||||
drive=1;
|
||||
ro=self.diskBProtection.on;
|
||||
}
|
||||
|
||||
NSLog(@"Selected Row %d %@ %c", row,(NSString*)[self._disks objectAtIndex:row],ro);
|
||||
disk6_eject(drive);
|
||||
const char *errMsg = disk6_insert(drive, [[self.path stringByAppendingPathComponent:[self._disks objectAtIndex:row]] UTF8String], ro);
|
||||
}
|
||||
|
||||
- (IBAction)unwindToMainViewController:(UIStoryboardSegue*)sender
|
||||
@ -68,5 +84,10 @@
|
||||
cpu_resume();
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_diskAProtection release];
|
||||
[_diskBProtection release];
|
||||
[super dealloc];
|
||||
}
|
||||
@end
|
||||
|
||||
|
@ -391,7 +391,7 @@ CA
|
||||
<toolbarItem implicitItemIdentifier="CBD2C3ED-B0AA-40F1-818F-B61B04F93E7F" label="Preferences" paletteLabel="Preferences" tag="-1" image="NSPreferencesGeneral" id="85b-WO-tks"/>
|
||||
<toolbarItem implicitItemIdentifier="1AF00BE2-1806-4F36-AA9B-EDCD8587D441" label="Reboot" paletteLabel="Reboot" tag="-1" image="NSRefreshTemplate" id="hOg-ec-Okz"/>
|
||||
<toolbarItem implicitItemIdentifier="NSToolbarFlexibleSpaceItem" id="372-hX-Xt1"/>
|
||||
<toolbarItem implicitItemIdentifier="ED8F052E-C9AE-42F6-BA6D-2A675E8390E5" label="Disks" paletteLabel="Disks" tag="-1" image="NSFolderSmart" id="jHk-qj-bmw"/>
|
||||
<toolbarItem implicitItemIdentifier="ED8F052E-C9AE-42F6-BA6D-2A675E8390E5" label="Disks" paletteLabel="Disks" tag="-1" image="Disks" id="jHk-qj-bmw"/>
|
||||
<toolbarItem implicitItemIdentifier="F7BDADA8-832A-4E26-8BA2-01F9393AB115" label="CPU" paletteLabel="CPU" id="Oc9-Aa-A6p">
|
||||
<nil key="toolTip"/>
|
||||
<size key="minSize" width="28" height="30"/>
|
||||
@ -811,7 +811,7 @@ DQ
|
||||
<menuItem title="Color" id="TRN-Jh-rFc">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Interpolated" state="on" id="RgR-Oe-oo5">
|
||||
<menuItem title="Interpolated" id="RgR-Oe-oo5">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
@ -1023,8 +1023,8 @@ DQ
|
||||
</customObject>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="Disks" width="32" height="32"/>
|
||||
<image name="NSExitFullScreenTemplate" width="15" height="15"/>
|
||||
<image name="NSFolderSmart" width="32" height="32"/>
|
||||
<image name="NSPreferencesGeneral" width="32" height="32"/>
|
||||
<image name="NSRefreshTemplate" width="11" height="15"/>
|
||||
<image name="NSUser" width="32" height="32"/>
|
||||
|
@ -399,7 +399,7 @@ CA
|
||||
</connections>
|
||||
</toolbarItem>
|
||||
<toolbarItem implicitItemIdentifier="NSToolbarFlexibleSpaceItem" id="Jsz-X5-TdN"/>
|
||||
<toolbarItem implicitItemIdentifier="ED8F052E-C9AE-42F6-BA6D-2A675E8390E5" label="Disques" paletteLabel="Disques" tag="-1" image="NSFolderSmart" id="2Pg-gE-5pH">
|
||||
<toolbarItem implicitItemIdentifier="ED8F052E-C9AE-42F6-BA6D-2A675E8390E5" label="Disques" paletteLabel="Disques" tag="-1" image="Disks" id="2Pg-gE-5pH">
|
||||
<connections>
|
||||
<action selector="showDisksWindow:" target="M8b-ga-iOS" id="4fH-mu-VmS"/>
|
||||
</connections>
|
||||
@ -1054,8 +1054,8 @@ DQ
|
||||
</customObject>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="Disks" width="32" height="32"/>
|
||||
<image name="NSExitFullScreenTemplate" width="15" height="15"/>
|
||||
<image name="NSFolderSmart" width="32" height="32"/>
|
||||
<image name="NSPreferencesGeneral" width="32" height="32"/>
|
||||
<image name="NSRefreshTemplate" width="11" height="15"/>
|
||||
<image name="NSStatusNone" width="16" height="16"/>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 638 B |
@ -202,22 +202,42 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<pickerView contentMode="center" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="e8v-O0-bvT">
|
||||
<rect key="frame" x="0.0" y="174" width="320" height="70"/>
|
||||
<rect key="frame" x="0.0" y="141" width="320" height="120"/>
|
||||
</pickerView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Disk 2" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cPG-e3-f3L">
|
||||
<rect key="frame" x="20" y="269" width="48" height="29"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Slot 6 Drive 2" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cPG-e3-f3L">
|
||||
<rect key="frame" x="20" y="269" width="104" height="29"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Disk 1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TRZ-1C-cfv">
|
||||
<rect key="frame" x="19" y="102" width="75" height="31"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Slot 6 Drive 1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TRZ-1C-cfv">
|
||||
<rect key="frame" x="20" y="102" width="101" height="31"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Read Only" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dwm-hP-IsN">
|
||||
<rect key="frame" x="149" y="102" width="101" height="31"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dtO-bT-Rnh">
|
||||
<rect key="frame" x="258" y="102" width="51" height="31"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Read Only"/>
|
||||
</switch>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Read Only" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0AD-L4-9pL">
|
||||
<rect key="frame" x="149" y="269" width="101" height="31"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YAG-bn-rYg">
|
||||
<rect key="frame" x="258" y="269" width="51" height="31"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Read Only"/>
|
||||
</switch>
|
||||
<pickerView contentMode="center" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fEc-OG-ExC">
|
||||
<rect key="frame" x="0.0" y="306" width="320" height="150"/>
|
||||
<rect key="frame" x="0.0" y="306" width="320" height="120"/>
|
||||
</pickerView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
@ -232,11 +252,13 @@
|
||||
<connections>
|
||||
<outlet property="disk1Picker" destination="e8v-O0-bvT" id="a8d-yH-zeq"/>
|
||||
<outlet property="disk2Picker" destination="fEc-OG-ExC" id="9NO-Ew-hPj"/>
|
||||
<outlet property="diskAProtection" destination="dtO-bT-Rnh" id="593-wN-yWS"/>
|
||||
<outlet property="diskBProtection" destination="YAG-bn-rYg" id="x0r-xe-6Is"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="IYj-oP-tHf" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1685.625" y="-160.56338028169012"/>
|
||||
<point key="canvasLocation" x="1685" y="-161"/>
|
||||
</scene>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="7d6-Zt-X84">
|
||||
|
Loading…
x
Reference in New Issue
Block a user