Added ReadOnly Switchs for disks

This commit is contained in:
jvernet 2016-01-02 22:29:17 +01:00 committed by Aaron Culliney
parent b6a9f667ef
commit 0fee86bc3c
11 changed files with 69 additions and 30 deletions

View File

@ -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="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="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="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"> <toolbarItem implicitItemIdentifier="F7BDADA8-832A-4E26-8BA2-01F9393AB115" label="CPU" paletteLabel="CPU" id="Oc9-Aa-A6p">
<nil key="toolTip"/> <nil key="toolTip"/>
<size key="minSize" width="28" height="30"/> <size key="minSize" width="28" height="30"/>
@ -1023,8 +1023,8 @@ DQ
</customObject> </customObject>
</objects> </objects>
<resources> <resources>
<image name="Disks" width="32" height="32"/>
<image name="NSExitFullScreenTemplate" width="15" height="15"/> <image name="NSExitFullScreenTemplate" width="15" height="15"/>
<image name="NSFolderSmart" width="32" height="32"/>
<image name="NSPreferencesGeneral" width="32" height="32"/> <image name="NSPreferencesGeneral" width="32" height="32"/>
<image name="NSRefreshTemplate" width="11" height="15"/> <image name="NSRefreshTemplate" width="11" height="15"/>
<image name="NSUser" width="32" height="32"/> <image name="NSUser" width="32" height="32"/>

View File

