summaryrefslogtreecommitdiffstats
path: root/macosx/HBPreferencesController.m
diff options
context:
space:
mode:
authordynaflash <[email protected]>2010-01-12 21:22:54 +0000
committerdynaflash <[email protected]>2010-01-12 21:22:54 +0000
commit08485e0ceb1477500971719cdea1d7f80eb9421c (patch)
tree9e44b2d84aed140123cf905ee7a0b4a2b7436d0b /macosx/HBPreferencesController.m
parentb1a380c995965f816a70431a582634549801cdc7 (diff)
MacGui: Add the ability to send the finished encode to any application the user chooses instead of just "Send to MetaX".
- Retains a checkbox to acivate sending the finished encode - Adds a file name textfield and a browse button so user can choose the app to send the finished encode to. - Defaults to MetaX as this would be the only app already existing in the users prefs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3068 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBPreferencesController.m')
-rw-r--r--macosx/HBPreferencesController.m51
1 files changed, 48 insertions, 3 deletions
diff --git a/macosx/HBPreferencesController.m b/macosx/HBPreferencesController.m
index 943cf3b28..9f1e38129 100644
--- a/macosx/HBPreferencesController.m
+++ b/macosx/HBPreferencesController.m
@@ -45,9 +45,9 @@
@"YES", @"CheckForUpdates",
@"Open Source", @"LaunchSourceBehavior",
@"English", @"DefaultLanguage",
- @"YES", @"UseCoreAudio",
+ @"YES", @"UseCoreAudio",
@"NO", @"DefaultMpegName",
- @"YES", @"UseDvdNav",
+ @"YES", @"UseDvdNav",
@"", @"DefAdvancedx264Flags",
@"YES", @"DefaultPresetsDrawerShow",
desktopDirectory, @"LastDestinationDirectory",
@@ -60,7 +60,8 @@
@"10", @"PreviewsNumber",
@"", @"Drawer Size",
@"0.25", @"x264CqSliderFractional",
- @"YES", @"AlertBuiltInPresetUpdate",
+ @"YES", @"AlertBuiltInPresetUpdate",
+ @"MetaX", @"SendCompletedEncodeToApp",
nil]];
}
@@ -147,6 +148,50 @@
TOOLBAR_AUDIO, TOOLBAR_ADVANCED, nil];
}
+/* Manage the send encode to xxx.app windows and field */
+/*Opens the app browse window*/
+- (IBAction) browseSendToApp: (id) sender
+{
+ NSOpenPanel * panel;
+
+ panel = [NSOpenPanel openPanel];
+ [panel setAllowsMultipleSelection: NO];
+ [panel setCanChooseFiles: YES];
+ [panel setCanChooseDirectories: NO ];
+ NSString * sendToAppDirectory;
+ if ([[NSUserDefaults standardUserDefaults] stringForKey:@"LastSendToAppDirectory"])
+ {
+ sendToAppDirectory = [[NSUserDefaults standardUserDefaults] stringForKey:@"LastSendToAppDirectory"];
+ }
+ else
+ {
+ sendToAppDirectory = @"/Applications";
+ }
+ [panel beginSheetForDirectory: sendToAppDirectory file: nil types: nil
+ modalForWindow: [self window] modalDelegate: self
+ didEndSelector: @selector( browseSendToAppDone:returnCode:contextInfo: )
+ contextInfo: sender];
+}
+
+- (void) browseSendToAppDone: (NSOpenPanel *) sheet
+ returnCode: (int) returnCode contextInfo: (void *) contextInfo
+{
+ if( returnCode == NSOKButton )
+ {
+ NSString *sendToAppPath = [[sheet filenames] objectAtIndex: 0];
+ NSString *sendToAppDirectory = [sendToAppPath stringByDeletingLastPathComponent];
+ [[NSUserDefaults standardUserDefaults] setObject:sendToAppDirectory forKey:@"LastSendToAppDirectory"];
+ [sheet orderOut: self];
+ NSString *sendToAppName;
+ sendToAppName = [[sendToAppPath lastPathComponent] stringByDeletingPathExtension];
+ /* we set the name of the app to send to in the display field */
+ [fSendEncodeToAppField setStringValue:sendToAppName];
+ [[NSUserDefaults standardUserDefaults] setObject:[fSendEncodeToAppField stringValue] forKey:@"SendCompletedEncodeToApp"];
+
+ }
+}
+
+
@end
@implementation HBPreferencesController (Private)