summaryrefslogtreecommitdiffstats
path: root/macosx/Controller.m
diff options
context:
space:
mode:
authordynaflash <[email protected]>2010-09-20 16:15:23 +0000
committerdynaflash <[email protected]>2010-09-20 16:15:23 +0000
commitfaeba9157d45934526bbfc2aed1ec6cbc4cf64a3 (patch)
tree92201eb6cc09cd0f4eb3199cc99abfb7fb25aa2b /macosx/Controller.m
parentd78142595cf23721be92ef63f4cb538ee5d9dc84 (diff)
MacGui: Audio Fixes and Enhancements ... patch by circleone.
Fixes issue where changing to custom from a preset then changing titles will cause an empty audio tab. Also: - Added the ability for HandBrake's language preference to be honored when it occurs in the title's tracks. - Ensured the limit (currently 24) is not passed when adding audios using presets. - If no preset is chosen, when a new title loads, one track is added (based on the language preference or the first if that is not met). - Reinitializing the audio array is now KVO-friendly, making the UI refresh more pleasant. - The "Add All Tracks" button has been made mini in size. - The audio table view no longer attempts to keep the selection. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3549 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/Controller.m')
-rw-r--r--macosx/Controller.m22
1 files changed, 15 insertions, 7 deletions
diff --git a/macosx/Controller.m b/macosx/Controller.m
index 92d31a822..7fbd5f280 100644
--- a/macosx/Controller.m
+++ b/macosx/Controller.m
@@ -4958,7 +4958,11 @@ the user is using "Custom" settings by determining the sender*/
#pragma mark -
-@synthesize hasValidPresetSelected;
+- (BOOL) hasValidPresetSelected
+
+{
+ return ([fPresetsOutlineView selectedRow] >= 0 && [[[fPresetsOutlineView itemAtRow:[fPresetsOutlineView selectedRow]] objectForKey:@"Folder"] intValue] != 1);
+}
// This causes all audio tracks from the title to be used based on the current preset
- (IBAction) addAllAudioTracks: (id) sender
@@ -5315,6 +5319,14 @@ return YES;
//}
}
+- (void) outlineViewSelectionDidChange: (NSNotification *) ignored
+
+{
+ [self willChangeValueForKey: @"hasValidPresetSelected"];
+ [self didChangeValueForKey: @"hasValidPresetSelected"];
+ return;
+}
+
#pragma mark -
#pragma mark Preset Outline View Methods (dragging related)
@@ -5429,9 +5441,8 @@ return YES;
- (IBAction)selectPreset:(id)sender
{
- if ([fPresetsOutlineView selectedRow] >= 0 && [[[fPresetsOutlineView itemAtRow:[fPresetsOutlineView selectedRow]] objectForKey:@"Folder"] intValue] != 1)
+ if (YES == [self hasValidPresetSelected])
{
- [self setHasValidPresetSelected: YES];
chosenPreset = [fPresetsOutlineView itemAtRow:[fPresetsOutlineView selectedRow]];
[fPresetSelectedDisplay setStringValue:[chosenPreset objectForKey:@"PresetName"]];
@@ -5752,9 +5763,6 @@ return YES;
[fPictureController SetTitle:fTitle];
[self calculatePictureSizing:nil];
}
- else {
- [self setHasValidPresetSelected: NO];
- }
}
@@ -6136,7 +6144,7 @@ return YES;
/* now get and add selected presets to export */
}
- if ([fPresetsOutlineView selectedRow] >= 0 && [[[fPresetsOutlineView itemAtRow:[fPresetsOutlineView selectedRow]] objectForKey:@"Folder"] intValue] != 1)
+ if (YES == [self hasValidPresetSelected])
{
[presetsToExport addObject:[fPresetsOutlineView itemAtRow:[fPresetsOutlineView selectedRow]]];
[presetsToExport writeToFile:exportPresetsFile atomically:YES];