]> git.sesse.net Git - vlc/commitdiff
macosx: re-arranged the audio and video menus to look similar to the Qt4 interface...
authorFelix Paul Kühne <fkuehne@videolan.org>
Thu, 19 Feb 2009 14:37:19 +0000 (15:37 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Thu, 19 Feb 2009 14:37:33 +0000 (15:37 +0100)
extras/package/macosx/Resources/English.lproj/MainMenu.nib/classes.nib
extras/package/macosx/Resources/English.lproj/MainMenu.nib/info.nib
extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
modules/gui/macosx/controls.h
modules/gui/macosx/controls.m
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m

index ebebd13f8ddf61935bee9c6f1296c10e57793658..5300ea11a71a056829d3cca792a16d04007518b7 100644 (file)
@@ -41,6 +41,7 @@
         },
                 {
             ACTIONS =             {
+                addSubtitleFile = id;
                 backward = id;
                 faster = id;
                 forward = id;
                 "o_main_pgbar" = NSProgressIndicator;
                 "o_messages" = id;
                 "o_mi_about" = NSMenuItem;
+                "o_mi_addSub" = NSMenuItem;
                 "o_mi_add_intf" = NSMenuItem;
                 "o_mi_aspect_ratio" = NSMenuItem;
                 "o_mi_audiotrack" = NSMenuItem;
                 "o_mi_show_all" = NSMenuItem;
                 "o_mi_slower" = NSMenuItem;
                 "o_mi_snapshot" = NSMenuItem;
-                "o_mi_sprefs" = NSMenuItem;
                 "o_mi_stop" = NSMenuItem;
                 "o_mi_subtitle" = NSMenuItem;
                 "o_mi_teletext" = NSMenuItem;
index b96bb6089a85a3e4b57834291a3ff4545f8cd81d..d73eefb6a19c0982b9cddda9f548c50af4b48529 100644 (file)
@@ -3,11 +3,11 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>402 63 356 240 0 0 1280 778 </string>
+       <string>246 207 356 240 0 0 1280 778 </string>
        <key>IBEditorPositions</key>
        <dict>
                <key>29</key>
-               <string>69 318 438 44 0 0 1280 778 </string>
+               <string>391 728 438 44 0 0 1280 778 </string>
                <key>3568</key>
                <string>476 535 328 85 0 0 1280 778 </string>
                <key>915</key>
        <integer>4</integer>
        <key>IBOpenObjects</key>
        <array>
-               <integer>282</integer>
-               <integer>915</integer>
-               <integer>29</integer>
                <integer>3568</integer>
-               <integer>3706</integer>
-               <integer>21</integer>
+               <integer>29</integer>
        </array>
        <key>IBSystem Version</key>
        <string>9G55</string>
index 3e398fd2e7a564923196d05fef6711ea9cf42518..97feeb1b0f1d1c1f60e57f15862676d2d41a7b8b 100644 (file)
Binary files a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib and b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib differ
index 4fbbd6919d15642e895e249987051b227092a361..0522a1bea502854c602121cc56fb799af2e08aa9 100644 (file)
@@ -1,13 +1,13 @@
 /*****************************************************************************
  * controls.h: MacOS X interface module
  *****************************************************************************
- * Copyright (C) 2002-2007 the VideoLAN team
+ * Copyright (C) 2002-2009 the VideoLAN team
  * $Id$
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
- *          Felix Kühne <fkuehne at videolan org>
+ *          Felix Paul Kühne <fkuehne at videolan org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 - (IBAction)showPosition: (id)sender;
 - (IBAction)toogleFullscreen:(id)sender;
-- (BOOL) isFullscreen;
+- (BOOL)isFullscreen;
 - (IBAction)windowAction:(id)sender;
 
 - (IBAction)telxTransparent:(id)sender;
 - (IBAction)telxNavLink:(id)sender;
+- (IBAction)addSubtitleFile:(id)sender;
 
 - (BOOL)keyEvent:(NSEvent *)o_event;
 - (void)scrollWheel: (NSEvent *)theEvent;
index ecbf79e7ea16efa0cf91795841a48b3b3e2ed29f..4164e3dc07c614480e288c45cfb074ffdc404e85 100644 (file)
@@ -1,14 +1,14 @@
 /*****************************************************************************
  * controls.m: MacOS X interface module
  *****************************************************************************
- * Copyright (C) 2002-2007 the VideoLAN team
+ * Copyright (C) 2002-2009 the VideoLAN team
  * $Id$
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
  *          Derk-Jan Hartman <hartman at videolan dot org>
  *          Benjamin Pracht <bigben at videolan doit org>
- *          Felix Kühne <fkuehne at videolan dot org>
+ *          Felix Paul Kühne <fkuehne at videolan dot org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
     }
 }
 
-- (IBAction)telxNavLink:(id)sender;
+- (IBAction)telxNavLink:(id)sender
 {
     intf_thread_t * p_intf = VLCIntf;
     vlc_object_t *p_vbi;
     }
 }
 
+- (IBAction)addSubtitleFile:(id)sender
+{
+    NSInteger i_returnValue = 0;
+    input_thread_t * p_input = pl_CurrentInput( VLCIntf );
+    if( !p_input ) return;
+
+    input_item_t *p_item = input_GetItem( p_input );
+    if( !p_item ) return;
+
+    char *path = input_item_GetURI( p_item );
+    if( !path ) path = strdup( "" );
+
+    NSOpenPanel * openPanel = [NSOpenPanel openPanel];
+    [openPanel setCanChooseFiles: YES];
+    [openPanel setCanChooseDirectories: NO];
+    [openPanel setAllowsMultipleSelection: YES];
+    i_returnValue = [openPanel runModalForDirectory: [NSString stringWithUTF8String: path] file: nil types: [NSArray arrayWithObjects: @"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi", nil]];
+    free( path );
+
+    if( i_returnValue == NSOKButton )
+    {
+        NSUInteger c = 0;
+        if( !p_input ) return;
+        
+        c = [[openPanel filenames] count];
+        NSLog( @"count: %i", c );
+        for (int i = 0; [[openPanel filenames] count] > i ; i++)
+        {
+            msg_Dbg( VLCIntf, "loading subs from %s", [[[openPanel filenames] objectAtIndex: i] UTF8String] );
+            if( input_AddSubtitle( p_input, [[[openPanel filenames] objectAtIndex: i] UTF8String], TRUE ) )
+                msg_Warn( VLCIntf, "unable to load subtitles from '%s'",
+                         [[[openPanel filenames] objectAtIndex: i] UTF8String] );
+            i++;
+        }
+    }
+}
+
 - (void)scrollWheel:(NSEvent *)theEvent
 {
     intf_thread_t * p_intf = VLCIntf;
     /* make (un)sensitive */
     [o_parent setEnabled: ( val_list.p_list->i_count > 1 )];
 
+    /* special case for the subtitles items */
+    if( [[o_parent title] isEqualToString: _NS("Subtitles Track")] == YES )
+    {
+        NSMenuItem * o_lmi_tmp;
+        o_lmi_tmp = [o_menu addItemWithTitle: _NS("Open File...") action: @selector(addSubtitleFile:) keyEquivalent: @""];
+        [o_lmi_tmp setTarget: self];
+        [o_lmi_tmp setEnabled: YES];
+        [o_parent setEnabled: YES];
+        [o_menu addItem: [NSMenuItem separatorItem]];
+    }
+
     for( i = 0; i < val_list.p_list->i_count; i++ )
     {
         vlc_value_t another_val;
         }
     }
 
+    /* special case for the subtitles sub-menu
+     * In case that we don't have any subs, we don't want a separator item at the end */
+    if( [[o_parent title] isEqualToString: _NS("Subtitles Track")] == YES )
+    {
+        if( [o_menu numberOfItems] == 2 )
+            [o_menu removeItemAtIndex: 1];
+    }
+
     /* clean up everything */
     if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
     var_Change( p_object, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list );
index c87b134628a8c1a9e995ca3b5c56115d91d66412..3c65afecb76062e2768a845dd68001069c9892a4 100644 (file)
@@ -258,6 +258,7 @@ static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned );
     IBOutlet NSMenu * o_mu_crop;
     IBOutlet NSMenuItem * o_mi_subtitle;
     IBOutlet NSMenu * o_mu_subtitle;
