Launching VMs

This commit is contained in:
asvitkine 2009-08-02 18:59:26 +00:00
parent 07a2d906c4
commit d38c755204
5 changed files with 59 additions and 21 deletions

View File

@ -44,7 +44,7 @@
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
<string key="NSWindowContentMinSize">{412, 201}</string>
<object class="NSView" key="NSWindowView" id="1006">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -63,6 +63,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{374, 94}</string>
<reference key="NSSuperview" ref="665987475"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="_NSCornerView" key="NSCornerView">
<nil key="NSNextResponder"/>
@ -151,8 +152,9 @@
</object>
</object>
<string key="NSFrame">{{1, 1}, {355, 94}}</string>
<string key="NSBounds">{{19, 0}, {355, 94}}</string>
<reference key="NSSuperview" ref="459107301"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1061134531"/>
<reference key="NSDocView" ref="1061134531"/>
<reference key="NSBGColor" ref="241468539"/>
<int key="NScvFlags">4</int>
@ -162,6 +164,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{356, 1}, {15, 94}}</string>
<reference key="NSSuperview" ref="459107301"/>
<reference key="NSWindow"/>
<reference key="NSTarget" ref="459107301"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">3.947369e-01</double>
@ -171,6 +174,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{-100, -100}, {374, 15}}</string>
<reference key="NSSuperview" ref="459107301"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="459107301"/>
@ -180,6 +184,8 @@
</object>
<string key="NSFrame">{{20, 60}, {372, 96}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="665987475"/>
<int key="NSsFlags">146</int>
<reference key="NSVScroller" ref="1054079060"/>
<reference key="NSHScroller" ref="61958229"/>
@ -191,11 +197,12 @@
<int key="NSvFlags">293</int>
<string key="NSFrame">{{302, 12}, {96, 32}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="918506050">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Run</string>
<string key="NSContents">Launch</string>
<reference key="NSSupport" ref="30348852"/>
<reference key="NSControlView" ref="389169892"/>
<int key="NSButtonFlags">-2038284033</int>
@ -211,6 +218,7 @@
<int key="NSvFlags">293</int>
<string key="NSFrame">{{206, 12}, {96, 32}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="816832141">
<int key="NSCellFlags">67239424</int>
@ -231,6 +239,7 @@
<int key="NSvFlags">293</int>
<string key="NSFrame">{{14, 12}, {96, 32}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="752809530">
<int key="NSCellFlags">67239424</int>
@ -251,6 +260,7 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{17, 164}, {147, 17}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="397198339">
<int key="NSCellFlags">68288064</int>
@ -272,6 +282,7 @@
<int key="NSvFlags">293</int>
<string key="NSFrame">{{110, 11}, {96, 32}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="45041965">
<int key="NSCellFlags">67239424</int>
@ -289,6 +300,8 @@
</object>
</object>
<string key="NSFrameSize">{412, 201}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMinSize">{412, 223}</string>
@ -306,14 +319,6 @@
</object>
<int key="connectionID">46</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">runVirtualMachine:</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="389169892"/>
</object>
<int key="connectionID">47</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">newVirtualMachine:</string>
@ -354,6 +359,14 @@
</object>
<int key="connectionID">52</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">launchVirtualMachine:</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="389169892"/>
</object>
<int key="connectionID">53</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@ -618,7 +631,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">52</int>
<int key="maxID">53</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -632,8 +645,8 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>editVirtualMachineSettings:</string>
<string>importVirtualMachine:</string>
<string>launchVirtualMachine:</string>
<string>newVirtualMachine:</string>
<string>runVirtualMachine:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>

View File

@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
084186B10B3A0515004B1F63 /* VMSettingsController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 084186B00B3A0515004B1F63 /* VMSettingsController.mm */; };
08AAB16D102614D5007E1230 /* SheepShaver.icns in Resources */ = {isa = PBXBuildFile; fileRef = 08AAB16C102614D5007E1230 /* SheepShaver.icns */; };
08AAB1B310261691007E1230 /* SheepShaver in Copy SheepShaver */ = {isa = PBXBuildFile; fileRef = 08AAB1B11026168B007E1230 /* SheepShaver */; };
08B5FAFD102497FA0047FD1B /* VMSettingsWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = 08B5FAFB102497FA0047FD1B /* VMSettingsWindow.nib */; };
08B5FB01102498B00047FD1B /* VMListWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = 08B5FAFF102498B00047FD1B /* VMListWindow.nib */; };
08B5FB221024FE320047FD1B /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 08B5FB211024FE320047FD1B /* AppController.mm */; };
@ -22,11 +23,26 @@
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
08AAB19E1026164C007E1230 /* Copy SheepShaver */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 6;
files = (
08AAB1B310261691007E1230 /* SheepShaver in Copy SheepShaver */,
);
name = "Copy SheepShaver";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
084186AF0B3A0515004B1F63 /* VMSettingsController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VMSettingsController.h; sourceTree = "<group>"; };
084186B00B3A0515004B1F63 /* VMSettingsController.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = VMSettingsController.mm; sourceTree = "<group>"; };
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
08AAB16C102614D5007E1230 /* SheepShaver.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = SheepShaver.icns; path = ../SheepShaver.icns; sourceTree = SOURCE_ROOT; };
08AAB1B11026168B007E1230 /* SheepShaver */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = SheepShaver; path = ../../Unix/SheepShaver; sourceTree = SOURCE_ROOT; };
08B5FAFC102497FA0047FD1B /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/VMSettingsWindow.nib; sourceTree = "<group>"; };
08B5FB00102498B00047FD1B /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/VMListWindow.nib; sourceTree = "<group>"; };
08B5FB201024FE320047FD1B /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; };
@ -133,6 +149,7 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
08AAB1B11026168B007E1230 /* SheepShaver */,
08AAB16C102614D5007E1230 /* SheepShaver.icns */,
8D1107310486CEB800E47090 /* Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
@ -162,6 +179,7 @@
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
08AAB19E1026164C007E1230 /* Copy SheepShaver */,
);
buildRules = (
);

