From e009f2d3ebf27b8196b1ea5bd0545d49fab13274 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Tue, 8 Apr 2008 03:04:46 +0000 Subject: MacGui: Fix errant encode done growl alert and send to MetaX function when finishing the first pass of a two pass encode. - We now only send the alerts after an encode finishes as opposed to when a job *within* an encode finishes. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1390 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/HBQueueController.mm | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'macosx') diff --git a/macosx/HBQueueController.mm b/macosx/HBQueueController.mm index 3e0668e24..555ba5cef 100644 --- a/macosx/HBQueueController.mm +++ b/macosx/HBQueueController.mm @@ -1758,15 +1758,24 @@ static NSString* HBQueuePauseResumeToolbarIdentifier = @"HBQueuePauseRe * is released. So for the first job and the beginning of single encodes we check for the existence * of a valid fCurrentJob jobGroup */ - if ([[fCurrentJob jobGroup] destinationPath] && [fCurrentJobGroup status] != HBStatusCanceled) + [currentJob retain]; + /* We need to compare the job group to determine if this is the end of a job group + * or just the end of a job within a group to keep from sending encode done notification + * after the first pass in a two pass encode + */ + HBJobGroup * theJobGroupCheck = [currentJob jobGroup]; + if ((theJobGroupCheck == nil) || (theJobGroupCheck != fCurrentJobGroup)) { - /* Try to send the growl notification destinationPath*/ - [fHBController showGrowlDoneNotification: [[fCurrentJob jobGroup] destinationPath]]; - /* Try to send the file to metax*/ - [fHBController sendToMetaX: [[fCurrentJob jobGroup] destinationPath]]; + /* we need to make sure that we are not at the beginning of a queue and also that the job hasn't + * been cancelled + */ + if ([[fCurrentJob jobGroup] destinationPath] && [fCurrentJobGroup status] != HBStatusCanceled) + { + /* send encode messages to fHBController. User prefs are grokked there. */ + [fHBController showGrowlDoneNotification: [[fCurrentJob jobGroup] destinationPath]]; + [fHBController sendToMetaX: [[fCurrentJob jobGroup] destinationPath]]; + } } - - [currentJob retain]; [fCurrentJob release]; fCurrentJob = currentJob; -- cgit v1.2.3