18 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
|
*/ |
20 |
|
|
21 |
– |
#import "VMSettingsController.h" |
22 |
– |
|
21 |
|
#import "sysdeps.h" |
22 |
|
#import "prefs.h" |
23 |
|
|
24 |
+ |
// The _UINT64 define is needed to guard against a typedef mismatch with Snow Leopard headers. |
25 |
+ |
#define _UINT64 |
26 |
+ |
|
27 |
+ |
#import "VMSettingsController.h" |
28 |
+ |
|
29 |
|
const int CDROMRefNum = -62; // RefNum of driver |
30 |
|
|
31 |
+ |
#ifdef STANDALONE_PREFS |
32 |
|
void prefs_init() |
33 |
|
{ |
34 |
|
} |
36 |
|
void prefs_exit() |
37 |
|
{ |
38 |
|
} |
39 |
+ |
#endif |
40 |
|
|
41 |
|
@implementation VMSettingsController |
42 |
|
|
174 |
|
[NSApp runModalForWindow:window]; |
175 |
|
} |
176 |
|
|
177 |
+ |
- (void) editSettingsForNewVM: (NSString *) vmdir sender: (id) sender |
178 |
+ |
{ |
179 |
+ |
chdir([vmdir fileSystemRepresentation]); |
180 |
+ |
AddPrefsDefaults(); |
181 |
+ |
AddPlatformPrefsDefaults(); |
182 |
+ |
LoadPrefs([vmdir fileSystemRepresentation]); |
183 |
+ |
PrefsReplaceString("screen", "win/800/600"); |
184 |
+ |
PrefsReplaceString("extfs", ""); |
185 |
+ |
PrefsReplaceString("ether", "slirp"); |
186 |
+ |
PrefsReplaceInt32("ramsize", 64 << 20); |
187 |
+ |
PrefsReplaceInt32("frameskip", 2); |
188 |
+ |
PrefsReplaceBool("jit", true); |
189 |
+ |
NSWindow *window = [self window]; |
190 |
+ |
[self setupGUI]; |
191 |
+ |
[NSApp runModalForWindow:window]; |
192 |
+ |
} |
193 |
+ |
|
194 |
|
static NSString *makeRelativeIfNecessary(NSString *path) |
195 |
|
{ |
196 |
|
char cwd[1024], filename[1024]; |
338 |
|
|
339 |
|
- (void) cancelEdit: (id) sender |
340 |
|
{ |
341 |
+ |
#ifdef STANDALONE_PREFS |
342 |
|
PrefsExit(); |
343 |
+ |
#endif |
344 |
|
[[self window] close]; |
345 |
|
[NSApp stopModal]; |
346 |
|
cancelWasClicked = YES; |
397 |
|
PrefsReplaceString("serialb", [[printerPort stringValue] UTF8String]); |
398 |
|
PrefsReplaceString("ether", [[ethernetInterface stringValue] UTF8String]); |
399 |
|
SavePrefs(); |
400 |
+ |
#ifdef STANDALONE_PREFS |
401 |
|
PrefsExit(); |
402 |
+ |
#endif |
403 |
|
|
404 |
|
[[self window] close]; |
405 |
|
[NSApp stopModal]; |