From 7cf4263c54b0b671cce382854a600828656c0f04 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Wed, 22 Feb 2017 15:05:21 +0100 Subject: [PATCH] MacGui: preserve the output file name if auto naming is not enabled and the source is not a stream. Revert to the 0.10.x behaviour. --- macosx/HBController.m | 12 +++++++++++- macosx/HBUtilities.m | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/macosx/HBController.m b/macosx/HBController.m index 602401a2a..fa57e1141 100644 --- a/macosx/HBController.m +++ b/macosx/HBController.m @@ -708,7 +708,17 @@ HBJob *job = [[HBJob alloc] initWithTitle:title andPreset:self.currentPreset]; job.outputURL = self.currentDestination; - job.outputFileName = [HBUtilities defaultNameForJob:job]; + + // If the source is not a stream, and autonaming is disabled, + // keep the existing file name. + if (self.job.outputFileName.length == 0 || title.isStream || [[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultAutoNaming"]) + { + job.outputFileName = [HBUtilities defaultNameForJob:job]; + } + else + { + job.outputFileName = self.job.outputFileName; + } return job; } diff --git a/macosx/HBUtilities.m b/macosx/HBUtilities.m index 8d83f46f3..973953f69 100644 --- a/macosx/HBUtilities.m +++ b/macosx/HBUtilities.m @@ -208,7 +208,8 @@ // Generate a new file name NSString *fileName = job.title.name; - // If Auto Naming is on. We create an output filename of dvd name - title number + // If Auto Naming is on. We create an output filename by using the + // format set int he preferences. if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultAutoNaming"]) { fileName = [self automaticNameForJob:job]; -- 2.40.0