]> git.sesse.net Git - vlc/commitdiff
* code we migh use in the future to change the subfile we use.
authorDerk-Jan Hartman <hartman@videolan.org>
Fri, 24 Jan 2003 16:19:15 +0000 (16:19 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Fri, 24 Jan 2003 16:19:15 +0000 (16:19 +0000)
  not very useful now because of the .avi requirement to start/stop before
  loading/displaying the subs.

modules/gui/macosx/controls.m
modules/gui/macosx/intf.m

index cdfbc016f4b0964efc34bc62427ddeb32c2ee0f8..358f4192e151f21b6e44840d39aac0734451574a 100644 (file)
@@ -2,7 +2,7 @@
  * controls.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: controls.m,v 1.13 2003/01/24 00:53:41 hartman Exp $
+ * $Id: controls.m,v 1.14 2003/01/24 16:19:15 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
     NSMenuItem * o_mi = (NSMenuItem *)sender;
     intf_thread_t * p_intf = [NSApp getIntf];
 
+#if 0
+    /* We do not use this code, because you need to start stop .avi for
+     * it to work, so not very useful now  --hartman */
+    if ( [o_mi state] == NSOffState && [o_mi tag] == 2000 )
+    {
+        NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
+        
+        [o_open_panel setAllowsMultipleSelection: NO];
+        [o_open_panel setTitle: _NS("Open subtitlefile")];
+        [o_open_panel setPrompt: _NS("Open")];
+    
+        if( [o_open_panel runModalForDirectory: nil 
+                file: nil types: nil] == NSOKButton )
+        {
+            NSString *o_filename = [[o_open_panel filenames] objectAtIndex: 0];
+            config_PutPsz( p_intf, "sub-file", strdup( [o_filename cString] ));
+        }
+    }
+#endif
+
 #define p_input p_intf->p_sys->p_input
 
     if( !p_intf->p_sys->b_audio_update )
 - (IBAction)toggleVar:(id)sender
 {
     NSMenuItem * o_mi = (NSMenuItem *)sender;
-
+    
     if( [o_mi state] == NSOffState )
     {
         const char * psz_variable = (const char *)[o_mi tag];
index 892750e6954493f95859060f33ade00b2f91c828..7d2348e3209a8c408a775f32edffa931b393c5b5 100644 (file)
@@ -2,7 +2,7 @@
  * intf.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.32 2003/01/23 22:25:32 hartman Exp $
+ * $Id: intf.m,v 1.33 2003/01/24 16:19:15 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -938,6 +938,22 @@ static void Run( intf_thread_t *p_intf )
      * always sensitive. --Meuuh */
     [o_mi setEnabled: TRUE];
 
+#if 0
+    /* We do not use this code, because you need to start stop .avi for
+     * it to work, so not very useful now  --hartman */
+    if ( o_mi == o_mi_subtitle ) {
+        NSLog(@"testing");
+        [o_mi setEnabled: TRUE ];
+        NSMenuItem * o_lmi;
+        NSString * o_title;
+        o_title = _NS("Load from file..");
+        o_lmi = [o_menu addItemWithTitle: o_title
+                 action: pf_callback keyEquivalent: @""];
+        [o_lmi setTag: 2000];
+        [o_lmi setTarget: o_controls];
+    }
+#endif
+
     vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
 
 #define ES p_intf->p_sys->p_input->stream.pp_es[i]
@@ -1015,7 +1031,7 @@ static void Run( intf_thread_t *p_intf )
     }
 
     /* make (un)sensitive */
-    [o_mi setEnabled: (val.p_list->i_count > 0)];
+    [o_mi setEnabled: ( val.p_list->i_count > 0 )];
 
     for ( i = 0; i < val.p_list->i_count; i++ )
     {