From a7fb7371bb83e6d244783de10e3006f618d44410 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Mon, 22 Sep 2008 17:46:32 +0000 Subject: MacGui: Re-enable deleting encodes with the delete key if hilighted. - Currently one at a time, multiple selections are shut off for queue sync reasons . - Note: To delete a finished encode, click on it and hit your delete key ( since the action icon is an "open file in finder" magnifying glass) as this is the only way currently to delete a finished encode. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1744 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.mm | 8 ++++---- macosx/English.lproj/Queue.xib | 12 +++++------- macosx/HBQueueController.mm | 13 ++++++++++++- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 38ff91540..46049cdc5 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -1565,14 +1565,14 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It - (void) removeQueueFileItem:(int) queueItemToRemove { - /* Find out if the item we are removing is a cancelled item*/ - if ([[[QueueFileArray objectAtIndex:queueItemToRemove] objectForKey:@"Status"] intValue] == 3) + /* Find out if the item we are removing is a cancelled (3) or a finished (0) item*/ + if ([[[QueueFileArray objectAtIndex:queueItemToRemove] objectForKey:@"Status"] intValue] == 3 || [[[QueueFileArray objectAtIndex:queueItemToRemove] objectForKey:@"Status"] intValue] == 0) { - /* Since we are removing a cancelled item, WE need to decrement the currentQueueEncodeIndex + /* Since we are removing a cancelled or finished item, WE need to decrement the currentQueueEncodeIndex * by one to keep in sync with the queue array */ currentQueueEncodeIndex--; - [self writeToActivityLog: "removeQueueFileItem: Removing a cancelled encode, decrement currentQueueEncodeIndex to %d", currentQueueEncodeIndex]; + [self writeToActivityLog: "removeQueueFileItem: Removing a cancelled/finished encode, decrement currentQueueEncodeIndex to %d", currentQueueEncodeIndex]; } [QueueFileArray removeObjectAtIndex:queueItemToRemove]; [self saveQueueFileItem]; diff --git a/macosx/English.lproj/Queue.xib b/macosx/English.lproj/Queue.xib index c64871915..667d263a3 100644 --- a/macosx/English.lproj/Queue.xib +++ b/macosx/English.lproj/Queue.xib @@ -8,7 +8,7 @@ 352.00 YES - + YES @@ -204,7 +204,7 @@ 1.700000e+01 - 448823296 + 314605568 1 15 0 @@ -474,7 +474,7 @@ - removeSelectedJobGroups: + removeSelectedQueueItem: @@ -796,9 +796,9 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{311, 67}, {574, 423}} + {{170, 67}, {574, 423}} com.apple.InterfaceBuilder.CocoaPlugin - {{311, 67}, {574, 423}} + {{170, 67}, {574, 423}} @@ -945,7 +945,6 @@ YES cancelCurrentJob: - removeSelectedJobGroups: revealSelectedJobGroups: togglePauseResume: toggleStartCancel: @@ -956,7 +955,6 @@ id id id - id diff --git a/macosx/HBQueueController.mm b/macosx/HBQueueController.mm index b32e4de3e..e1d01ccc8 100644 --- a/macosx/HBQueueController.mm +++ b/macosx/HBQueueController.mm @@ -485,7 +485,11 @@ if (fWorkingCount > 0) if ([[[fJobGroups objectAtIndex:row] objectForKey:@"Status"] intValue] == 1) { - NSString * alertTitle = [NSString stringWithFormat:NSLocalizedString(@"Stop This Encode and Remove It ?", nil)]; + /* 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; if ([sender respondsToSelector: @selector(window)]) @@ -512,6 +516,13 @@ if (fWorkingCount > 0) - (void) didDimissCancelCurrentJob: (NSWindow *)sheet returnCode: (int)returnCode contextInfo: (void *)contextInfo { + /* We resume encoding and perform the appropriate actions + * Note: Pause: is a toggle type method based on hb's current + * state, if it paused, it will resume encoding and vice versa. + * In this case, we are paused from the calling window, so calling + * [fHBController Pause:NULL]; Again will resume encoding + */ + [fHBController Pause:NULL]; if (returnCode == NSAlertOtherReturn) { /* We need to save the currently encoding item number first */ -- cgit v1.2.3