Fix for screen radio-button selection bug, general tidyup.

This commit is contained in:
nigel 2002-05-25 23:56:05 +00:00
parent d5995f053a
commit 0dcf103d24

View File

@ -115,7 +115,7 @@
#import <prefs.h> #import <prefs.h>
#define DEBUG 0 #define DEBUG 1
#import <debug.h> #import <debug.h>
- (PrefsEditor *) init - (PrefsEditor *) init
@ -260,7 +260,12 @@
- (IBAction) ChangeDisableSound: (NSButton *)sender - (IBAction) ChangeDisableSound: (NSButton *)sender
{ {
PrefsReplaceBool("nosound", [disableSound state]); BOOL noSound = [disableSound state];
if ( ! noSound )
WarningSheet(@"Sound is currently unimplemented", panel);
PrefsReplaceBool("nosound", noSound);
edited = YES; edited = YES;
} }
@ -280,28 +285,35 @@
// This is called when any of the screen/window, width, height or depth is changed // This is called when any of the screen/window, width, height or depth is changed
- (IBAction) ChangeScreen: (NSMatrix *)sender - (IBAction) ChangeScreen: (id)sender
{ {
short newx = [width intValue]; short newx = [width intValue];
short newy = [height intValue]; short newy = [height intValue];
short newbpp = [depth intValue]; short newbpp = [depth intValue];
short newtype = DISPLAY_WINDOW; short newtype;
char str[20]; char str[20];
if ( [sender selectedCell] == openGL ) if ( [openGL state] )
newtype = DISPLAY_OPENGL; newtype = DISPLAY_OPENGL;
if ( [sender selectedCell] == screen ) else if ( [screen state] )
newtype = DISPLAY_SCREEN; newtype = DISPLAY_SCREEN;
else if ( [window state] )
newtype = DISPLAY_WINDOW;
else
newtype = display_type;
// Check that a field actually changed // Check that a field actually changed
if ( newbpp == init_depth && newx == init_width && if ( newbpp == init_depth && newx == init_width &&
newy == init_height && newtype == display_type ) newy == init_height && newtype == display_type )
{
NSLog(@"No changed GUI items in ChangeScreen");
return; return;
}
// If we are changing type, supply some sensible defaults // If we are changing type, supply some sensible defaults
if ( newtype != display_type ) if ( newtype != display_type )
{ {
NSLog(@"Changing disylay type in ChangeScreen");
if ( newtype == DISPLAY_SCREEN ) // If changing to full screen if ( newtype == DISPLAY_SCREEN ) // If changing to full screen
{ {
// supply main screen dimensions as a default // supply main screen dimensions as a default
@ -360,7 +372,10 @@
edited = YES; edited = YES;
if ( display_type != DISPLAY_SCREEN ) if ( display_type != DISPLAY_SCREEN )
{
NSLog(@"Display type is not SCREEN (%d), resizing window", display_type);
resizeWinTo(newx, newy); resizeWinTo(newx, newy);
}
} }
- (IBAction) CreateVolume: (id)sender - (IBAction) CreateVolume: (id)sender
@ -385,7 +400,7 @@
NSString *details = [NSString stringWithFormat: NSString *details = [NSString stringWithFormat:
@"The dd command failed.\nReturn status %d (%s)", @"The dd command failed.\nReturn status %d (%s)",
retVal, strerror(errno)]; retVal, strerror(errno)];
WarningSheet(@"Unable to create volume", details, @"OK", panel); WarningSheet(@"Unable to create volume", details, nil, panel);
} }
else else
{ {
@ -427,7 +442,7 @@
int B = (int) [bytes floatValue]; int B = (int) [bytes floatValue];
float M = B / 1024 / 1024; float M = B / 1024 / 1024;
NSLog(@"%s = %f %d", __PRETTY_FUNCTION__, M, B); D(NSLog(@"%s = %f %d", __PRETTY_FUNCTION__, M, B));
PrefsReplaceInt32("ramsize", B); PrefsReplaceInt32("ramsize", B);
[MB setFloatValue: M]; [MB setFloatValue: M];
edited = YES; edited = YES;
@ -471,7 +486,7 @@
float M = [MB floatValue]; float M = [MB floatValue];
int B = (int) (M * 1024 * 1024); int B = (int) (M * 1024 * 1024);
NSLog(@"%s = %f %d", __PRETTY_FUNCTION__, M, B); D(NSLog(@"%s = %f %d", __PRETTY_FUNCTION__, M, B));
PrefsReplaceInt32("ramsize", B); PrefsReplaceInt32("ramsize", B);
[bytes setIntValue: B]; [bytes setIntValue: B];
edited = YES; edited = YES;
@ -485,17 +500,6 @@
edited = YES; edited = YES;
} }
- (IBAction) EditRAMsize: (NSTextField *)sender
{
int B = [bytes intValue];
float M = B / (1024.0 * 1024.0);
NSLog(@"%s = %d %f", __PRETTY_FUNCTION__, B, M);
PrefsReplaceInt32("ramsize", B);
[MB setFloatValue: M];
edited = YES;
}
- (IBAction) EditROMpath: (NSTextField *)sender - (IBAction) EditROMpath: (NSTextField *)sender
{ {
NSString *path = [ROMfile stringValue]; NSString *path = [ROMfile stringValue];
@ -551,7 +555,7 @@
} }
else else
{ {
WarningSheet(@"Please select a volume first", @"", @"OK", panel); WarningSheet(@"Please select a volume first", panel);
return NULL; return NULL;
} }
} }
@ -659,7 +663,7 @@
// Window already created by NIB file, just display // Window already created by NIB file, just display
[panel makeKeyAndOrderFront:self]; [panel makeKeyAndOrderFront:self];
WarningSheet(@"Compiled-in memory model does not support 24bit", WarningSheet(@"Compiled-in memory model does not support 24bit",
@"Disabling Mac Classic emulation", @"OK", panel); @"Disabling Mac Classic emulation", nil, panel);
cpu = [CPU68030 tag]; cpu = [CPU68030 tag];
PrefsReplaceInt32("cpu", cpu); PrefsReplaceInt32("cpu", cpu);
tmp = [IIci tag]; tmp = [IIci tag];