diff options
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.mm | 13 | ||||
-rw-r--r-- | macosx/HBQueueController.h | 5 | ||||
-rw-r--r-- | macosx/HBQueueController.mm | 26 | ||||
-rw-r--r-- | macosx/InstantHandBrake/InstantHandBrake.xcodeproj/project.pbxproj | 8 |
4 files changed, 44 insertions, 8 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 4e53fa1f8..891564230 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -1700,6 +1700,19 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It [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]; diff --git a/macosx/HBQueueController.h b/macosx/HBQueueController.h index d1bb0c782..2070f0418 100644 --- a/macosx/HBQueueController.h +++ b/macosx/HBQueueController.h @@ -178,7 +178,7 @@ BOOL fIsDragging; - (HBQueueJobGroupStatus) status; - (void) setPresetName: (NSString *)name; - (NSString *) presetName; -- (NSString *) path; +- (NSString *) destinationPath; - (NSString *) name; // Creating a description @@ -264,6 +264,9 @@ BOOL fIsDragging; - (HBJobGroup *) currentJobGroup; - (HBJob *) currentJob; +// Getting job groups +- (HBJobGroup *) pendingJobGroupWithDestinationPath: (NSString *)path; + // Getting queue statistics - (unsigned int) pendingCount; - (unsigned int) completedCount; 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]; } diff --git a/macosx/InstantHandBrake/InstantHandBrake.xcodeproj/project.pbxproj b/macosx/InstantHandBrake/InstantHandBrake.xcodeproj/project.pbxproj index 5264013cf..a62c18d2e 100644 --- a/macosx/InstantHandBrake/InstantHandBrake.xcodeproj/project.pbxproj +++ b/macosx/InstantHandBrake/InstantHandBrake.xcodeproj/project.pbxproj @@ -29,28 +29,28 @@ 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 */ |