diff options
author | dynaflash <[email protected]> | 2010-01-21 18:58:17 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2010-01-21 18:58:17 +0000 |
commit | 56fef9aafba02e1f6bac8724aeda00f78b77c712 (patch) | |
tree | 89fdaf9760b03017f1ba9f1233c9ba88886e4ca2 /macosx/HBQueueController.mm | |
parent | e67bbc820dcae0c2bbdbfc5cd24d2b8495285d0a (diff) |
MacGui: Queued item editing initial implementation.
- Sends a chosen queued item back to the main window for reload ( and rescan ) via contextual menu (right click)
- Deletes queued item from queue after being reloaded to main window ( after editing or whatever, send back to queue via Add To Queue Button same as a new source).
- New queue window contextual menu also includes delete and show options previously only available via separate icons.
- Note: Needs testing particularly in the subtitle area, which is not to say there aren't other bugs.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3080 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBQueueController.mm')
-rw-r--r-- | macosx/HBQueueController.mm | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/macosx/HBQueueController.mm b/macosx/HBQueueController.mm index 512dff479..9321b1dd8 100644 --- a/macosx/HBQueueController.mm +++ b/macosx/HBQueueController.mm @@ -75,8 +75,6 @@ return fIsDragging; } - - @end #pragma mark Toolbar Identifiers @@ -254,7 +252,7 @@ static NSString* HBQueuePauseResumeToolbarIdentifier = @"HBQueuePauseRe if( ![[self window] setFrameUsingName:@"Queue"] ) [[self window] center]; [self setWindowFrameAutosaveName:@"Queue"]; - [[self window] setExcludedFromWindowsMenu:YES]; + //[[self window] setExcludedFromWindowsMenu:YES]; /* lets setup our queue list outline view for drag and drop here */ [fOutlineView registerForDraggedTypes: [NSArray arrayWithObject:DragDropSimplePboardType] ]; @@ -598,9 +596,53 @@ static NSString* HBQueuePauseResumeToolbarIdentifier = @"HBQueuePauseRe } } -#pragma mark - +//------------------------------------------------------------------------------------ +// Send the selected queue item back to the main window for rescan and possible edit. +//------------------------------------------------------------------------------------ +- (IBAction)editSelectedQueueItem: (id)sender +{ + NSIndexSet * selectedRows = [fOutlineView selectedRowIndexes]; + NSUInteger row = [selectedRows firstIndex]; + if( row == NSNotFound ) + return; + /* if this is a currently encoding job, we need to be sure to alert the user, + * to let them decide to cancel it first, then if they do, we can come back and + * remove it */ + + if ([[[fJobGroups objectAtIndex:row] objectForKey:@"Status"] integerValue] == 1) + { + /* We pause the encode here so that it doesn't finish right after and then + * screw up the sync while the window is open + */ + [fHBController Pause:NULL]; + NSString * alertTitle = [NSString stringWithFormat:NSLocalizedString(@"Stop This Encode and Remove It ?", nil)]; + // Which window to attach the sheet to? + NSWindow * docWindow = nil; + if ([sender respondsToSelector: @selector(window)]) + docWindow = [sender window]; + + + NSBeginCriticalAlertSheet( + alertTitle, + NSLocalizedString(@"Keep Encoding", nil), + nil, + NSLocalizedString(@"Stop Encoding and Delete", nil), + docWindow, self, + nil, @selector(didDimissCancelCurrentJob:returnCode:contextInfo:), nil, + NSLocalizedString(@"Your movie will be lost if you don't continue encoding.", nil)); + + } + else + { + /* since we are not a currently encoding item, we can just be cancelled */ + [fHBController rescanQueueItemToMainWindow:[[fJobGroups objectAtIndex:row] objectForKey:@"SourcePath"] scanTitleNum:[[[fJobGroups objectAtIndex:row] objectForKey:@"TitleNumber"] integerValue] selectedQueueItem:row]; + + } +} + +#pragma mark - #pragma mark Animate Endcoding Item |