]> granicus.if.org Git - handbrake/commitdiff
MacGui: update the UI after a failed queue scan.
authorDamiano Galassi <damiog@gmail.com>
Fri, 29 Jul 2016 10:42:46 +0000 (12:42 +0200)
committerDamiano Galassi <damiog@gmail.com>
Fri, 29 Jul 2016 10:42:46 +0000 (12:42 +0200)
macosx/HBQueueController.m

index ac33e8dd0eba1b40a15d70b16fd1e43a6399f534..3c39606c67373d7ec152c175dcd08364ba4fb7ec 100644 (file)
     }
     [self.window.toolbar validateVisibleItems];
     [self.jobs commit];
+
+    // Update UI
+    NSString *info = nil;
+    switch (result) {
+        case HBCoreResultDone:
+            info = NSLocalizedString(@"Encode Finished.", @"");
+            break;
+        case HBCoreResultCancelled:
+            info = NSLocalizedString(@"Encode Cancelled.", @"");
+            break;
+        default:
+            info = NSLocalizedString(@"Encode Failed.", @"");
+            break;
+    }
+    self.progressTextField.stringValue = info;
+    [self.controller setQueueInfo:info progress:1.0 hidden:YES];
+
+    // Restore dock icon
+    [self.dockTile updateDockIcon:-1.0 withETA:@""];
+    self.dockIconProgress = 0;
 }
 
 /**
     // Completion handler
     void (^completionHandler)(HBCoreResult result) = ^(HBCoreResult result)
     {
-        NSString *info = NSLocalizedString(@"Encode Finished.", @"");
-        self.progressTextField.stringValue = info;
-        [self.controller setQueueInfo:info progress:1.0 hidden:YES];
-
-        // Restore dock icon
-        [self.dockTile updateDockIcon:-1.0 withETA:@""];
-        self.dockIconProgress = 0;
-
         [self completedJob:job result:result];
         [self encodeNextQueueItem];
     };