View File

@ -33,6 +33,6 @@
- (IBAction) newVirtualMachine: (id) sender;
- (IBAction) importVirtualMachine: (id) sender;
- (IBAction) editVirtualMachineSettings: (id) sender;
- (IBAction) runVirtualMachine: (id) sender;
- (IBAction) launchVirtualMachine: (id) sender;
@end

View File

@ -45,19 +45,19 @@
- (void) awakeFromNib
{
[vmList setDataSource: self];
[vmList setDataSource: self];
//[vmList setDelegate: self];
[vmList reloadData];
[vmList reloadData];
}
- (int) numberOfRowsInTableView: (NSTableView *) table
{
return [vmArray count];
return [vmArray count];
}
- (id) tableView: (NSTableView *) table objectValueForTableColumn: (NSTableColumn *) c row: (int) r
{
return [vmArray objectAtIndex: r]; // [[vmArray objectAtIndex: r] lastPathComponent];
return [vmArray objectAtIndex: r]; // [[vmArray objectAtIndex: r] lastPathComponent];
}
//- (NSString *) tableView: (NSTableView *) table toolTipForCell: (NSCell *) cell rect: (NSRectPointer) rect
@ -121,13 +121,20 @@
- (IBAction) editVirtualMachineSettings:(id)sender
{
int selectedRow = [vmList selectedRow];
if (selectedRow >= 0) {
if (selectedRow >= 0) {
[[VMSettingsController sharedInstance] editSettingsFor:[vmArray objectAtIndex:selectedRow] sender:sender];
}
}
}
- (IBAction) runVirtualMachine:(id)sender
- (IBAction) launchVirtualMachine:(id)sender
{
int selectedRow = [vmList selectedRow];
if (selectedRow >= 0) {
NSTask *sheep = [[NSTask alloc] init];
[sheep setLaunchPath:[[NSBundle mainBundle] pathForAuxiliaryExecutable:@"SheepShaver"]];
[sheep setArguments:[NSArray arrayWithObject:[vmArray objectAtIndex:selectedRow]]];
[sheep launch];
}
}
@end