diff options
author | Damiano Galassi <[email protected]> | 2017-12-15 18:21:27 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2017-12-15 18:21:27 +0100 |
commit | cba8c83616bd26bbb2d206e768fb139dd5a17f28 (patch) | |
tree | 5471f9b80aa20e3a54e45ef9a4f4cf88a6a78d15 /macosx/HBController.m | |
parent | 88e715fafa47e8e7a8d484aec9ecca4e77cbdcee (diff) |
MacGui: add a short source description after the source name.
Diffstat (limited to 'macosx/HBController.m')
-rw-r--r-- | macosx/HBController.m | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/macosx/HBController.m b/macosx/HBController.m index 75338bcc7..172a291b6 100644 --- a/macosx/HBController.m +++ b/macosx/HBController.m @@ -595,7 +595,6 @@ self.window.title = NSLocalizedString(@"HandBrake", nil); NSURL *mediaURL = [HBUtilities mediaURLFromURL:fileURL]; - NSString *displayName = [HBUtilities displayNameForURL:fileURL]; NSError *outError = NULL; BOOL suppressWarning = [[NSUserDefaults standardUserDefaults] boolForKey:@"suppressCopyProtectionAlert"]; @@ -650,10 +649,6 @@ { [fSrcTitlePopUp addItemWithTitle:title.description]; } - - // Set Source Name at top of window with the browsedSourceDisplayName grokked right before -performScan - fSrcDVD2Field.stringValue = displayName; - self.window.representedURL = mediaURL; self.window.title = mediaURL.lastPathComponent; } @@ -663,6 +658,16 @@ fSrcDVD2Field.stringValue = NSLocalizedString(@"No Valid Source Found", @""); } + // Set the last searched source directory in the prefs here + if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:mediaURL.URLByDeletingLastPathComponent.path]) + { + [[NSUserDefaults standardUserDefaults] setURL:mediaURL.URLByDeletingLastPathComponent.URLByDeletingLastPathComponent forKey:@"HBLastSourceDirectoryURL"]; + } + else + { + [[NSUserDefaults standardUserDefaults] setURL:mediaURL.URLByDeletingLastPathComponent forKey:@"HBLastSourceDirectoryURL"]; + } + completionHandler(self.core.titles); [self.window.toolbar validateVisibleItems]; }]; @@ -839,11 +844,15 @@ // Update the title selection popup. [fSrcTitlePopUp selectItemWithTitle:title.description]; - // If we are a stream type and a batch scan, grok the output file name from title->name upon title change + // Grok the output file name from title.name upon title change if (title.isStream && self.core.titles.count > 1) { // Change the source to read out the parent folder also - fSrcDVD2Field.stringValue = [NSString stringWithFormat:@"%@/%@", title.url.URLByDeletingLastPathComponent.lastPathComponent, title.name]; + fSrcDVD2Field.stringValue = [NSString stringWithFormat:@"%@/%@, %@", title.url.URLByDeletingLastPathComponent.lastPathComponent, title.name, title.shortFormatDescription]; + } + else + { + fSrcDVD2Field.stringValue = [NSString stringWithFormat:@"%@, %@", title.name, title.shortFormatDescription]; } } else @@ -897,9 +906,6 @@ { if (result == NSFileHandlingPanelOKButton) { - // Set the last searched source directory in the prefs here - [[NSUserDefaults standardUserDefaults] setURL:panel.URL.URLByDeletingLastPathComponent forKey:@"HBLastSourceDirectoryURL"]; - NSInteger titleIdx = self.scanSpecificTitle ? self.scanSpecificTitleIdx : 0; [self openURL:panel.URL titleIndex:titleIdx]; } |