From aae3d81cdd9df2bc5834a7be3eaa24f55d23269a Mon Sep 17 00:00:00 2001 From: cubicibo Date: Wed, 16 Mar 2022 20:06:23 +0100 Subject: [PATCH] MacGui: Add a "Quit HandBrake" option to the "When done" actions. --- macosx/Base.lproj/Preferences.xib | 1 + macosx/Base.lproj/Queue.xib | 1 + macosx/HBPreferencesKeys.h | 1 + macosx/HBQueueController.m | 6 ++++++ 4 files changed, 9 insertions(+) diff --git a/macosx/Base.lproj/Preferences.xib b/macosx/Base.lproj/Preferences.xib index 801a8c74b..7450f52e2 100644 --- a/macosx/Base.lproj/Preferences.xib +++ b/macosx/Base.lproj/Preferences.xib @@ -125,6 +125,7 @@ + diff --git a/macosx/Base.lproj/Queue.xib b/macosx/Base.lproj/Queue.xib index c4b858ada..bc0f000a3 100644 --- a/macosx/Base.lproj/Queue.xib +++ b/macosx/Base.lproj/Queue.xib @@ -96,6 +96,7 @@ + diff --git a/macosx/HBPreferencesKeys.h b/macosx/HBPreferencesKeys.h index 93051ddfd..55aaa1a12 100644 --- a/macosx/HBPreferencesKeys.h +++ b/macosx/HBPreferencesKeys.h @@ -14,6 +14,7 @@ typedef NS_ENUM(NSUInteger, HBDoneAction) { HBDoneActionAlertAndNotification = 3, HBDoneActionSleep = 4, HBDoneActionShutDown = 5, + HBDoneActionQuit = 6, }; extern NSString * const HBShowOpenPanelAtLaunch; diff --git a/macosx/HBQueueController.m b/macosx/HBQueueController.m index c6a2b5ec5..323cc1370 100644 --- a/macosx/HBQueueController.m +++ b/macosx/HBQueueController.m @@ -554,6 +554,12 @@ NSString * const HBQueueItemNotificationPathKey = @"HBQueueItemNotificationPathK NSAppleScript *scriptObject = [[NSAppleScript alloc] initWithSource:@"tell application \"System Events\" to shut down"]; [scriptObject executeAndReturnError:NULL]; } + + // If Quit HB has been selected + if ([ud integerForKey:HBAlertWhenDone] == HBDoneActionQuit) + { + [NSApp terminate:self]; + } } - (void)queueLowDiskSpaceAlert