- Auto Naming checkbox in Preferences (default to Off)
- If "ON" uses the DVD Name and "- Title Number" as the file output name.
- Called in -TitlePopupChanged function.
git-svn-id: svn://localhost/HandBrake/trunk@434
b64f7644-9d1e-0410-96f1-
a4d463321fa5
}
// Select the longuest title
[fSrcTitlePopUp selectItemAtIndex: indxpri];
+
+
[self TitlePopUpChanged: NULL];
[self EnableUI: YES];
hb_list_t * list = hb_get_titles( fHandle );
hb_title_t * title = (hb_title_t*)
hb_list_item( list, [fSrcTitlePopUp indexOfSelectedItem] );
-
+ /* If Auto Naming is on. We create an output filename of dvd name - title number */
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultAutoNaming"] > 0)
+ {
+ [fDstFile2Field setStringValue: [NSString stringWithFormat:
+ @"%@/%@-%d.%@", [[fDstFile2Field stringValue] stringByDeletingLastPathComponent],
+ [NSString stringWithUTF8String: title->name],
+ [fSrcTitlePopUp indexOfSelectedItem] + 1,
+ [[fDstFile2Field stringValue] pathExtension]]];
+ }
/* Update chapter popups */
[fSrcChapterStartPopUp removeAllItems];
OUTLETS = {
fDefAdvancedx264FlagsView = NSButton;
fDefAudioSurround = NSButton;
+ fDefAutoNaming = NSButton;
fDefCrf = NSButton;
fDefDeinterlace = NSButton;
fDefPicSizeAutoSetipod = NSButton;
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
+ <integer>1438</integer>
<integer>1843</integer>
</array>
<key>IBSystem Version</key>
- <string>8L127</string>
+ <string>8P2137</string>
<key>IBUserGuides</key>
<dict>
<key>21</key>
IBOutlet NSButton * fDefPixelRatio;
IBOutlet NSButton * fDefAudioSurround;
IBOutlet NSButton * fDefPresetDrawerShow;
+ IBOutlet NSButton * fDefAutoNaming;
IBOutlet NSTextView * fDefAdvancedx264FlagsView;
}
NSString *defDestDirectory = @"~/Desktop";
defDestDirectory = [defDestDirectory stringByExpandingTildeInPath];
appDefaults = [NSDictionary dictionaryWithObject:defDestDirectory forKey:@"LastDestinationDirectory"];
-
+ appDefaults = [NSDictionary dictionaryWithObject:@"NO"
+ forKey:@"DefaultAutoNaming"];
[defaults registerDefaults: appDefaults];
/* fUpdateCheck Check or uncheck according to the preferences */
/* fDefPresetDrawerShow Check or uncheck according to the preferences*/
[fDefPresetDrawerShow setState: [defaults boolForKey:@"DefaultPresetsDrawerShow"] ?
NSOnState : NSOffState];
-
+ /* fDefAutoNaming Check or uncheck according to the preferences*/
+ [fDefAutoNaming setState: [defaults boolForKey:@"DefaultAutoNaming"] ?
+ NSOnState : NSOffState];
}
[defaults setObject:@"NO" forKey:@"DefaultPresetsDrawerShow"];
}
+ /* Use Auto Naming */
+
+ if( [fDefAutoNaming state] == NSOnState )
+ {
+ [defaults setObject:@"YES" forKey:@"DefaultAutoNaming"];
+ }
+ else
+ {
+ [defaults setObject:@"NO" forKey:@"DefaultAutoNaming"];
+ }
+
}
@end