mirror of https://github.com/HandBrake/HandBrake
MacGui: show the notifications in foreground only if there is a sound
This commit is contained in:
parent
8bb31a753d
commit
e1c859f404
|
|
@ -28,8 +28,6 @@ extern NSString * const HBQueueDidStartNotification;
|
|||
extern NSString * const HBQueueDidCompleteNotification;
|
||||
extern NSString * const HBQueueDidChangeStateNotification;
|
||||
|
||||
extern NSString * const HBQueueNotificationCanceledKey; // NSNumber
|
||||
|
||||
extern NSString * const HBQueueDidStartItemNotification;
|
||||
extern NSString * const HBQueueDidCompleteItemNotification;
|
||||
extern NSString * const HBQueueItemNotificationItemKey; // HBQueueJobItem
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@ NSString * const HBQueueLowSpaceAlertNotification = @"HBQueueLowSpaceAlertNotifi
|
|||
NSString * const HBQueueDidStartNotification = @"HBQueueDidStartNotification";
|
||||
NSString * const HBQueueDidCompleteNotification = @"HBQueueDidCompleteNotification";
|
||||
|
||||
NSString * const HBQueueNotificationCanceledKey = @"HBQueueNotificationCanceledKey";
|
||||
|
||||
NSString * const HBQueueDidStartItemNotification = @"HBQueueDidStartItemNotification";
|
||||
NSString * const HBQueueDidCompleteItemNotification = @"HBQueueDidCompleteItemNotification";
|
||||
NSString * const HBQueueItemNotificationItemKey = @"HBQueueItemNotificationItemKey";
|
||||
|
|
@ -801,9 +799,7 @@ static void powerSourceCallback(void *context)
|
|||
NSUInteger index = [self.itemsInternal indexOfObject:nextItem];
|
||||
[self removeItemsAtIndexes:[NSIndexSet indexSetWithIndex:index]];
|
||||
[self allowSleep];
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:HBQueueDidCompleteNotification
|
||||
object:self
|
||||
userInfo:@{HBQueueNotificationCanceledKey : @YES}];
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:HBQueueDidCompleteNotification object:self];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -86,11 +86,7 @@
|
|||
}];
|
||||
|
||||
[NSNotificationCenter.defaultCenter addObserverForName:HBQueueDidCompleteNotification object:_queue queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note) {
|
||||
BOOL canceled = [note.userInfo[HBQueueNotificationCanceledKey] boolValue];
|
||||
if (canceled == NO)
|
||||
{
|
||||
[self queueCompletedAlerts];
|
||||
}
|
||||
[self queueCompletedAlerts];
|
||||
}];
|
||||
|
||||
[NSNotificationCenter.defaultCenter addObserverForName:HBQueueDidCompleteItemNotification object:_queue queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note) {
|
||||
|
|
@ -436,7 +432,7 @@ NSString * const HBQueueItemNotificationShowCategory = @"HBQueueItemNotification
|
|||
willPresentNotification:(UNNotification *)notification
|
||||
withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler API_AVAILABLE(macos(10.15))
|
||||
{
|
||||
completionHandler(UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionSound);
|
||||
completionHandler(UNNotificationPresentationOptionSound);
|
||||
}
|
||||
|
||||
- (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification
|
||||
|
|
|
|||
Loading…
Reference in New Issue