diff options
author | Damiano Galassi <[email protected]> | 2019-09-06 10:34:37 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2019-09-06 10:34:37 +0200 |
commit | b61c16e52283e38b65b44c4abf9448efcfc0006d (patch) | |
tree | 9fa666f5cf58dbe3ba8453393ebd2d48c15aa834 | |
parent | b7d83fe3985b18bf503564310252e7e724f7373a (diff) |
MacGui: add a menu item to show the selected queue item activity log in Finder.
-rw-r--r-- | macosx/Base.lproj/HBQueueTableViewController.xib | 23 | ||||
-rw-r--r-- | macosx/HBQueueItem.m | 1 | ||||
-rw-r--r-- | macosx/HBQueueTableViewController.m | 35 |
3 files changed, 45 insertions, 14 deletions
diff --git a/macosx/Base.lproj/HBQueueTableViewController.xib b/macosx/Base.lproj/HBQueueTableViewController.xib index 48137ffaf..8ef50698f 100644 --- a/macosx/Base.lproj/HBQueueTableViewController.xib +++ b/macosx/Base.lproj/HBQueueTableViewController.xib @@ -208,14 +208,27 @@ <action selector="revealSelectedQueueItems:" target="-2" id="s3C-6U-Ycl"/> </connections> </menuItem> + <menuItem title="Show Activity Log in Finder" id="zA7-r8-i4L"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="revealSelectedQueueItemsActivityLogs:" target="-2" id="Ker-1p-I9C"/> + </connections> + </menuItem> <menuItem isSeparatorItem="YES" id="cVv-nf-8tx"/> - <menuItem title="Edit Job Settings" id="DTF-om-j0l"> + <menuItem title="Remove" id="egD-8R-PTJ"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="removeSelectedQueueItem:" target="-2" id="EIy-d4-yhJ"/> + </connections> + </menuItem> + <menuItem isSeparatorItem="YES" id="SeL-ME-sRY"/> + <menuItem title="Edit" id="DTF-om-j0l"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="editSelectedQueueItem:" target="-2" id="drH-QA-nh8"/> </connections> </menuItem> - <menuItem title="Reset Stopped Job" id="xMs-43-lL0"> + <menuItem title="Reset" id="xMs-43-lL0"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="resetJobState:" target="-2" id="nsj-r6-Vd4"/> @@ -234,12 +247,6 @@ <action selector="removeCompleted:" target="-2" id="nUM-Me-Fr2"/> </connections> </menuItem> - <menuItem title="Remove Selected Job" id="egD-8R-PTJ"> - <modifierMask key="keyEquivalentModifierMask"/> - <connections> - <action selector="removeSelectedQueueItem:" target="-2" id="EIy-d4-yhJ"/> - </connections> - </menuItem> </items> <point key="canvasLocation" x="-152" y="642"/> </menu> diff --git a/macosx/HBQueueItem.m b/macosx/HBQueueItem.m index 8e5b60aff..b8feb4b0e 100644 --- a/macosx/HBQueueItem.m +++ b/macosx/HBQueueItem.m @@ -81,6 +81,7 @@ static NSDictionary *shortHeightAttr; if (state == HBQueueItemStateReady) { [self resetStatistics]; + self.activityLogURL = nil; } } diff --git a/macosx/HBQueueTableViewController.m b/macosx/HBQueueTableViewController.m index 530c49f9a..f414ba625 100644 --- a/macosx/HBQueueTableViewController.m +++ b/macosx/HBQueueTableViewController.m @@ -119,29 +119,47 @@ NSIndexSet *targetedRows = self.tableView.targetedRowIndexes; NSMutableArray<NSURL *> *urls = [[NSMutableArray alloc] init]; - NSUInteger currentIndex = [targetedRows firstIndex]; + NSUInteger currentIndex = targetedRows.firstIndex; while (currentIndex != NSNotFound) { NSURL *url = [[self.queue.items objectAtIndex:currentIndex] completeOutputURL]; [urls addObject:url]; currentIndex = [targetedRows indexGreaterThanIndex:currentIndex]; } - [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:urls]; + [NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:urls]; } - (IBAction)revealSelectedQueueItemsSources:(id)sender { - NSIndexSet *targetedRows = [self.tableView targetedRowIndexes]; + NSIndexSet *targetedRows = self.tableView.targetedRowIndexes; NSMutableArray<NSURL *> *urls = [[NSMutableArray alloc] init]; - NSUInteger currentIndex = [targetedRows firstIndex]; + NSUInteger currentIndex = targetedRows.firstIndex; while (currentIndex != NSNotFound) { NSURL *url = [[self.queue.items objectAtIndex:currentIndex] fileURL]; [urls addObject:url]; currentIndex = [targetedRows indexGreaterThanIndex:currentIndex]; } - [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:urls]; + [NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:urls]; +} + +- (IBAction)revealSelectedQueueItemsActivityLogs:(id)sender +{ + NSIndexSet *targetedRows = self.tableView.targetedRowIndexes; + NSMutableArray<NSURL *> *urls = [[NSMutableArray alloc] init]; + + NSUInteger currentIndex = targetedRows.firstIndex; + while (currentIndex != NSNotFound) { + NSURL *url = [[self.queue.items objectAtIndex:currentIndex] activityLogURL]; + if (url) + { + [urls addObject:url]; + } + currentIndex = [targetedRows indexGreaterThanIndex:currentIndex]; + } + + [NSWorkspace.sharedWorkspace activateFileViewerSelectingURLs:urls]; } /** @@ -149,7 +167,7 @@ */ - (IBAction)resetJobState:(id)sender { - NSIndexSet *targetedRows = [self.tableView targetedRowIndexes]; + NSIndexSet *targetedRows = self.tableView.targetedRowIndexes; if (targetedRows.count) { [self.delegate tableViewResetItemsAtIndexes:targetedRows]; @@ -193,6 +211,11 @@ return (self.tableView.selectedRow != -1 || self.tableView.clickedRow != -1); } + if (action == @selector(revealSelectedQueueItemsActivityLogs:)) + { + return (self.tableView.selectedRow != -1 || self.tableView.clickedRow != -1); + } + if (action == @selector(resetJobState:)) { return self.tableView.targetedRowIndexes.count > 0; |