OSDN Git Service

MacGui: Fix errant encode done growl alert and send to MetaX function when finishing...
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 8 Apr 2008 03:04:46 +0000 (03:04 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 8 Apr 2008 03:04:46 +0000 (03:04 +0000)
- We now only send the alerts after an encode finishes as opposed to when a job *within* an encode finishes.

git-svn-id: svn://localhost/HandBrake/trunk@1390 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/HBQueueController.mm

index 3e0668e..555ba5c 100644 (file)
@@ -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;