]> git.sesse.net Git - vlc/commitdiff
macosx: don't allow the user to open the preferences window multiple times (leading...
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 30 Dec 2007 14:53:00 +0000 (14:53 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 30 Dec 2007 14:53:00 +0000 (14:53 +0000)
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m
modules/gui/macosx/prefs.m

index 5ed8ec2ffc9f04b3432499bbebe21be94c002f53..9a1f66f8535c515874218ea0b86f62b1feb9acf8 100644 (file)
@@ -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    */
index 029a4d6715a0d7467facf4b8f5702aea6ce938aa..a5209c493bb6527ba85f730055ef8631f1cf7b76 100644 (file)
@@ -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];
 }
 
index 0b21f1394ebf2c8170f944039d0216e2628cdee1..ce90e7d3f960ce25bc2a45c5eb23f22e6c602b3e 100644 (file)
@@ -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];
 }