]> git.sesse.net Git - vlc/commitdiff
* controls.m: call openFileGeneric via VLCMain and not directly from VLCOpen
authorFelix Paul Kühne <fkuehne@videolan.org>
Thu, 6 Jan 2005 17:58:07 +0000 (17:58 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Thu, 6 Jan 2005 17:58:07 +0000 (17:58 +0000)
* controls.h: removed "o_open"
* intf.*, open.*: make sure the open-nib is loaded only once, don't load it at launch time but dynamic and do it in VLCMain, so VLCOpen does not know about it anymore
* MainMenu.nib: we don't need instances of VLCOpen and VLCOutput anymore

extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
modules/gui/macosx/controls.h
modules/gui/macosx/controls.m
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m
modules/gui/macosx/open.h
modules/gui/macosx/open.m

index 3130ac2ce90b61bb40d407fb5d0666740220b42f..4bfb9ca84546626239bb27aa9900c836bcb8fb9f 100644 (file)
             }; 
             CLASS = VLCControls; 
             LANGUAGE = ObjC; 
-            OUTLETS = {
-                "o_btn_fullscreen" = id; 
-                "o_main" = id; 
-                "o_open" = id; 
-                "o_volumeslider" = id; 
-            }; 
+            OUTLETS = {"o_btn_fullscreen" = id; "o_main" = id; "o_volumeslider" = id; }; 
             SUPERCLASS = NSObject; 
         }, 
         {
                 "o_mu_videotrack" = id; 
                 "o_mu_visual" = id; 
                 "o_mu_window" = id; 
-                "o_open" = id; 
                 "o_playlist" = id; 
                 "o_scrollfield" = id; 
                 "o_timefield" = id; 
             }; 
             SUPERCLASS = NSObject; 
         }, 
-        {
-            ACTIONS = {}; 
-            CLASS = VLCOpen; 
-            LANGUAGE = ObjC; 
-            OUTLETS = {}; 
-            SUPERCLASS = NSObject; 
-        }, 
-        {
-            ACTIONS = {}; 
-            CLASS = VLCOutput; 
-            LANGUAGE = ObjC; 
-            OUTLETS = {}; 
-            SUPERCLASS = NSObject; 
-        }, 
+        {CLASS = VLCOpen; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 
+        {CLASS = VLCOutput; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 
         {
             ACTIONS = {
                 deleteItem = id; 
index e2c01204fcc98c7a49c7183b88a0c9fe2366fa3b..7c690c8c3264b952541d2ce268723409b165770d 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
index aea4624d7c9e0aa69c520bd88d8d846f05b29e0b..26612c38319ed04714a53e110651337fdd63fbfd 100644 (file)
@@ -28,7 +28,6 @@
  *****************************************************************************/
 @interface VLCControls : NSObject
 {
-    IBOutlet id o_open;
     IBOutlet id o_main;
 
     IBOutlet id o_btn_fullscreen;
index c7f4eaed139224fd228a7b3f2a889694aa339e64..0b424965bc4d8c8a5f10076ab61685ca806255fb 100644 (file)
@@ -54,7 +54,7 @@
         {
             vlc_mutex_unlock( &p_playlist->object_lock );
             vlc_object_release( p_playlist );
-            [o_open openFileGeneric];
+            [o_main intfOpenFileGeneric: (id)sender];
         }
         else
         {
index e6f86383a0f790b8e4ab78e85e485eb9d3de07de..6bf31894f704b177c342b47234f0b6c286fc39ff 100644 (file)
@@ -84,6 +84,7 @@ struct intf_sys_t
     id o_prefs;                 /* VLCPrefs       */
     id o_about;                 /* VLAboutBox     */
     id o_open;                  /* VLCOpen        */
+    BOOL nib_open_loaded;       /* reference to the open-nib */
 
     IBOutlet id o_window;       /* main window    */
     IBOutlet id o_scrollfield;  /* info field     */
index 3483558c9f2f157e6c472cafec78a02992197e0a..6d76c752aff76e42f6108acd70ff7362d5fb03b2 100644 (file)
@@ -294,6 +294,7 @@ static VLCMain *_o_sharedMainInstance = nil;
     
     o_about = [[VLAboutBox alloc] init];
     o_prefs = [[VLCPrefs alloc] init];
+    o_open = [[VLCOpen alloc] init];
     
     return _o_sharedMainInstance;
 }
@@ -376,10 +377,6 @@ static VLCMain *_o_sharedMainInstance = nil;
 
     [self setSubmenusEnabled: FALSE];
     [self manageVolumeSlider];
-    
-    /* let's load the open and sout-option dialogues and init the related classes */
-    o_open = [[VLCOpen alloc] init];
-    [o_open getReady];
 
     p_playlist = (playlist_t *) vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
 
@@ -1290,22 +1287,50 @@ static VLCMain *_o_sharedMainInstance = nil;
 
 - (IBAction)intfOpenFile:(id)sender
 {
-    [o_open openFile];
+    if (!nib_open_loaded)
+    {
+        nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];
+        [o_open awakeFromNib];
+        [o_open openFile];
+    } else {
+        [o_open openFile];
+    }
 }
 
 - (IBAction)intfOpenFileGeneric:(id)sender
 {
-    [o_open openFileGeneric];
+    if (!nib_open_loaded)
+    {
+        nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];
+        [o_open awakeFromNib];
+        [o_open openFileGeneric];
+    } else {
+        [o_open openFileGeneric];
+    }
 }
 
 - (IBAction)intfOpenDisc:(id)sender
 {
-    [o_open openDisc];
+    if (!nib_open_loaded)
+    {
+        nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];
+        [o_open awakeFromNib];
+        [o_open openDisc];
+    } else {
+        [o_open openDisc];
+    }
 }
 
 - (IBAction)intfOpenNet:(id)sender
 {
-    [o_open openNet];
+    if (!nib_open_loaded)
+    {
+        nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];
+        [o_open awakeFromNib];
+        [o_open openNet];
+    } else {
+        [o_open openNet];
+    }
 }
 
 - (IBAction)viewAbout:(id)sender
index 59034d991f77033659242413ebaa787e62009503..703fdca984dcc6c43fbf6cc90a29ffd64f9b124d 100644 (file)
@@ -132,6 +132,4 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
 - (IBAction)panelOk:(id)sender;
 
 - (void)openFile;
-
-- (void)getReady;
 @end
index 4bbbbd53e660e6411969ec15d48a5eeac3676fd9..38dd2bc9380817fcd15228dbe9fc9ab40f4d1a0d 100644 (file)
@@ -147,11 +147,6 @@ static VLCOpen *_o_sharedMainInstance = nil;
     return _o_sharedMainInstance;
 }
 
-- (void)getReady
-{
-    [NSBundle loadNibNamed:@"Open" owner:self];
-}
-
 - (void)awakeFromNib
 {
     intf_thread_t * p_intf = VLCIntf;