summaryrefslogtreecommitdiffstats
path: root/macosx/HBAppDelegate.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2015-04-22 16:58:07 +0000
committerritsuka <[email protected]>2015-04-22 16:58:07 +0000
commit7b402b36a87aa44e1fd23d9fdefa4af4a5af4158 (patch)
tree25a737536203196bcf5dd085fec56c30c80fbf24 /macosx/HBAppDelegate.m
parent1e990c1a5441c64ce2b985e019a814deecf74843 (diff)
MacGui: Remove the "Reload queue" alert. The queue is always reloaded and the queue window is shown if there are pending jobs.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7113 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBAppDelegate.m')
-rw-r--r--macosx/HBAppDelegate.m92
1 files changed, 10 insertions, 82 deletions
diff --git a/macosx/HBAppDelegate.m b/macosx/HBAppDelegate.m
index 4f998ce2d..23ddf3d01 100644
--- a/macosx/HBAppDelegate.m
+++ b/macosx/HBAppDelegate.m
@@ -90,15 +90,8 @@
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"OutputPanelIsOpen"])
[self showOutputPanel:nil];
- // Open queue window now if it was visible when HB was closed
- if ([[NSUserDefaults standardUserDefaults] boolForKey:@"QueueWindowIsOpen"])
- [self showQueueWindow:nil];
-
- [self showMainWindow:self];
-
// Now we re-check the queue array to see if there are
- // any remaining encodes to be done in it and ask the
- // user if they want to reload the queue
+ // any remaining encodes to be done
if (self.queueController.count)
{
// On Screen Notification
@@ -114,64 +107,19 @@
}
else
{
- if (self.queueController.workingItemsCount > 0 || self.queueController.pendingItemsCount > 0)
- {
- NSString *alertTitle;
-
- if (self.queueController.workingItemsCount > 0)
- {
- alertTitle = [NSString stringWithFormat:
- NSLocalizedString(@"HandBrake Has Detected %d Previously Encoding Item(s) and %d Pending Item(s) In Your Queue.", @""),
- self.queueController.workingItemsCount, self.queueController.pendingItemsCount];
- }
- else
- {
- alertTitle = [NSString stringWithFormat:
- NSLocalizedString(@"HandBrake Has Detected %d Pending Item(s) In Your Queue.", @""),
- self.queueController.pendingItemsCount];
- }
-
- alert = [[NSAlert alloc] init];
- [alert setMessageText:alertTitle];
- [alert setInformativeText:NSLocalizedString(@"Do you want to reload them ?", nil)];
- [alert addButtonWithTitle:NSLocalizedString(@"Reload Queue", nil)];
- [alert addButtonWithTitle:NSLocalizedString(@"Empty Queue", nil)];
- [alert setAlertStyle:NSCriticalAlertStyle];
- }
- else
- {
- // Since we addressed any pending or previously encoding items above, we go ahead and make sure
- // the queue is empty of any finished items or cancelled items.
- [self.queueController removeAllJobs];
- [self.mainController launchAction];
- }
- }
-
- if (alert)
- {
- NSModalResponse response = [alert runModal];
-
- if (response == NSAlertSecondButtonReturn)
- {
- [HBUtilities writeToActivityLog:"didDimissReloadQueue NSAlertSecondButtonReturn Chosen"];
- [self.queueController removeAllJobs];
- [self.mainController launchAction];
- }
- else
- {
- [HBUtilities writeToActivityLog:"didDimissReloadQueue NSAlertFirstButtonReturn Chosen"];
- if (instances == 1)
- {
- [self.queueController setEncodingJobsAsPending];
- }
-
- [self showQueueWindow:nil];
- }
-
+ [self.queueController setEncodingJobsAsPending];
+ [self.queueController removeCompletedJobs];
}
+ [self showMainWindow:self];
+ [self showQueueWindow:self];
}
else
{
+ // Open queue window now if it was visible when HB was closed
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"QueueWindowIsOpen"])
+ [self showQueueWindow:nil];
+
+ [self showMainWindow:self];
[self.mainController launchAction];
}
@@ -217,26 +165,6 @@
}
}
- // Warn if items still in the queue
- else if (self.queueController.pendingItemsCount > 0)
- {
- NSAlert *alert = [[NSAlert alloc] init];
- [alert setMessageText:NSLocalizedString(@"Are you sure you want to quit HandBrake?", nil)];
- [alert setInformativeText:NSLocalizedString(@"There are pending encodes in your queue. Do you want to quit anyway?",nil)];
- [alert addButtonWithTitle:NSLocalizedString(@"Quit", nil)];
- [alert addButtonWithTitle:NSLocalizedString(@"Don't Quit", nil)];
- [alert setAlertStyle:NSCriticalAlertStyle];
- NSInteger result = [alert runModal];
- if (result == NSAlertFirstButtonReturn)
- {
- return NSTerminateNow;
- }
- else
- {
- return NSTerminateCancel;
- }
- }
-
return NSTerminateNow;
}