mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-13 07:57:52 +00:00
- Fixed: Cocoa IWAD picker was not updated. Also changed instances of the deprecated stringWithCString to stringWithUTF8String.
- Fixed: Mac OS X should be case insensitive like Windows. SVN r3005 (trunk)
This commit is contained in:
parent
340ffc08d6
commit
a00730c160
2 changed files with 9 additions and 9 deletions
|
@ -227,7 +227,7 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize)
|
||||||
{
|
{
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
FString wadname = sc.String;
|
FString wadname = sc.String;
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(__APPLE__) // Turns out Mac OS X is case insensitive.
|
||||||
mIWadNames.Push(wadname);
|
mIWadNames.Push(wadname);
|
||||||
#else
|
#else
|
||||||
// check for lowercase, uppercased first letter and full uppercase on Linux etc.
|
// check for lowercase, uppercased first letter and full uppercase on Linux etc.
|
||||||
|
|
|
@ -48,7 +48,7 @@ enum
|
||||||
static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" };
|
static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" };
|
||||||
|
|
||||||
// Class to convert the IWAD data into a form that Cocoa can use.
|
// Class to convert the IWAD data into a form that Cocoa can use.
|
||||||
@interface IWADTableData : NSObject
|
@interface IWADTableData : NSObject <NSTableViewDataSource>
|
||||||
{
|
{
|
||||||
NSMutableArray *data;
|
NSMutableArray *data;
|
||||||
}
|
}
|
||||||
|
@ -81,8 +81,8 @@ static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" };
|
||||||
filename = wads[i].Path;
|
filename = wads[i].Path;
|
||||||
else
|
else
|
||||||
filename++;
|
filename++;
|
||||||
[record setObject:[NSString stringWithCString:filename] forKey:[NSString stringWithCString:tableHeaders[COLUMN_IWAD]]];
|
[record setObject:[NSString stringWithUTF8String:filename] forKey:[NSString stringWithUTF8String:tableHeaders[COLUMN_IWAD]]];
|
||||||
[record setObject:[NSString stringWithCString:IWADInfos[wads[i].Type].Name] forKey:[NSString stringWithCString:tableHeaders[COLUMN_GAME]]];
|
[record setObject:[NSString stringWithUTF8String:wads[i].Name] forKey:[NSString stringWithUTF8String:tableHeaders[COLUMN_GAME]]];
|
||||||
[data addObject:record];
|
[data addObject:record];
|
||||||
[record release];
|
[record release];
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" };
|
||||||
// little more automated.
|
// little more automated.
|
||||||
- (void)makeLabel:(NSTextField *)label:(const char*) str
|
- (void)makeLabel:(NSTextField *)label:(const char*) str
|
||||||
{
|
{
|
||||||
[label setStringValue:[NSString stringWithCString:str]];
|
[label setStringValue:[NSString stringWithUTF8String:str]];
|
||||||
[label setBezeled:NO];
|
[label setBezeled:NO];
|
||||||
[label setDrawsBackground:NO];
|
[label setDrawsBackground:NO];
|
||||||
[label setEditable:NO];
|
[label setEditable:NO];
|
||||||
|
@ -156,7 +156,7 @@ static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" };
|
||||||
cancelled = false;
|
cancelled = false;
|
||||||
|
|
||||||
app = [NSApplication sharedApplication];
|
app = [NSApplication sharedApplication];
|
||||||
id windowTitle = [NSString stringWithCString:GAMESIG " " DOTVERSIONSTR ": Select an IWAD to use"];
|
id windowTitle = [NSString stringWithUTF8String:GAMESIG " " DOTVERSIONSTR ": Select an IWAD to use"];
|
||||||
|
|
||||||
NSRect frame = NSMakeRect(0, 0, 440, 450);
|
NSRect frame = NSMakeRect(0, 0, 440, 450);
|
||||||
window = [[NSWindow alloc] initWithContentRect:frame styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO];
|
window = [[NSWindow alloc] initWithContentRect:frame styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO];
|
||||||
|
@ -174,7 +174,7 @@ static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" };
|
||||||
IWADTableData *tableData = [[IWADTableData alloc] init:wads:numwads];
|
IWADTableData *tableData = [[IWADTableData alloc] init:wads:numwads];
|
||||||
for(int i = 0;i < NUM_COLUMNS;i++)
|
for(int i = 0;i < NUM_COLUMNS;i++)
|
||||||
{
|
{
|
||||||
NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:[NSString stringWithCString:tableHeaders[i]]];
|
NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:[NSString stringWithUTF8String:tableHeaders[i]]];
|
||||||
[[column headerCell] setStringValue:[column identifier]];
|
[[column headerCell] setStringValue:[column identifier]];
|
||||||
if(i == 0)
|
if(i == 0)
|
||||||
[column setMaxWidth:110];
|
[column setMaxWidth:110];
|
||||||
|
@ -211,7 +211,7 @@ static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" };
|
||||||
[[window contentView] addSubview:dontAsk];*/
|
[[window contentView] addSubview:dontAsk];*/
|
||||||
|
|
||||||
okButton = [[NSButton alloc] initWithFrame:NSMakeRect(236, 12, 96, 32)];
|
okButton = [[NSButton alloc] initWithFrame:NSMakeRect(236, 12, 96, 32)];
|
||||||
[okButton setTitle:[NSString stringWithCString:"OK"]];
|
[okButton setTitle:[NSString stringWithUTF8String:"OK"]];
|
||||||
[okButton setBezelStyle:NSRoundedBezelStyle];
|
[okButton setBezelStyle:NSRoundedBezelStyle];
|
||||||
[okButton setAction:@selector(buttonPressed:)];
|
[okButton setAction:@selector(buttonPressed:)];
|
||||||
[okButton setTarget:self];
|
[okButton setTarget:self];
|
||||||
|
@ -219,7 +219,7 @@ static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" };
|
||||||
[[window contentView] addSubview:okButton];
|
[[window contentView] addSubview:okButton];
|
||||||
|
|
||||||
cancelButton = [[NSButton alloc] initWithFrame:NSMakeRect(332, 12, 96, 32)];
|
cancelButton = [[NSButton alloc] initWithFrame:NSMakeRect(332, 12, 96, 32)];
|
||||||
[cancelButton setTitle:[NSString stringWithCString:"Cancel"]];
|
[cancelButton setTitle:[NSString stringWithUTF8String:"Cancel"]];
|
||||||
[cancelButton setBezelStyle:NSRoundedBezelStyle];
|
[cancelButton setBezelStyle:NSRoundedBezelStyle];
|
||||||
[cancelButton setAction:@selector(buttonPressed:)];
|
[cancelButton setAction:@selector(buttonPressed:)];
|
||||||
[cancelButton setTarget:self];
|
[cancelButton setTarget:self];
|
||||||
|
|
Loading…
Reference in a new issue