Better feedback when selecting unsupported render paths

ver1_5_1
Da Woon Jung 2005-05-28 20:01:37 +00:00
parent 643540aa6a
commit 9c933fd758
5 changed files with 89 additions and 7 deletions

View File

@ -619,6 +619,7 @@ FEATUREMETHODS(Other)
- (void) actionForItem: (id) item
{
int tag = [item tag];
id value;
if ( tag <= 128 ) tag = [self tagForKey: tag ]; // handle menu item for setting; obsolete?
if ( tag <= 128 ) { appCore->charEntered(tag); return; };
@ -628,8 +629,18 @@ FEATUREMETHODS(Other)
[self takeValue: [NSNumber numberWithInt: (1-[[self valueForTag: tag] intValue])] forTag: tag ];
break;
case 6: // 600
[self takeValue: [NSNumber numberWithInt: tag%10 ] forTag: (tag/10)*10 ];
value = [NSNumber numberWithInt: tag%10 ];
[self takeValue: value forTag: (tag/10)*10 ];
[self selectPopUpButtonItem: item withIndex: tag%10];
//[self setPopUpButtonWithTag: ((tag/10)*10) toIndex: [value intValue]];
if ([[tagDict objectForKey:[NSNumber numberWithInt:((tag/10)*10)]] isEqualToString: @"renderPath"])
{
value = [self valueForTag: (tag/10)*10];
if ([value intValue] != (tag%10))
[[control valueForKey:@"renderPanelController"] performSelector:@selector(displayRenderPathWarning:) withObject:[item title]];
else
[[control valueForKey:@"renderPanelController"] performSelector:@selector(hideRenderPathWarning)];
}
break;
case 9: // 900
[self takeValue: [NSNumber numberWithFloat: [item floatValue]] forTag: tag];

View File

@ -1,9 +1,22 @@
/* RenderPanelController */
//
// RenderPanelController.h
// celestia
//
// 2005-05 Modified substantially by Da Woon Jung
// Copyright (c) 2002 Chris Laurel. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface RenderPanelController : NSWindowController
{
IBOutlet NSImageView *renderPathCautionIcon;
IBOutlet NSTextField *renderPathWarning;
@private
NSView *_renderPathWarningSuper;
}
- (void)displayRenderPathWarning:(NSString *)warning;
- (void)hideRenderPathWarning;
@end

View File

@ -1,13 +1,56 @@
#import "RenderPanelController.h"
#import "CelestiaAppCore.h"
//
// RenderPanelController.m
// celestia
//
// 2005-05 Modified substantially by Da Woon Jung
// Copyright (c) 2002 Chris Laurel. All rights reserved.
//
#import "RenderPanelController.h"
NSDictionary *_labelDict, *_renderDict;
@implementation RenderPanelController
- (IBAction)showWindow:(id)sender
- (void)awakeFromNib
{
[super showWindow:sender];
[self hideRenderPathWarning];
}
- (void)dealloc
{
if (_renderPathWarningSuper)
{
[renderPathCautionIcon release];
[renderPathWarning release];
}
[super dealloc];
}
- (void)displayRenderPathWarning:(NSString *)warning
{
if (_renderPathWarningSuper)
{
[_renderPathWarningSuper addSubview: renderPathCautionIcon];
[_renderPathWarningSuper addSubview: renderPathWarning];
[renderPathCautionIcon release];
[renderPathWarning release];
_renderPathWarningSuper = nil;
}
[renderPathWarning setStringValue:
[NSString stringWithFormat:NSLocalizedString(@"Your system does not support\n%@",""), warning]];
}
- (void)hideRenderPathWarning
{
if (_renderPathWarningSuper == nil)
{
_renderPathWarningSuper = [renderPathWarning superview];
[renderPathCautionIcon retain];
[renderPathWarning retain];
[renderPathCautionIcon removeFromSuperview];
[renderPathWarning removeFromSuperview];
}
}
@end

BIN
macosx/caution.tiff 100644

Binary file not shown.

View File

@ -190,6 +190,7 @@
E57283990793F82A00C1F239,
E572839A0793F82A00C1F239,
E5B615060777307F001BB2BF,
E56A5AD00848F24D00A21D7E,
F578B7AE02B3E35F0100020A,
29B97318FDCFA39411CA2CEA,
E54343100783C3F200053094,
@ -1403,6 +1404,7 @@
E5B615070777307F001BB2BF,
E54343120783C3F200053094,
E53C2FBF079433D300C76766,
E56A5AD10848F24D00A21D7E,
);
isa = PBXResourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@ -2456,6 +2458,19 @@
settings = {
};
};
E56A5AD00848F24D00A21D7E = {
isa = PBXFileReference;
lastKnownFileType = image.tiff;
path = caution.tiff;
refType = 4;
sourceTree = "<group>";
};
E56A5AD10848F24D00A21D7E = {
fileRef = E56A5AD00848F24D00A21D7E;
isa = PBXBuildFile;
settings = {
};
};
E572837307939E0200C1F239 = {
buildActionMask = 8;
comments = "1. Removes extraneous Makefiles from CelestiaResources\n2. Creates writable disk image containing Celestia.app, CelestiaResources, and readme files.";