macosx: Add Find menu item and key shortcut
authorDavid Fuhrmann <dfuhrmann@videolan.org>
Sat, 23 Apr 2016 08:23:12 +0000 (10:23 +0200)
committerDavid Fuhrmann <dfuhrmann@videolan.org>
Sat, 23 Apr 2016 08:53:07 +0000 (10:53 +0200)
According to HIG, Command+F shall be used, but as it is already
taken by fullscreen, lets use Command+Shift+F.

refs #13865

extras/package/macosx/Resources/English.lproj/MainMenu.xib
modules/gui/macosx/MainMenu.h
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainWindow.h
modules/gui/macosx/MainWindow.m
modules/gui/macosx/simple_prefs.m

index c4e9cba..332c4e6 100644 (file)
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10116" systemVersion="15F24b" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
         <deployment version="1070" identifier="macosx"/>
         <development version="7000" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10116"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="VLCMainMenu">
@@ -53,6 +53,7 @@
                 <outlet property="extensions" destination="4942" id="qSU-2W-Chy"/>
                 <outlet property="extensionsMenu" destination="4943" id="IAw-5Z-Wvo"/>
                 <outlet property="fileMenu" destination="81" id="lbA-s5-6qj"/>
+                <outlet property="findItem" destination="6J6-tz-ctn" id="eZU-nd-y0B"/>
                 <outlet property="fittoscreen" destination="1514" id="79G-ad-1hf"/>
                 <outlet property="floatontop" destination="1499" id="yvd-Sz-zL3"/>
                 <outlet property="forum" destination="2300" id="cpt-gZ-e4k"/>
                                     <action selector="selectAll:" target="-1" id="232"/>
                                 </connections>
                             </menuItem>
+                            <menuItem isSeparatorItem="YES" id="K9x-W6-ycv"/>
+                            <menuItem title="Find" keyEquivalent="F" id="6J6-tz-ctn">
+                                <connections>
+                                    <action selector="highlightSearchField:" target="-1" id="GlP-7U-XF1"/>
+                                </connections>
+                            </menuItem>
                         </items>
                     </menu>
                 </menuItem>
index 91f9762..ce94855 100644 (file)
@@ -60,6 +60,7 @@
 @property (readwrite, weak) IBOutlet NSMenuItem *pasteItem;
 @property (readwrite, weak) IBOutlet NSMenuItem *clearItem;
 @property (readwrite, weak) IBOutlet NSMenuItem *select_all;
+@property (readwrite, weak) IBOutlet NSMenuItem *findItem;
 
 @property (readwrite, weak) IBOutlet NSMenu *viewMenu;
 @property (readwrite, weak) IBOutlet NSMenuItem *toggleJumpButtons;
index aacc5f2..a55b630 100644 (file)
     [_pasteItem setTitle: _NS("Paste")];
     [_clearItem setTitle: _NS("Delete")];
     [_select_all setTitle: _NS("Select All")];
+    [_findItem setTitle: _NS("Find")];
 
     [_viewMenu setTitle: _NS("View")];
     [_toggleJumpButtons setTitle: _NS("Show Previous & Next Buttons")];
index 563b1e2..28c0e2a 100644 (file)
@@ -104,6 +104,7 @@ typedef enum {
 - (IBAction)removePodcastWindowAction:(id)sender;
 
 - (IBAction)searchItem:(id)sender;
+- (IBAction)highlightSearchField:(id)sender;
 
 - (void)windowResizedOrMoved:(NSNotification *)notification;
 
index 4415c34..19c3af8 100644 (file)
@@ -985,6 +985,11 @@ static const float f_min_window_height = 307.;
     [[[[VLCMain sharedInstance] playlist] model] searchUpdate:[_searchField stringValue]];
 }
 
+- (IBAction)highlightSearchField:(id)sender
+{
+    [_searchField selectText:sender];
+}
+
 #pragma mark -
 #pragma mark Side Bar Data handling
 /* taken under BSD-new from the PXSourceList sample project, adapted for VLC */
index 19fe964..077ad1e 100644 (file)
@@ -245,7 +245,7 @@ static NSString* VLCHotkeysSettingToolbarIdentifier = @"Hotkeys Settings Item Id
     [_hotkeys_listbox setDoubleAction:@selector(hotkeyTableDoubleClick:)];
 
     /* setup useful stuff */
-    _hotkeysNonUseableKeys = [NSArray arrayWithObjects:@"Command-c", @"Command-x", @"Command-v", @"Command-a", @"Command-," , @"Command-h", @"Command-Alt-h", @"Command-Shift-o", @"Command-o", @"Command-d", @"Command-n", @"Command-s", @"Command-l", @"Command-r", @"Command-3", @"Command-m", @"Command-w", @"Command-Shift-w", @"Command-Shift-c", @"Command-Shift-p", @"Command-i", @"Command-e", @"Command-Shift-e", @"Command-b", @"Command-Shift-m", @"Command-Ctrl-m", @"Command-?", @"Command-Alt-?", nil];
+    _hotkeysNonUseableKeys = [NSArray arrayWithObjects:@"Command-c", @"Command-x", @"Command-v", @"Command-a", @"Command-," , @"Command-h", @"Command-Alt-h", @"Command-Shift-o", @"Command-o", @"Command-d", @"Command-n", @"Command-s", @"Command-l", @"Command-r", @"Command-3", @"Command-m", @"Command-w", @"Command-Shift-w", @"Command-Shift-c", @"Command-Shift-p", @"Command-i", @"Command-e", @"Command-Shift-e", @"Command-b", @"Command-Shift-m", @"Command-Ctrl-m", @"Command-?", @"Command-Alt-?", @"Command-Shift-f", nil];
 }
 
 #define CreateToolbarItem(name, desc, img, sel) \