MacGui: fix start/pause toolbar items validation.
authorritsuka <damiog@gmail.com>
Thu, 22 Jan 2015 11:01:37 +0000 (11:01 +0000)
committerritsuka <damiog@gmail.com>
Thu, 22 Jan 2015 11:01:37 +0000 (11:01 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6788 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/HBController.m

index a1d1b2a43bdf8b29e306f13fe744df8932823c5b..f083b2d6a6b834fa4b1761e2365b1631a79c50fd 100644 (file)
             [toolbarItem setPaletteLabel: @"Start Encoding"];
             [toolbarItem setToolTip: @"Start Encoding"];
         }
-    }
 
-    if (self.job)
-    {
-        if (action == @selector(showPicturePanel:) ||
-            action == @selector(showPreviewWindow:) ||
-            action == @selector(addToQueue:))
+        if (action == @selector(rip:))
         {
-            return YES;
+            return (self.job != nil || fQueueController.pendingItemsCount > 0);
         }
-    }
-    else
-    {
-        if (action == @selector(showPicturePanel:) ||
-            action == @selector(showPreviewWindow:) ||
-            action == @selector(addToQueue:))
+
+        if (action == @selector(pause:))
         {
             return NO;
         }
     }
 
-    // If there are any pending queue items, make sure the start/stop button is active.
-    if (action == @selector(rip:) && (fQueueController.pendingItemsCount > 0 || self.job))
+    if (action == @selector(showPicturePanel:) ||
+        action == @selector(showPreviewWindow:) ||
+        action == @selector(addToQueue:))
     {
-        return YES;
+        return (self.job != nil);
     }
 
     return YES;