<string key="NSValueTransformerName">NSIsNotNil</string>
</dictionary>
</binding>
- <binding destination="-2" name="value" keyPath="self.job.outputFileName" id="NAL-fw-AF5"/>
+ <binding destination="-2" name="value" keyPath="self.job.outputFileName" id="SgW-Bn-bwW">
+ <dictionary key="options">
+ <bool key="NSValidatesImmediately" value="YES"/>
+ </dictionary>
+ </binding>
</connections>
</textField>
<textField hidden="YES" toolTip="First second to encode." verticalHuggingPriority="750" misplaced="YES" allowsCharacterPickerTouchBarItem="YES" id="5491">
*/
- (IBAction)addToQueue:(id)sender
{
- [self.window HB_endEditing];
- [self runDestinationAlerts:self.job
- didEndSelector:@selector(overwriteAddToQueueAlertDone:returnCode:contextInfo:)];
+ if ([self.window HB_endEditing])
+ {
+ [self runDestinationAlerts:self.job
+ didEndSelector:@selector(overwriteAddToQueueAlertDone:returnCode:contextInfo:)];
+ }
}
/**
}
else
{
- [self.window HB_endEditing];
- [self runDestinationAlerts:self.job
- didEndSelector:@selector(overWriteAlertDone:returnCode:contextInfo:)];
+ if ([self.window HB_endEditing])
+ {
+ [self runDestinationAlerts:self.job
+ didEndSelector:@selector(overWriteAlertDone:returnCode:contextInfo:)];
+ }
}
}
_outputFileName = [outputFileName copy];
}
+- (BOOL)validateOutputFileName:(id *)ioValue error:(NSError * __autoreleasing *)outError
+{
+ BOOL retval = YES;
+
+ if (nil != *ioValue)
+ {
+ NSString *value = *ioValue;
+
+ if ([value rangeOfString:@"/"].location != NSNotFound)
+ {
+ *outError = [NSError errorWithDomain:@"HBError" code:0 userInfo:@{NSLocalizedDescriptionKey: NSLocalizedString(@"Invalid name", nil),
+ NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"The file name can't contain the / character.", nil)}];
+ return NO;
+ }
+ }
+
+ return retval;
+}
+
- (NSURL *)completeOutputURL
{
return [self.outputURL URLByAppendingPathComponent:self.outputFileName];