Commit c95d33f9 authored by David Fuhrmann's avatar David Fuhrmann

macosx: Convert VLCPrefs to NSWindowController subclass

parent e91c0ed1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8152.3" systemVersion="15A216g" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14F19a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1070" identifier="macosx"/>
<development version="5100" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8152.3"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="VLCPrefs">
<connections>
<outlet property="cancelButton" destination="1543" id="xKX-e8-dhh"/>
<outlet property="prefsView" destination="1537" id="Yv9-bn-gFQ"/>
<outlet property="prefsWindow" destination="1530" id="GrB-uU-B7B"/>
<outlet property="resetButton" destination="1542" id="2QZ-tp-Blv"/>
<outlet property="saveButton" destination="1541" id="Ng1-aE-PqI"/>
<outlet property="showBasicButton" destination="3642" id="E0I-T2-hF5"/>
<outlet property="titleLabel" destination="2257" id="Dzk-M9-HUc"/>
<outlet property="tree" destination="1534" id="ZfU-1d-7BL"/>
<outlet property="window" destination="1530" id="tB4-5c-gLR"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
......
......@@ -141,7 +141,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
BOOL nib_main_loaded; /* main nibfile */
BOOL nib_about_loaded; /* about nibfile */
BOOL nib_prefs_loaded; /* preferences xibfile */
BOOL nib_coredialogs_loaded; /* CoreDialogs nibfile */
BOOL b_active_videoplayback;
......@@ -556,9 +555,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
if (!_prefs)
_prefs = [[VLCPrefs alloc] init];
if (!nib_prefs_loaded)
nib_prefs_loaded = [NSBundle loadNibNamed:@"Preferences" owner: _prefs];
return _prefs;
}
......
......@@ -27,9 +27,8 @@
/*****************************************************************************
* VLCPrefs interface
*****************************************************************************/
@interface VLCPrefs : NSObject
@interface VLCPrefs : NSWindowController
@property (readwrite, weak) IBOutlet NSWindow *prefsWindow;
@property (readwrite, weak) IBOutlet NSTextField *titleLabel;
@property (readwrite, weak) IBOutlet NSOutlineView *tree;
@property (readwrite, weak) IBOutlet NSScrollView *prefsView;
......
......@@ -155,15 +155,23 @@
@implementation VLCPrefs
- (void)awakeFromNib
- (id)init
{
self = [super initWithWindowNibName:@"Preferences"];
return self;
}
- (void)windowDidLoad
{
o_emptyView = [[NSView alloc] init];
_rootTreeItem = [[VLCTreeMainItem alloc] init];
[_prefsWindow setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
[_prefsWindow setHidesOnDeactivate:YES];
[self.window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
[self.window setHidesOnDeactivate:YES];
[_prefsWindow setTitle: _NS("Preferences")];
[self.window setTitle: _NS("Preferences")];
[_saveButton setTitle: _NS("Save")];
[_cancelButton setTitle: _NS("Cancel")];
[_resetButton setTitle: _NS("Reset All")];
......@@ -183,9 +191,9 @@
- (void)showPrefsWithLevel:(NSInteger)iWindow_level
{
[self.prefsWindow setLevel: iWindow_level];
[self.prefsWindow center];
[self.prefsWindow makeKeyAndOrderFront:self];
[self.window setLevel: iWindow_level];
[self.window center];
[self.window makeKeyAndOrderFront:self];
[_rootTreeItem resetView];
}
......@@ -195,17 +203,17 @@
[_rootTreeItem applyChanges];
[[VLCCoreInteraction sharedInstance] fixPreferences];
config_SaveConfigFile(VLCIntf);
[_prefsWindow orderOut:self];
[self.window orderOut:self];
}
- (IBAction)closePrefs: (id)sender
{
[_prefsWindow orderOut:self];
[self.window orderOut:self];
}
- (IBAction)showSimplePrefs: (id)sender
{
[_prefsWindow orderOut: self];
[self.window orderOut: self];
[[[VLCMain sharedInstance] simplePreferences] showSimplePrefs];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment