diff options
author | ritsuka <[email protected]> | 2014-08-16 16:09:25 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2014-08-16 16:09:25 +0000 |
commit | 4144852c1cd1bb12d2d9a483b0589a61f185240e (patch) | |
tree | 47a61e3bd96bcaa10c40318f77397638a747bd19 /macosx | |
parent | 66590157361bb0b7e7cf2a4622feee77fd38fe1c (diff) |
MacGui: select the default preset in the presets drawer at start up. Added a missing NSAlert release.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6301 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.h | 2 | ||||
-rw-r--r-- | macosx/Controller.m | 20 |
2 files changed, 15 insertions, 7 deletions
diff --git a/macosx/Controller.h b/macosx/Controller.h index b51c7bd41..14e4ac4ab 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -290,8 +290,6 @@ extern NSString *keyTitleTag; - (IBAction) openUserGuide: (id) sender; // Preset Methods Here -- (void)applyPreset; - /* Export / Import Presets */ - (IBAction) browseExportPresetFile: (id) sender; - (IBAction) browseImportPresetFile: (id) sender; diff --git a/macosx/Controller.m b/macosx/Controller.m index cc423deb1..e4c0ff95e 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -42,6 +42,10 @@ static NSString * ShowActivityIdentifier = @"Debug Output Ite static NSString * ChooseSourceIdentifier = @"Choose Source Item Identifier"; @interface HBController () <HBPresetsViewControllerDelegate> + +// The current selected preset. +@property (nonatomic, retain) HBPreset *selectedPreset; + @end /******************************* @@ -77,6 +81,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It /* we init the HBPresetsManager class */ NSURL *presetsURL = [NSURL fileURLWithPath:[[HBUtilities appSupportPath] stringByAppendingPathComponent:@"UserPresets.plist"]]; presetManager = [[HBPresetsManager alloc] initWithURL:presetsURL]; + _selectedPreset = presetManager.defaultPreset; fPreferencesController = [[HBPreferencesController alloc] init]; /* Lets report the HandBrake version number here to the activity log and text log file */ @@ -4043,6 +4048,7 @@ fWorkingCount = 0; { [self showPreferencesWindow:nil]; } + [alert release]; } } @@ -4368,7 +4374,7 @@ fWorkingCount = 0; } /* lets call tableViewSelected to make sure that any preset we have selected is enforced after a title change */ - [self applyPreset]; + [self applyPreset:self.selectedPreset]; } - (IBAction) encodeStartStopPopUpChanged: (id) sender; @@ -4868,15 +4874,15 @@ the user is using "Custom" settings by determining the sender*/ #pragma mark - Preset Methods -- (void)applyPreset +- (void)applyPreset:(HBPreset *)preset { - if (fPresetsView.selectedPreset != nil) + if (preset != nil) { hb_job_t * job = fTitle->job; // for mapping names via libhb const char *strValue; - NSDictionary *chosenPreset = [fPresetsView.selectedPreset content]; + NSDictionary *chosenPreset = preset.content; [fPresetSelectedDisplay setStringValue:[chosenPreset objectForKey:@"PresetName"]]; if ([[chosenPreset objectForKey:@"Default"] intValue] == 1) @@ -5133,7 +5139,11 @@ the user is using "Custom" settings by determining the sender*/ - (void)selectionDidChange { - [self applyPreset]; + self.selectedPreset = fPresetsView.selectedPreset; + if (SuccessfulScan) + { + [self applyPreset:self.selectedPreset]; + } } #pragma mark - |