+    IBOutlet NSMenuItem * o_mi_addSub;
     IBOutlet NSMenuItem * o_mi_deinterlace;
     IBOutlet NSMenu * o_mu_deinterlace;
     IBOutlet NSMenuItem * o_mi_ffmpeg_pp;
index 42924befc57c34543e752b1f9078df85698cfa80..7d3fc06e582af4d0563f69dea1e408b3ce230198 100644 (file)
@@ -590,8 +590,8 @@ static VLCMain *_o_sharedMainInstance = nil;
     [o_mu_chapter setTitle: _NS("Chapter")];
 
     [o_mu_audio setTitle: _NS("Audio")];
-    [o_mi_vol_up setTitle: _NS("Volume Up")];
-    [o_mi_vol_down setTitle: _NS("Volume Down")];
+    [o_mi_vol_up setTitle: _NS("Increase Volume")];
+    [o_mi_vol_down setTitle: _NS("Decrease Volume")];
     [o_mi_mute setTitle: _NS("Mute")];
     [o_mi_audiotrack setTitle: _NS("Audio Track")];
     [o_mu_audiotrack setTitle: _NS("Audio Track")];
@@ -620,6 +620,7 @@ static VLCMain *_o_sharedMainInstance = nil;
     [o_mu_screen setTitle: _NS("Fullscreen Video Device")];
     [o_mi_subtitle setTitle: _NS("Subtitles Track")];
     [o_mu_subtitle setTitle: _NS("Subtitles Track")];
+    [o_mi_addSub setTitle: _NS("Open File...")];
     [o_mi_deinterlace setTitle: _NS("Deinterlace")];
     [o_mu_deinterlace setTitle: _NS("Deinterlace")];
     [o_mi_ffmpeg_pp setTitle: _NS("Post processing")];
@@ -1755,6 +1756,10 @@ end:
         [o_controls setupVarMenuItem: o_mi_subtitle target: (vlc_object_t *)p_input
             var: "spu-es" selector: @selector(toggleVar:)];
 
+        /* special case for "Open File" inside the subtitles menu item */
+        if( [o_mi_videotrack isEnabled] == YES )
+            [o_mi_subtitle setEnabled: YES];
+
         aout_instance_t * p_aout = vlc_object_find( p_intf, VLC_OBJECT_AOUT,
                                                     FIND_ANYWHERE );
         if( p_aout != NULL )
@@ -1910,6 +1915,7 @@ end:
     [o_mi_screen setEnabled: b_enabled];
     [o_mi_aspect_ratio setEnabled: b_enabled];
     [o_mi_crop setEnabled: b_enabled];
+    [o_mi_teletext setEnabled: b_enabled];
 }
 
 - (IBAction)timesliderUpdate:(id)sender