+ return [NSArray arrayWithObjects: TOOLBAR_GENERAL, /*TOOLBAR_PICTURE, */
+ 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)
+
+- (void) setPrefView: (id) sender
+{
+ NSView * view = fGeneralView;
+ if( sender )
+ {
+ NSString * identifier = [sender itemIdentifier];
+ if( [identifier isEqualToString: TOOLBAR_PICTURE] )
+ view = fPictureView;
+ else if( [identifier isEqualToString: TOOLBAR_AUDIO] )
+ view = fAudioView;
+ else if( [identifier isEqualToString: TOOLBAR_ADVANCED] )
+ view = fAdvancedView;
+ else;
+ }
+
+ NSWindow * window = [self window];
+ if( [window contentView] == view )
+ return;
+
+ NSRect windowRect = [window frame];
+ CGFloat difference = ( [view frame].size.height - [[window contentView] frame].size.height ) * [window userSpaceScaleFactor];
+ windowRect.origin.y -= difference;
+ windowRect.size.height += difference;
+
+ [view setHidden: YES];
+ [window setContentView: view];
+ [window setFrame: windowRect display: YES animate: YES];
+ [view setHidden: NO];
+
+ //set title label
+ if( sender )
+ [window setTitle: [sender label]];
+ else
+ {
+ NSToolbar * toolbar = [window toolbar];
+ NSString * itemIdentifier = [toolbar selectedItemIdentifier];
+ for( NSToolbarItem * item in [toolbar items] )
+ if( [[item itemIdentifier] isEqualToString: itemIdentifier] )
+ {
+ [window setTitle: [item label]];
+ break;
+ }
+ }