[fDstFile2Field stringValue]] );
// overwriteAddToQueueAlertDone: will be called when the alert is dismissed.
}
+
+ // Warn if another pending job in the queue has the same destination path
+ else if ([fQueueController pendingJobGroupWithDestinationPath:[fDstFile2Field stringValue]] != nil)
+ {
+ NSBeginCriticalAlertSheet( _( @"Another queued encode has specified the same destination." ),
+ _( @"Cancel" ), _( @"Overwrite" ), NULL, fWindow, self,
+ @selector( overwriteAddToQueueAlertDone:returnCode:contextInfo: ),
+ NULL, NULL, [NSString stringWithFormat:
+ _( @"Do you want to overwrite %@?" ),
+ [fDstFile2Field stringValue]] );
+ // overwriteAddToQueueAlertDone: will be called when the alert is dismissed.
+ }
+
else
{
[self doAddToQueue];
- (HBQueueJobGroupStatus) status;
- (void) setPresetName: (NSString *)name;
- (NSString *) presetName;
-- (NSString *) path;
+- (NSString *) destinationPath;
- (NSString *) name;
// Creating a description
- (HBJobGroup *) currentJobGroup;
- (HBJob *) currentJob;
+// Getting job groups
+- (HBJobGroup *) pendingJobGroupWithDestinationPath: (NSString *)path;
+
// Getting queue statistics
- (unsigned int) pendingCount;
- (unsigned int) completedCount;
return firstJob ? firstJob->titleName : nil;
}
-- (NSString *) path
+- (NSString *) destinationPath
{
HBJob * firstJob = [self jobAtIndex:0];
return firstJob ? firstJob->file : nil;
return fCurrentJob;
}
+#pragma mark -
+
//------------------------------------------------------------------------------------
// Displays and brings the queue window to the front
//------------------------------------------------------------------------------------
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.
//------------------------------------------------------------------------------------
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];
}
isa = PBXContainerItemProxy;
containerPortal = A9DB3A080D37EC2800F77345 /* libhb.xcodeproj */;
proxyType = 2;
- remoteGlobalIDString = 0DFF0B720B6BC6E600549488 /* libhb.a */;
+ remoteGlobalIDString = 0DFF0B720B6BC6E600549488;
remoteInfo = libhb;
};
A9DB3A100D37EC2800F77345 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A9DB3A080D37EC2800F77345 /* libhb.xcodeproj */;
proxyType = 2;
- remoteGlobalIDString = 0D096DFF0B707D1200A845D4 /* libhb.dylib */;
+ remoteGlobalIDString = 0D096DFF0B707D1200A845D4;
remoteInfo = "libhb dlib";
};
A9DB3A120D37EC2800F77345 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A9DB3A080D37EC2800F77345 /* libhb.xcodeproj */;
proxyType = 2;
- remoteGlobalIDString = A9DB38E00D37E9BA00F77345 /* HB.framework */;
+ remoteGlobalIDString = A9DB38E00D37E9BA00F77345;
remoteInfo = HB;
};
A9DB3A140D37EC4200F77345 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A9DB3A080D37EC2800F77345 /* libhb.xcodeproj */;
proxyType = 1;
- remoteGlobalIDString = 0DFF0B710B6BC6E600549488 /* libhb */;
+ remoteGlobalIDString = 0DFF0B710B6BC6E600549488;
remoteInfo = libhb;
};
/* End PBXContainerItemProxy section */