@ -1,16 +1,14 @@
{ {
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "mac",
"filename" : "floppy32.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "mac",
"filename" : "floppy64.png",
"scale" : "2x" "scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
} }
], ],
"info" : { "info" : {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -1,17 +1,13 @@
{ {
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "mac",
"filename" : "StepForwardNormalBlue.png", "filename" : "StepForwardNormalBlue.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "mac",
"scale" : "2x" "scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
} }
], ],
"info" : { "info" : {

View File

@ -11,6 +11,8 @@
@interface disksViewController : UIViewController<UIPickerViewDataSource, UIPickerViewDelegate> @interface disksViewController : UIViewController<UIPickerViewDataSource, UIPickerViewDelegate>
@property (retain, nonatomic) IBOutlet UIPickerView *disk1Picker; @property (retain, nonatomic) IBOutlet UIPickerView *disk1Picker;
@property (retain, nonatomic) IBOutlet UIPickerView *disk2Picker; @property (retain, nonatomic) IBOutlet UIPickerView *disk2Picker;
@property (retain, nonatomic) IBOutlet UISwitch *diskAProtection;
@property (retain, nonatomic) IBOutlet UISwitch *diskBProtection;
@property (strong,nonatomic) NSArray *_disks; @property (strong,nonatomic) NSArray *_disks;
@property (retain,nonatomic) NSString *path; @property (retain,nonatomic) NSString *path;

View File

@ -20,7 +20,9 @@
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 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]; self._disks=[[NSFileManager defaultManager] contentsOfDirectoryAtPath:self.path error:NULL];
// Connect data // Connect data
@ -54,9 +56,23 @@
{ {
// This method is triggered whenever the user makes a change to the picker selection. // This method is triggered whenever the user makes a change to the picker selection.
// The parameter named row and component represents what was selected. // The parameter named row and component represents what was selected.
NSLog(@"Selected Row %d %@", row,(NSString*)[self._disks objectAtIndex:row]); int drive=0;
disk6_eject(0); BOOL ro=YES;
const char *errMsg = disk6_insert(0, [[self.path stringByAppendingPathComponent:[self._disks objectAtIndex:row]] UTF8String], 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 - (IBAction)unwindToMainViewController:(UIStoryboardSegue*)sender
@ -68,5 +84,10 @@
cpu_resume(); cpu_resume();
} }
- (void)dealloc {
[_diskAProtection release];
[_diskBProtection release];
[super dealloc];
}
@end @end

View File

@ -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="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="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="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"> <toolbarItem implicitItemIdentifier="F7BDADA8-832A-4E26-8BA2-01F9393AB115" label="CPU" paletteLabel="CPU" id="Oc9-Aa-A6p">
<nil key="toolTip"/> <nil key="toolTip"/>
<size key="minSize" width="28" height="30"/> <size key="minSize" width="28" height="30"/>
@ -811,7 +811,7 @@ DQ
<menuItem title="Color" id="TRN-Jh-rFc"> <menuItem title="Color" id="TRN-Jh-rFc">
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
</menuItem> </menuItem>
<menuItem title="Interpolated" state="on" id="RgR-Oe-oo5"> <menuItem title="Interpolated" id="RgR-Oe-oo5">
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
</menuItem> </menuItem>
</items> </items>
@ -1023,8 +1023,8 @@ DQ
</customObject> </customObject>
</objects> </objects>
<resources> <resources>
<image name="Disks" width="32" height="32"/>
<image name="NSExitFullScreenTemplate" width="15" height="15"/> <image name="NSExitFullScreenTemplate" width="15" height="15"/>
<image name="NSFolderSmart" width="32" height="32"/>
<image name="NSPreferencesGeneral" width="32" height="32"/> <image name="NSPreferencesGeneral" width="32" height="32"/>
<image name="NSRefreshTemplate" width="11" height="15"/> <image name="NSRefreshTemplate" width="11" height="15"/>
<image name="NSUser" width="32" height="32"/> <image name="NSUser" width="32" height="32"/>

View File

@ -399,7 +399,7 @@ CA
</connections> </connections>
</toolbarItem> </toolbarItem>
<toolbarItem implicitItemIdentifier="NSToolbarFlexibleSpaceItem" id="Jsz-X5-TdN"/> <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> <connections>
<action selector="showDisksWindow:" target="M8b-ga-iOS" id="4fH-mu-VmS"/> <action selector="showDisksWindow:" target="M8b-ga-iOS" id="4fH-mu-VmS"/>
</connections> </connections>
@ -1054,8 +1054,8 @@ DQ
</customObject> </customObject>
</objects> </objects>
<resources> <resources>
<image name="Disks" width="32" height="32"/>
<image name="NSExitFullScreenTemplate" width="15" height="15"/> <image name="NSExitFullScreenTemplate" width="15" height="15"/>
<image name="NSFolderSmart" width="32" height="32"/>
<image name="NSPreferencesGeneral" width="32" height="32"/> <image name="NSPreferencesGeneral" width="32" height="32"/>
<image name="NSRefreshTemplate" width="11" height="15"/> <image name="NSRefreshTemplate" width="11" height="15"/>
<image name="NSStatusNone" width="16" height="16"/> <image name="NSStatusNone" width="16" height="16"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

After

Width:  |  Height:  |  Size: 638 B

View File

@ -202,22 +202,42 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<pickerView contentMode="center" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="e8v-O0-bvT"> <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> </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"> <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="48" height="29"/> <rect key="frame" x="20" y="269" width="104" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </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"> <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="19" y="102" width="75" height="31"/> <rect key="frame" x="20" y="102" width="101" height="31"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </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"> <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> </pickerView>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
@ -232,11 +252,13 @@
<connections> <connections>
<outlet property="disk1Picker" destination="e8v-O0-bvT" id="a8d-yH-zeq"/> <outlet property="disk1Picker" destination="e8v-O0-bvT" id="a8d-yH-zeq"/>
<outlet property="disk2Picker" destination="fEc-OG-ExC" id="9NO-Ew-hPj"/> <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> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="IYj-oP-tHf" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="IYj-oP-tHf" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="1685.625" y="-160.56338028169012"/> <point key="canvasLocation" x="1685" y="-161"/>
</scene> </scene>
<!--View Controller--> <!--View Controller-->
<scene sceneID="7d6-Zt-X84"> <scene sceneID="7d6-Zt-X84">