]> granicus.if.org Git - handbrake/commitdiff
MacGui: Implement "Show Source in Finder" in the queue contextual menu.
authorDamiano Galassi <damiog@gmail.com>
Fri, 31 Aug 2018 15:50:07 +0000 (17:50 +0200)
committerDamiano Galassi <damiog@gmail.com>
Fri, 31 Aug 2018 15:50:07 +0000 (17:50 +0200)
macosx/Base.lproj/Queue.xib
macosx/HBQueueController.m

index 91b0a48f1743ddb5d0c6772feae18eced86f95a9..8c1906e35e906f0b960414cf5107c120c535b389 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14313.3.2" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14313.13.2" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.3.2"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.13.2"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                 <subviews>
                     <scrollView horizontalLineScroll="19" horizontalPageScroll="0.0" verticalLineScroll="19" verticalPageScroll="0.0" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2596">
-                        <rect key="frame" x="20" y="20" width="534" height="336"/>
+                        <rect key="frame" x="20" y="20" width="534" height="337"/>
                         <clipView key="contentView" id="B5m-TR-ErO">
-                            <rect key="frame" x="1" y="1" width="532" height="334"/>
+                            <rect key="frame" x="1" y="1" width="532" height="335"/>
                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             <subviews>
                                 <outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" autosaveColumns="NO" indentationPerLevel="16" outlineTableColumn="2624" id="2597" customClass="HBQueueOutlineView">
-                                    <rect key="frame" x="0.0" y="0.0" width="532" height="334"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="532" height="335"/>
                                     <autoresizingMask key="autoresizingMask"/>
                                     <size key="intercellSpacing" width="3" height="2"/>
                                     <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                             <autoresizingMask key="autoresizingMask"/>
                         </scroller>
                         <scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="2643">
-                            <rect key="frame" x="517" y="1" width="16" height="334"/>
+                            <rect key="frame" x="517" y="1" width="16" height="335"/>
                             <autoresizingMask key="autoresizingMask"/>
                         </scroller>
                     </scrollView>
                     <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="6000" translatesAutoresizingMaskIntoConstraints="NO" id="2511">
-                        <rect key="frame" x="18" y="398" width="538" height="15"/>
+                        <rect key="frame" x="18" y="399" width="538" height="14"/>
                         <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="Pending Jobs" id="2637">
                             <font key="font" metaFont="smallSystem"/>
                             <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                         </textFieldCell>
                     </textField>
                     <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="6000" translatesAutoresizingMaskIntoConstraints="NO" id="2646">
-                        <rect key="frame" x="18" y="364" width="538" height="30"/>
+                        <rect key="frame" x="18" y="365" width="538" height="30"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="30" id="IvQ-56-oOt"/>
                         </constraints>
         </window>
         <menu id="2649" userLabel="ContextMenu">
             <items>
-                <menuItem title="Show In Finder" id="2655">
+                <menuItem title="Show Source in Finder" id="gbW-g1-lEc">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <connections>
+                        <action selector="revealSelectedQueueItemsSources:" target="-2" id="NY5-Sp-e08"/>
+                    </connections>
+                </menuItem>
+                <menuItem title="Show Destination in Finder" id="2655">
                     <modifierMask key="keyEquivalentModifierMask"/>
                     <connections>
                         <action selector="revealSelectedQueueItems:" target="-2" id="qtj-uq-KvZ"/>
index ea915976672a575a4425a42407df2b1c7b63ae26..519aef56976021d36292ceeaa9ed63007e52140f 100644 (file)
 - (IBAction)revealSelectedQueueItems:(id)sender
 {
     NSIndexSet *targetedRows = [self.outlineView targetedRowIndexes];
-    NSMutableArray *urls = [[NSMutableArray alloc] init];
+    NSMutableArray<NSURL *> *urls = [[NSMutableArray alloc] init];
 
     NSUInteger currentIndex = [targetedRows firstIndex];
     while (currentIndex != NSNotFound) {
     [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:urls];
 }
 
+- (IBAction)revealSelectedQueueItemsSources:(id)sender
+{
+    NSIndexSet *targetedRows = [self.outlineView targetedRowIndexes];
+    NSMutableArray<NSURL *> *urls = [[NSMutableArray alloc] init];
+
+    NSUInteger currentIndex = [targetedRows firstIndex];
+    while (currentIndex != NSNotFound) {
+        NSURL *url = [[self.jobs objectAtIndex:currentIndex] fileURL];
+        [urls addObject:url];
+        currentIndex = [targetedRows indexGreaterThanIndex:currentIndex];
+    }
+
+    [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:urls];
+}
+
 - (void)remindUserOfSleepOrShutdown
 {
     if ([[NSUserDefaults standardUserDefaults] integerForKey:@"HBAlertWhenDone"] == HBDoneActionSleep)