mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
Support nibs in MainPrefs.
This commit is contained in:
parent
f591b27532
commit
abf73ea80a
3 changed files with 15 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
|||
ADDITIONAL_CPPFLAGS +=
|
||||
|
||||
# Additional flags to pass to the Objective-C compiler
|
||||
ADDITIONAL_OBJCFLAGS +=
|
||||
ADDITIONAL_OBJCFLAGS += -DUSING_NIBS
|
||||
|
||||
# Additional flags to pass to the C compiler
|
||||
ADDITIONAL_CFLAGS +=
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
@interface MainPrefs: NSObject <PrefsViewController, ForgeBundle>
|
||||
{
|
||||
NSView *view;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -35,6 +35,9 @@ static const char rcsid[] =
|
|||
#endif
|
||||
|
||||
#import <AppKit/NSButton.h>
|
||||
#ifdef USING_NIBS
|
||||
# import <AppKit/NSNibLoading.h>
|
||||
#endif
|
||||
|
||||
#import "PrefsPanel.h"
|
||||
#import "PrefsController.h"
|
||||
|
@ -44,7 +47,6 @@ static const char rcsid[] =
|
|||
@implementation MainPrefs
|
||||
|
||||
static MainPrefs *sharedInstance = nil;
|
||||
static NSView *view = nil;
|
||||
static id <BundleDelegate> owner = nil;
|
||||
|
||||
- (id) initWithOwner: (id <BundleDelegate>) anOwner
|
||||
|
@ -56,7 +58,16 @@ static id <BundleDelegate> owner = nil;
|
|||
owner = anOwner;
|
||||
[owner registerPrefsController: self];
|
||||
|
||||
view = [[MainPrefsView alloc] initWithFrame: PrefsRect];
|
||||
#ifdef USING_NIBS
|
||||
if (![NSBundle loadNibNamed: @"MainPrefsView" owner: self]) {
|
||||
NSLog (@"MainPrefs: Could not load nib \"MainPrefsView\", using compiled version");
|
||||
#endif
|
||||
view = [[MainPrefsView alloc] initWithFrame: PrefsRect];
|
||||
#ifdef USING_NIBS
|
||||
}
|
||||
#endif
|
||||
|
||||
[view retain];
|
||||
sharedInstance = self;
|
||||
}
|
||||
return sharedInstance;
|
||||
|
|
Loading…
Reference in a new issue