]> granicus.if.org Git - handbrake/commitdiff
MacGui: fix the multiple instances alert.
authorritsuka <damiog@gmail.com>
Thu, 30 Apr 2015 16:57:16 +0000 (16:57 +0000)
committerritsuka <damiog@gmail.com>
Thu, 30 Apr 2015 16:57:16 +0000 (16:57 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7138 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/HBAppDelegate.m

index 23ddf3d014630280c3558dfdb820073b907929c8..03e10a92171d2aac66be70e461d4ab91567dc070 100644 (file)
     if ([[NSUserDefaults standardUserDefaults] boolForKey:@"OutputPanelIsOpen"])
         [self showOutputPanel:nil];
 
+    // On Screen Notification
+    // We check to see if there is already another instance of hb running.
+    if (instances > 1)
+    {
+        NSAlert *alert = [[NSAlert alloc] init];
+        [alert setMessageText:NSLocalizedString(@"There is already an instance of HandBrake running.", nil)];
+        [alert setInformativeText:NSLocalizedString(@"The queue will be shared between the instances.", nil)];
+        [alert runModal];
+    }
+    else
+    {
+        [self.queueController setEncodingJobsAsPending];
+        [self.queueController removeCompletedJobs];
+    }
+
     // Now we re-check the queue array to see if there are
     // any remaining encodes to be done
     if (self.queueController.count)
     {
-        // On Screen Notification
-        // We check to see if there is already another instance of hb running.
-        // Note: hbInstances == 1 means we are the only instance of HandBrake.app
-        NSAlert *alert = nil;
-        if (instances > 1)
-        {
-            alert = [[NSAlert alloc] init];
-            [alert setMessageText:NSLocalizedString(@"There is already an instance of HandBrake running.", @"")];
-            [alert setInformativeText:NSLocalizedString(@"HandBrake will now load up the existing queue.", nil)];
-            [alert addButtonWithTitle:NSLocalizedString(@"Reload Queue", nil)];
-        }
-        else
-        {
-            [self.queueController setEncodingJobsAsPending];
-            [self.queueController removeCompletedJobs];
-        }
         [self showMainWindow:self];
         [self showQueueWindow:self];
     }