MacGui: Add a "Quit HandBrake" option to the "When done" actions.

This commit is contained in:
cubicibo 2022-03-16 20:06:23 +01:00 committed by Damiano Galassi
parent 85f75b13d0
commit aae3d81cdd
4 changed files with 9 additions and 0 deletions

View File

@ -125,6 +125,7 @@
<menuItem title="Alert And Notification" tag="3" id="496"/>
<menuItem title="Put Computer To Sleep" tag="4" id="497"/>
<menuItem title="Shut Down Computer" tag="5" id="498"/>
<menuItem title="Quit HandBrake" tag="6" id="500"/>
</items>
</menu>
</popUpButtonCell>

View File

@ -96,6 +96,7 @@
<menuItem title="Alert and Notification" tag="3" id="aat-1N-Odn"/>
<menuItem title="Put Computer to Sleep" tag="4" id="GUQ-xb-HVS"/>
<menuItem title="Shut Down Computer" tag="5" id="QmP-SQ-XKK"/>
<menuItem title="Quit HandBrake" tag="6" id="tBG-Gf-ynI"/>
</items>
</menu>
</popUpButtonCell>

View File

@ -14,6 +14,7 @@ typedef NS_ENUM(NSUInteger, HBDoneAction) {
HBDoneActionAlertAndNotification = 3,
HBDoneActionSleep = 4,
HBDoneActionShutDown = 5,
HBDoneActionQuit = 6,
};
extern NSString * const HBShowOpenPanelAtLaunch;

View File

@ -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