summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueueController.mm
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/HBQueueController.mm')
-rw-r--r--macosx/HBQueueController.mm26
1 files changed, 23 insertions, 3 deletions
diff --git a/macosx/HBQueueController.mm b/macosx/HBQueueController.mm
index 6743b378c..75095af69 100644
--- a/macosx/HBQueueController.mm
+++ b/macosx/HBQueueController.mm
@@ -805,7 +805,7 @@ NSString *HBJobGroupStatusNotification = @"HBJobGroupStatusNotification";
return firstJob ? firstJob->titleName : nil;
}
-- (NSString *) path
+- (NSString *) destinationPath
{
HBJob * firstJob = [self jobAtIndex:0];
return firstJob ? firstJob->file : nil;
@@ -907,6 +907,8 @@ static NSString* HBQueuePauseResumeToolbarIdentifier = @"HBQueuePauseRe
return fCurrentJob;
}
+#pragma mark -
+
//------------------------------------------------------------------------------------
// Displays and brings the queue window to the front
//------------------------------------------------------------------------------------
@@ -976,6 +978,24 @@ static NSString* HBQueuePauseResumeToolbarIdentifier = @"HBQueuePauseRe
fCurrentJobGroup = aJobGroup;
}
+#pragma mark - Finding job groups
+
+//------------------------------------------------------------------------------------
+// Returns the first pending job with a specified destination path or nil if no such
+// job exists.
+//------------------------------------------------------------------------------------
+- (HBJobGroup *) pendingJobGroupWithDestinationPath: (NSString *)path
+{
+ HBJobGroup * aJobGroup;
+ NSEnumerator * groupEnum = [fJobGroups objectEnumerator];
+ while ( (aJobGroup = [groupEnum nextObject]) )
+ {
+ if ([[aJobGroup destinationPath] isEqualToString: path])
+ return aJobGroup;
+ }
+ return nil;
+}
+
//------------------------------------------------------------------------------------
// Locates and returns a HBJob whose sequence_id matches a specified value.
//------------------------------------------------------------------------------------
@@ -1604,8 +1624,8 @@ static NSString* HBQueuePauseResumeToolbarIdentifier = @"HBQueuePauseRe
while (row != NSNotFound)
{
HBJobGroup * jobGroup = [fOutlineView itemAtRow: row];
- if ([[jobGroup path] length])
- [[NSWorkspace sharedWorkspace] selectFile:[jobGroup path] inFileViewerRootedAtPath:nil];
+ if ([[jobGroup destinationPath] length])
+ [[NSWorkspace sharedWorkspace] selectFile:[jobGroup destinationPath] inFileViewerRootedAtPath:nil];
row = [selectedRows indexGreaterThanIndex: row];
}