25 |
|
|
26 |
|
const int CDROMRefNum = -62; // RefNum of driver |
27 |
|
|
28 |
+ |
#ifdef STANDALONE_PREFS |
29 |
|
void prefs_init() |
30 |
|
{ |
31 |
|
} |
33 |
|
void prefs_exit() |
34 |
|
{ |
35 |
|
} |
36 |
+ |
#endif |
37 |
|
|
38 |
|
@implementation VMSettingsController |
39 |
|
|
171 |
|
[NSApp runModalForWindow:window]; |
172 |
|
} |
173 |
|
|
174 |
+ |
- (void) editSettingsForNewVM: (NSString *) vmdir sender: (id) sender |
175 |
+ |
{ |
176 |
+ |
chdir([vmdir fileSystemRepresentation]); |
177 |
+ |
AddPrefsDefaults(); |
178 |
+ |
AddPlatformPrefsDefaults(); |
179 |
+ |
LoadPrefs([vmdir fileSystemRepresentation]); |
180 |
+ |
PrefsReplaceString("screen", "win/800/600"); |
181 |
+ |
PrefsReplaceString("extfs", ""); |
182 |
+ |
PrefsReplaceString("ether", "slirp"); |
183 |
+ |
PrefsReplaceInt32("ramsize", 64 << 20); |
184 |
+ |
PrefsReplaceInt32("frameskip", 2); |
185 |
+ |
PrefsReplaceBool("jit", true); |
186 |
+ |
NSWindow *window = [self window]; |
187 |
+ |
[self setupGUI]; |
188 |
+ |
[NSApp runModalForWindow:window]; |
189 |
+ |
} |
190 |
+ |
|
191 |
|
static NSString *makeRelativeIfNecessary(NSString *path) |
192 |
|
{ |
193 |
|
char cwd[1024], filename[1024]; |
335 |
|
|
336 |
|
- (void) cancelEdit: (id) sender |
337 |
|
{ |
338 |
+ |
#ifdef STANDALONE_PREFS |
339 |
|
PrefsExit(); |
340 |
+ |
#endif |
341 |
|
[[self window] close]; |
342 |
|
[NSApp stopModal]; |
343 |
|
cancelWasClicked = YES; |
394 |
|
PrefsReplaceString("serialb", [[printerPort stringValue] UTF8String]); |
395 |
|
PrefsReplaceString("ether", [[ethernetInterface stringValue] UTF8String]); |
396 |
|
SavePrefs(); |
397 |
+ |
#ifdef STANDALONE_PREFS |
398 |
|
PrefsExit(); |
399 |
+ |
#endif |
400 |
|
|
401 |
|
[[self window] close]; |
402 |
|
[NSApp stopModal]; |