Commit bde97dac authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: don't allow the user to open the preferences window multiple times...

macosx: don't allow the user to open the preferences window multiple times (leading to orphan pref windows which can't be controlled)
parent 7b087611
......@@ -112,6 +112,7 @@ struct intf_sys_t
BOOL nib_extended_loaded; /* extended nibfile */
BOOL nib_bookmarks_loaded; /* bookmarks nibfile */
BOOL nib_sfilters_loaded; /* sfilters nibfile */
BOOL nib_prefs_loaded; /* preferences nibfile */
BOOL nib_update_loaded; /* update nibfile */
IBOutlet id o_window; /* main window */
......
......@@ -385,7 +385,7 @@ static VLCMain *_o_sharedMainInstance = nil;
}
o_about = [[VLAboutBox alloc] init];
o_prefs = nil;
o_prefs = [[VLCPrefs alloc] init];
o_open = [[VLCOpen alloc] init];
o_wizard = [[VLCWizard alloc] init];
o_extended = nil;
......@@ -1737,7 +1737,10 @@ static VLCMain *_o_sharedMainInstance = nil;
if( nib_about_loaded && o_about )
[o_about release];
if( nib_prefs_loaded && o_prefs )
[o_prefs release];
if( nib_open_loaded && o_open )
[o_open release];
......@@ -1948,9 +1951,9 @@ static VLCMain *_o_sharedMainInstance = nil;
- (IBAction)viewPreferences:(id)sender
{
/* GRUIIIIIIIK */
if( o_prefs == nil )
o_prefs = [[VLCPrefs alloc] init];
if( !nib_prefs_loaded )
nib_prefs_loaded = [NSBundle loadNibNamed:@"Preferences" owner: self];
[o_prefs showPrefs];
}
......
......@@ -108,9 +108,6 @@ static VLCPrefs *_o_sharedMainInstance = nil;
- (void)showPrefs
{
/* load our nib (if not already loaded) */
[NSBundle loadNibNamed:@"Preferences" owner:self];
[o_prefs_window center];
[o_prefs_window makeKeyAndOrderFront:self];
}
......
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