diff --git a/SheepShaver/src/MacOSX/Launcher/DiskType.h b/SheepShaver/src/MacOSX/Launcher/DiskType.h new file mode 100755 index 00000000..8f74d8a0 --- /dev/null +++ b/SheepShaver/src/MacOSX/Launcher/DiskType.h @@ -0,0 +1,23 @@ +// +// DiskType.h +// SheepShaver +// +// Created by maximilian on 01.02.14. +// Copyright 2014 __MyCompanyName__. All rights reserved. +// + +#import + + +@interface DiskType : NSObject { + NSString* _path; + BOOL _isCDROM; +} + +-(NSString*)path; +-(BOOL)isCDROM; + +-(void)setPath:(NSString*)thePath; +-(void)setIsCDROM:(BOOL)cdrom; + +@end diff --git a/SheepShaver/src/MacOSX/Launcher/DiskType.m b/SheepShaver/src/MacOSX/Launcher/DiskType.m new file mode 100755 index 00000000..ec21d458 --- /dev/null +++ b/SheepShaver/src/MacOSX/Launcher/DiskType.m @@ -0,0 +1,35 @@ +// +// DiskType.m +// SheepShaver +// +// Created by maximilian on 01.02.14. +// Copyright 2014 __MyCompanyName__. All rights reserved. +// + +#import "DiskType.h" + + +@implementation DiskType +-(NSString*)path +{ + return _path; +} +-(BOOL)isCDROM +{ + return _isCDROM; +} + +-(void)setPath:(NSString*)thePath +{ + _path = [thePath copy]; +} +-(void)setIsCDROM:(BOOL)cdrom +{ + _isCDROM=cdrom; +} + +-(NSString*)description { + return [NSString stringWithFormat:@"DiskType, path:%@ isCDROM:%@", _path, _isCDROM]; +} + +@end diff --git a/SheepShaver/src/MacOSX/Launcher/English.lproj/InfoPlist.strings b/SheepShaver/src/MacOSX/Launcher/English.lproj/InfoPlist.strings old mode 100644 new mode 100755 diff --git a/SheepShaver/src/MacOSX/Launcher/English.lproj/MainMenu.nib/classes.nib b/SheepShaver/src/MacOSX/Launcher/English.lproj/MainMenu.nib/classes.nib old mode 100644 new mode 100755 diff --git a/SheepShaver/src/MacOSX/Launcher/English.lproj/MainMenu.nib/info.nib b/SheepShaver/src/MacOSX/Launcher/English.lproj/MainMenu.nib/info.nib old mode 100644 new mode 100755 diff --git a/SheepShaver/src/MacOSX/Launcher/English.lproj/MainMenu.nib/keyedobjects.nib b/SheepShaver/src/MacOSX/Launcher/English.lproj/MainMenu.nib/keyedobjects.nib old mode 100644 new mode 100755 diff --git a/SheepShaver/src/MacOSX/Launcher/English.lproj/VMListWindow.nib/designable.nib b/SheepShaver/src/MacOSX/Launcher/English.lproj/VMListWindow.nib/designable.nib old mode 100644 new mode 100755 diff --git a/SheepShaver/src/MacOSX/Launcher/English.lproj/VMListWindow.nib/keyedobjects.nib b/SheepShaver/src/MacOSX/Launcher/English.lproj/VMListWindow.nib/keyedobjects.nib old mode 100644 new mode 100755 diff --git a/SheepShaver/src/MacOSX/Launcher/English.lproj/VMSettingsWindow.nib/designable.nib b/SheepShaver/src/MacOSX/Launcher/English.lproj/VMSettingsWindow.nib/designable.nib old mode 100644 new mode 100755 index 2e32cd41..d2ec997b --- a/SheepShaver/src/MacOSX/Launcher/English.lproj/VMSettingsWindow.nib/designable.nib +++ b/SheepShaver/src/MacOSX/Launcher/English.lproj/VMSettingsWindow.nib/designable.nib @@ -1,27 +1,28 @@ - + 1050 - 9J61 - 677 - 949.46 - 353.00 + 10K549 + 851 + 1038.36 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 851 + YES - + + + YES com.apple.InterfaceBuilder.CocoaPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -35,7 +36,7 @@ NSApplication - + 256 YES @@ -51,7 +52,7 @@ 40 LucidaGrande - 1.300000e+01 + 13 1044 @@ -86,12 +87,12 @@ 917024 0 - 1 - 4.000000e+01 - 1.000000e+00 - 1.000000e+04 - 1.000000e+00 + 1 + 40 + 1 + 10000 + 1 YES YES @@ -114,7 +115,7 @@ controlColor 3 - MC42NjY2NjY2OQA + MC42NjY2NjY2NjY3AA @@ -127,6 +128,7 @@ {229, 62} + NSView NSResponder @@ -142,7 +144,7 @@ View - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {580, 460} @@ -321,34 +323,43 @@ 256 - {468, 152} + {468, 136} YES - - + + 256 - {{375, 0}, {16, 17}} + {468, 17} + + + + + + 256 + {{469, 0}, {16, 17}} + YES - 3.710000e+02 - 4.000000e+01 - 1.000000e+03 + pathCol + 371 + 40 + 1000 - 75628032 - 0 - + 75628096 + 2048 + File LucidaGrande - 1.100000e+01 + 11 3100 3 MC4zMzMzMzI5OQA - + 6 System headerTextColor @@ -370,9 +381,52 @@ + + isCDROMcol + 64 + 10 + 3.4028234663852886e+38 + + 75628096 + 2048 + CDROM + + + 6 + System + headerColor + + + + + + 67239424 + 0 + + + + 1215058431 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + 3 + YES + YES + + - 3.000000e+00 - 2.000000e+00 + 3 + 2 6 @@ -383,16 +437,19 @@ MC41AA - 1.700000e+01 + 17 312475648 + + 2 4 15 0 YES + 0 - {{1, 1}, {468, 152}} + {{1, 17}, {468, 136}} @@ -402,22 +459,37 @@ 256 - {{469, 1}, {15, 152}} + {{469, 17}, {15, 136}} _doScroller: - 3.947369e-01 + 0.99350649350649356 - 256 + -2147483392 {{-100, -100}, {374, 15}} 1 _doScroller: - 9.904762e-01 + 0.99047620000000003 + + + 2304 + + YES + + + {{1, 0}, {468, 17}} + + + + + 4 + + {{16, 42}, {485, 154}} @@ -426,6 +498,8 @@ + + QSAAAEEgAABBmAAAQZgAAA @@ -502,10 +576,10 @@ YES - - 1.000000e+01 - 1.000000e+01 - 1.000000e+03 + + 10 + 10 + 1000 75628032 0 @@ -514,7 +588,7 @@ LucidaGrande - 1.200000e+01 + 12 16 @@ -538,11 +612,11 @@ - 3.000000e+00 - 2.000000e+00 + 3 + 2 - 1.900000e+01 + 19 tableViewAction: -765427712 @@ -552,6 +626,7 @@ 15 0 YES + 0 @@ -569,13 +644,8 @@ 1211912703 2 - - NSImage - NSSwitch - - - NSSwitch - + + 200 @@ -592,10 +662,10 @@ -2146566624 0 - 1.900000e+01 - 4.000000e+00 - 1.024000e+03 - 1.000000e+00 + 19 + 4 + 1024 + 1 YES @@ -717,7 +787,7 @@ 1211912703 2 - + @@ -740,7 +810,7 @@ 1 LucidaGrande - 1.300000e+01 + 13 16 @@ -979,10 +1049,10 @@ YES - - 1.000000e+01 - 1.000000e+01 - 1.000000e+03 + + 10 + 10 + 1000 75628032 0 @@ -1011,11 +1081,11 @@ - 3.000000e+00 - 2.000000e+00 + 3 + 2 - 1.900000e+01 + 19 tableViewAction: -765427712 @@ -1025,6 +1095,7 @@ 15 0 YES + 0 @@ -1064,10 +1135,10 @@ YES - - 1.000000e+01 - 1.000000e+01 - 1.000000e+03 + + 10 + 10 + 1000 75628032 0 @@ -1096,11 +1167,11 @@ - 3.000000e+00 - 2.000000e+00 + 3 + 2 - 1.900000e+01 + 19 tableViewAction: -765427712 @@ -1110,6 +1181,7 @@ 15 0 YES + 0 @@ -1194,7 +1266,7 @@ 1211912703 2 - + @@ -1465,7 +1537,7 @@ 1211912703 2 - + @@ -1487,7 +1559,7 @@ 1211912703 2 - + @@ -1530,7 +1602,7 @@ 1211912703 2 - + @@ -1552,7 +1624,7 @@ 1211912703 2 - + @@ -1609,7 +1681,7 @@ 1211912703 2 - + @@ -1752,8 +1824,8 @@ 917024 0 - 5.900000e+01 - 1.000000e+00 + 59 + 1 YES YES @@ -1867,7 +1939,39 @@ {{0, 0}, {1440, 878}} {580, 482} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} + + + + 268 + + YES + + + 268 + {{18, 18}, {85, 18}} + + YES + + 67239424 + 0 + Is CDROM + + + 1211912703 + 2 + + + + + 200 + 25 + + + + {121, 54} + + NSView @@ -2265,13 +2369,29 @@ 379 + + + isCDROM + + + + 383 + + + + isCDROMcheckbox + + + + 384 + YES 0 - + YES @@ -2280,19 +2400,19 @@ -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application @@ -2304,7 +2424,7 @@ - + DiskSize @@ -2314,7 +2434,7 @@ YES - + PrefsWindow @@ -2561,6 +2681,7 @@ + @@ -2580,6 +2701,7 @@ YES + @@ -3381,19 +3503,61 @@ + + 380 + + + YES + + + + IsCDROM + + + 381 + + + YES + + + + + + 382 + + + + + 388 + + + YES + + + + + + 390 + + + + + 391 + + + YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency 141.IBEditorWindowLastContentRect 141.IBPluginDependency 141.ImportedFromIB2 142.IBEditorWindowLastContentRect + 142.IBPluginDependency 142.IBWindowTemplateEditedContentRect 142.ImportedFromIB2 142.NSWindowTemplate.visibleAtLaunch @@ -3623,63 +3787,69 @@ 375.ImportedFromIB2 376.IBPluginDependency 377.IBPluginDependency + 380.IBEditorWindowLastContentRect + 380.IBPluginDependency + 381.IBPluginDependency + 382.IBPluginDependency + 388.IBPluginDependency + 390.IBPluginDependency + 391.IBPluginDependency YES com.apple.InterfaceBuilder.CocoaPlugin + {{899, 941}, {229, 62}} com.apple.InterfaceBuilder.CocoaPlugin + + {{739, 322}, {580, 460}} com.apple.InterfaceBuilder.CocoaPlugin - {{21, 760}, {229, 62}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{138, 317}, {580, 460}} - {{138, 317}, {580, 460}} - + {{739, 322}, {580, 460}} + - + {580, 460} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3690,19 +3860,19 @@ com.apple.InterfaceBuilder.CocoaPlugin {{601, 517}, {143, 143}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3710,65 +3880,65 @@ com.apple.InterfaceBuilder.CocoaPlugin {{196, 720}, {138, 43}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3780,51 +3950,51 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3838,11 +4008,11 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3853,22 +4023,27 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{705, 948}, {121, 54}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin YES - - YES - + YES @@ -3876,15 +4051,13 @@ YES - - YES - + YES - 379 + 391 @@ -3894,7 +4067,7 @@ NSWindowController YES - + YES addDisk: browseForKeyCodesFileClicked: @@ -3919,9 +4092,63 @@ id + + YES + + YES + addDisk: + browseForKeyCodesFileClicked: + browseForROMFileClicked: + browseForUnixRootClicked: + cancelEdit: + createDisk: + removeDisk: + saveChanges: + useRawKeyCodesClicked: + + + YES + + addDisk: + id + + + browseForKeyCodesFileClicked: + id + + + browseForROMFileClicked: + id + + + browseForUnixRootClicked: + id + + + cancelEdit: + id + + + createDisk: + id + + + removeDisk: + id + + + saveChanges: + id + + + useRawKeyCodesClicked: + id + + + YES - + YES bootFrom browseRawKeyCodesButton @@ -3937,6 +4164,8 @@ height ignoreIllegalInstructions ignoreIllegalMemoryAccesses + isCDROM + isCDROMcheckbox mixDevice modemPort mouseWheel @@ -3971,6 +4200,8 @@ NSComboBox NSButton NSButton + NSView + NSButton NSTextField NSTextField NSPopUpButton @@ -3990,15 +4221,218 @@ NSComboBox + + YES + + YES + bootFrom + browseRawKeyCodesButton + disableCdrom + disableSound + diskSaveSize + diskSaveSizeField + disks + dontUseCPUWhenIdle + enable68kDREmulator + enableJIT + ethernetInterface + height + ignoreIllegalInstructions + ignoreIllegalMemoryAccesses + isCDROM + isCDROMcheckbox + mixDevice + modemPort + mouseWheel + outDevice + printerPort + qdAccel + ramSize + ramSizeStepper + rawKeyCodes + refreshRate + romFile + scrollLines + scrollLinesStepper + unixRoot + useRawKeyCodes + videoType + width + + + YES + + bootFrom + NSComboBox + + + browseRawKeyCodesButton + NSButton + + + disableCdrom + NSButton + + + disableSound + NSButton + + + diskSaveSize + NSView + + + diskSaveSizeField + NSTextField + + + disks + NSTableView + + + dontUseCPUWhenIdle + NSButton + + + enable68kDREmulator + NSButton + + + enableJIT + NSButton + + + ethernetInterface + NSTextField + + + height + NSComboBox + + + ignoreIllegalInstructions + NSButton + + + ignoreIllegalMemoryAccesses + NSButton + + + isCDROM + NSView + + + isCDROMcheckbox + NSButton + + + mixDevice + NSTextField + + + modemPort + NSTextField + + + mouseWheel + NSPopUpButton + + + outDevice + NSTextField + + + printerPort + NSTextField + + + qdAccel + NSButton + + + ramSize + NSTextField + + + ramSizeStepper + NSStepper + + + rawKeyCodes + NSTextField + + + refreshRate + NSPopUpButton + + + romFile + NSTextField + + + scrollLines + NSTextField + + + scrollLinesStepper + NSStepper + + + unixRoot + NSTextField + + + useRawKeyCodes + NSButton + + + videoType + NSPopUpButton + + + width + NSComboBox + + + IBProjectSource - VMSettingsController.h + Launcher/VMSettingsController.h 0 - ../SheepShaverLauncher.xcodeproj + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../../SheepShaver.xcodeproj 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + NSSwitch + + + YES + {9, 8} + {7, 2} + {15, 15} + + diff --git a/SheepShaver/src/MacOSX/Launcher/English.lproj/VMSettingsWindow.nib/keyedobjects.nib b/SheepShaver/src/MacOSX/Launcher/English.lproj/VMSettingsWindow.nib/keyedobjects.nib old mode 100644 new mode 100755 index fe1f0b48..b27171c4 Binary files a/SheepShaver/src/MacOSX/Launcher/English.lproj/VMSettingsWindow.nib/keyedobjects.nib and b/SheepShaver/src/MacOSX/Launcher/English.lproj/VMSettingsWindow.nib/keyedobjects.nib differ diff --git a/SheepShaver/src/MacOSX/Launcher/VMSettingsController.h b/SheepShaver/src/MacOSX/Launcher/VMSettingsController.h old mode 100644 new mode 100755 index 2e3a237a..ae48a0b7 --- a/SheepShaver/src/MacOSX/Launcher/VMSettingsController.h +++ b/SheepShaver/src/MacOSX/Launcher/VMSettingsController.h @@ -31,6 +31,10 @@ IBOutlet NSTextField *diskSaveSizeField; NSMutableArray *diskArray; + IBOutlet NSView *isCDROM; + IBOutlet NSButton *isCDROMcheckbox; + //NSMutableArray *cdromArray; + // Setup IBOutlet NSTableView *disks; IBOutlet NSComboBox *bootFrom; diff --git a/SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm b/SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm old mode 100644 new mode 100755 index c45eacf8..9e6c5fe6 --- a/SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm +++ b/SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm @@ -26,8 +26,11 @@ #import "VMSettingsController.h" +#import "DiskType.h" + #include + const int CDROMRefNum = -62; // RefNum of driver #ifdef STANDALONE_PREFS @@ -62,12 +65,28 @@ void prefs_exit() - (int) numberOfRowsInTableView: (NSTableView *) table { + //NSLog(@"Count of diskArray: %d", [diskArray count]); return [diskArray count]; } - (id) tableView: (NSTableView *) table objectValueForTableColumn: (NSTableColumn *) col row: (int) row { - return [diskArray objectAtIndex: row]; + DiskType *d = (DiskType*)[diskArray objectAtIndex:row]; + + if([[col identifier] isEqualTo:@"isCDROMcol"]) + { + return [NSString stringWithFormat:@"%d", [d isCDROM]]; + } + + return [d path]; +} + +-(void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row +{ + if ([[tableColumn identifier] isEqual:@"isCDROMcol"]) { + DiskType *d = (DiskType*)[diskArray objectAtIndex:row]; + [d setIsCDROM:![d isCDROM]]; + } } static NSString *getStringFromPrefs(const char *key) @@ -85,11 +104,27 @@ static NSString *getStringFromPrefs(const char *key) const char *dsk; int index = 0; while ((dsk = PrefsFindString("disk", index++)) != NULL) - [diskArray addObject: [NSString stringWithUTF8String: dsk ]]; - - [disks setDataSource: self]; - [disks reloadData]; + { + DiskType *disk = [[DiskType alloc] init]; + [disk setPath:[NSString stringWithUTF8String: dsk ]]; + [disk setIsCDROM:NO]; + + [diskArray addObject:disk]; + } + /* Fetch all CDROMs */ + index = 0; + while ((dsk=PrefsFindString("cdrom", index++))!=NULL) { + DiskType *disk = [[DiskType alloc] init]; + [disk setPath:[NSString stringWithUTF8String: dsk ]]; + [disk setIsCDROM:YES]; + + [diskArray addObject:disk]; + } + + [disks setDataSource: self]; + [disks reloadData]; + int bootdriver = PrefsFindInt32("bootdriver"), active = 0; switch (bootdriver) { case 0: active = 0; break; @@ -212,6 +247,7 @@ static NSString *makeRelativeIfNecessary(NSString *path) { NSOpenPanel *open = [NSOpenPanel openPanel]; [open setCanChooseDirectories:YES]; + [open setAccessoryView:isCDROM]; [open setAllowsMultipleSelection:NO]; [open setTreatsFilePackagesAsDirectories:YES]; [open beginSheetForDirectory: [[NSFileManager defaultManager] currentDirectoryPath] @@ -225,8 +261,19 @@ static NSString *makeRelativeIfNecessary(NSString *path) - (void) _addDiskEnd: (NSOpenPanel *) open returnCode: (int) theReturnCode contextInfo: (void *) theContextInfo { if (theReturnCode == NSOKButton) { - [diskArray addObject: makeRelativeIfNecessary([open filename])]; - [disks reloadData]; + DiskType *d=[[DiskType alloc] init]; + [d setPath:makeRelativeIfNecessary([open filename])]; + + if([isCDROMcheckbox state]==NSOnState) + { + [d setIsCDROM:YES]; + } + else { + [d setIsCDROM:NO]; + } + + [diskArray addObject: d]; + [disks reloadData]; } } @@ -261,7 +308,11 @@ static NSString *makeRelativeIfNecessary(NSString *path) snprintf(cmd, sizeof(cmd), "dd if=/dev/zero \"of=%s\" bs=1024k count=%d", [[save filename] UTF8String], [diskSaveSizeField intValue]); int ret = system(cmd); if (ret == 0) { - [diskArray addObject: makeRelativeIfNecessary([save filename])]; + DiskType *d=[[DiskType alloc] init]; + [d setPath:makeRelativeIfNecessary([save filename])]; + [d setIsCDROM:NO]; + + [diskArray addObject: d]; [disks reloadData]; } } @@ -350,12 +401,24 @@ static NSString *makeRelativeIfNecessary(NSString *path) - (void) saveChanges: (id) sender { + // Remove all disks while (PrefsFindString("disk")) PrefsRemoveItem("disk"); - + // Remove all cdroms + while (PrefsFindString("cdrom")) + PrefsRemoveItem("cdrom"); + + + // Write all disks for (int i = 0; i < [diskArray count]; i++) { - PrefsAddString("disk", [[diskArray objectAtIndex:i] UTF8String]); + DiskType *d = [diskArray objectAtIndex:i]; + if([d isCDROM]) + PrefsAddString("cdrom", [[d path] UTF8String]); + else + PrefsAddString("disk", [[d path] UTF8String]); + } + PrefsReplaceInt32("bootdriver", ([bootFrom indexOfSelectedItem] == 1 ? CDROMRefNum : 0)); PrefsReplaceString("rom", [[romFile stringValue] UTF8String]); PrefsReplaceString("extfs", [[unixRoot stringValue] UTF8String]); diff --git a/SheepShaver/src/MacOSX/SheepShaver.xcodeproj/project.pbxproj b/SheepShaver/src/MacOSX/SheepShaver.xcodeproj/project.pbxproj index 37065ccc..2808f0d6 100644 --- a/SheepShaver/src/MacOSX/SheepShaver.xcodeproj/project.pbxproj +++ b/SheepShaver/src/MacOSX/SheepShaver.xcodeproj/project.pbxproj @@ -129,6 +129,7 @@ 08CD42DC14B7B85B009CA2A2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08CD42DB14B7B85B009CA2A2 /* Cocoa.framework */; }; 08CD42E814B7B8AA009CA2A2 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08CD42E714B7B8AA009CA2A2 /* Carbon.framework */; }; 08D93A16159FE174003B04EC /* clip_macosx64.mm in Sources */ = {isa = PBXBuildFile; fileRef = 08D93A15159FE174003B04EC /* clip_macosx64.mm */; }; + A7B1921418C35D4700791D8D /* DiskType.m in Sources */ = {isa = PBXBuildFile; fileRef = A7B1921318C35D4700791D8D /* DiskType.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -448,6 +449,8 @@ 08CD42DB14B7B85B009CA2A2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 08CD42E714B7B8AA009CA2A2 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 08D93A15159FE174003B04EC /* clip_macosx64.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = clip_macosx64.mm; sourceTree = ""; }; + A7B1921218C35D4700791D8D /* DiskType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiskType.h; sourceTree = ""; }; + A7B1921318C35D4700791D8D /* DiskType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DiskType.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -940,6 +943,8 @@ 0856D2D614A9A704000B1711 /* Launcher */ = { isa = PBXGroup; children = ( + A7B1921218C35D4700791D8D /* DiskType.h */, + A7B1921318C35D4700791D8D /* DiskType.m */, 0856D30714A9A704000B1711 /* VMSettingsWindow.nib */, 0856D31114A9A704000B1711 /* VMSettingsController.h */, 0856D31214A9A704000B1711 /* VMSettingsController.mm */, @@ -1452,6 +1457,7 @@ 0873A80214AC515D004F12B7 /* utils_macosx.mm in Sources */, 083E370C16EFE85000CCCA59 /* disk_sparsebundle.cpp in Sources */, 083E372216EFE87200CCCA59 /* tinyxml2.cpp in Sources */, + A7B1921418C35D4700791D8D /* DiskType.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };