summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueueController.mm
diff options
context:
space:
mode:
authordynaflash <[email protected]>2008-01-14 13:58:19 +0000
committerdynaflash <[email protected]>2008-01-14 13:58:19 +0000
commit8520e5c0c5ccc2f96f4d7b995ff6a56ecf27babe (patch)
treeec5d41fa8b8ca0ea055953c0cc38f6c6acab7bfe /macosx/HBQueueController.mm
parentff41cd481c574a0bb600968e1595652d6de090ea (diff)
MacGui: Warn of duplicate output filenames when adding to the queue.
- Thanks travistex git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1192 b64f7644-9d1e-0410-96f1-a4d463321fa5
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];
}