From a03845e869297931544d4d8ba5a15678411df155 Mon Sep 17 00:00:00 2001 From: ritsuka Date: Sun, 28 Dec 2014 08:14:32 +0000 Subject: MacGui: move more things out of HBController. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6664 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.m | 55 +++++------------------------- macosx/English.lproj/MainMenu.xib | 11 ++++-- macosx/HBAudio.m | 1 + macosx/HBJob+UIAdditions.h | 3 ++ macosx/HBJob+UIAdditions.m | 72 +++++++++++++++++++++++++++++++++++++++ macosx/HBPicture+UIAdditions.m | 28 ++++++++------- macosx/HBQueueController.mm | 5 --- macosx/HBRange+UIAdditions.h | 1 + macosx/HBRange+UIAdditions.m | 7 ++++ macosx/HBRange.m | 20 +++++++++++ 10 files changed, 137 insertions(+), 66 deletions(-) (limited to 'macosx') diff --git a/macosx/Controller.m b/macosx/Controller.m index 947d9fca3..bc0da2012 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -547,12 +547,6 @@ [fPresetDrawer open:self]; } - /* Setup the start / stop popup */ - [fEncodeStartStopPopUp removeAllItems]; - [fEncodeStartStopPopUp addItemWithTitle: @"Chapters"]; - [fEncodeStartStopPopUp addItemWithTitle: @"Seconds"]; - [fEncodeStartStopPopUp addItemWithTitle: @"Frames"]; - // Align the start / stop widgets with the chapter popups NSPoint startPoint = [fSrcChapterStartPopUp frame].origin; startPoint.y += 2; @@ -565,38 +559,12 @@ [fSrcFrameStartEncodingField setFrameOrigin:startPoint]; [fSrcFrameEndEncodingField setFrameOrigin:endPoint]; - - /* Destination box*/ - NSMenuItem *menuItem; - [fDstFormatPopUp removeAllItems]; - for (const hb_container_t *container = hb_container_get_next(NULL); - container != NULL; - container = hb_container_get_next(container)) - { - NSString *title = nil; - if (container->format & HB_MUX_MASK_MP4) - { - title = @"MP4 File"; - } - else if (container->format & HB_MUX_MASK_MKV) - { - title = @"MKV File"; - } - else - { - title = [NSString stringWithUTF8String:container->name]; - } - menuItem = [[fDstFormatPopUp menu] addItemWithTitle:title - action:nil - keyEquivalent:@""]; - [menuItem setTag:container->format]; - } - /* Bottom */ - [fStatusField setStringValue: @""]; + // Bottom + [fStatusField setStringValue:@""]; - /* Register HBController's Window as a receiver for files/folders drag & drop operations */ - [fWindow registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]]; + // Register HBController's Window as a receiver for files/folders drag & drop operations + [fWindow registerForDraggedTypes:@[NSFilenamesPboardType]]; // Set up the preset drawer fPresetsView = [[HBPresetsViewController alloc] initWithPresetManager:presetManager]; @@ -1582,10 +1550,8 @@ { // Open a panel to let the user choose and update the text field NSSavePanel *panel = [NSSavePanel savePanel]; - - // We get the current file name and path from the destination field here - [panel setDirectoryURL:self.job.destURL.URLByDeletingLastPathComponent]; - [panel setNameFieldStringValue:self.job.destURL.lastPathComponent]; + panel.directoryURL = self.job.destURL.URLByDeletingLastPathComponent; + panel.nameFieldStringValue = self.job.destURL.lastPathComponent; [panel beginSheetModalForWindow:fWindow completionHandler:^(NSInteger result) { if (result == NSFileHandlingPanelOKButton) @@ -2017,6 +1983,9 @@ static void queueFSEventStreamCallback( // Lets mark our new encode as 1 or "Encoding" queueJob.state = HBJobStateWorking; + + // We are done using the title, remove it from the job + queueJob.title = nil; [self saveQueueFileItem]; } else @@ -2270,12 +2239,6 @@ static void queueFSEventStreamCallback( //------------------------------------------------------------------------------------ - (IBAction)Cancel: (id)sender { - if (!fQueueController) return; - - /* - * No need to allow system sleep here as we'll either call Cancel: - * (which will take care of it) or resume right away - */ [self.queueCore pause]; // Which window to attach the sheet to? diff --git a/macosx/English.lproj/MainMenu.xib b/macosx/English.lproj/MainMenu.xib index 0b3ce8117..ca054e290 100644 --- a/macosx/English.lproj/MainMenu.xib +++ b/macosx/English.lproj/MainMenu.xib @@ -120,6 +120,7 @@ + @@ -213,7 +214,12 @@ - + + + HBContainerTransformer + + +