From 166c0420e56e1cc6100dcbe0b8e146539ac0a1ff Mon Sep 17 00:00:00 2001 From: Russell Hancox Date: Tue, 23 Jul 2024 13:33:29 -0400 Subject: [PATCH] GUI: Make dismiss button configurable, change default text back to dismiss (#1399) --- Source/common/SNTConfigurator.h | 5 +++++ Source/common/SNTConfigurator.m | 10 ++++++++++ Source/gui/Resources/MessageWindow.xib | 3 ++- Source/gui/SNTBinaryMessageWindowController.h | 5 +++++ Source/gui/SNTBinaryMessageWindowController.m | 5 +++++ 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Source/common/SNTConfigurator.h b/Source/common/SNTConfigurator.h index b08cbbdb5..e98a14b3b 100644 --- a/Source/common/SNTConfigurator.h +++ b/Source/common/SNTConfigurator.h @@ -347,6 +347,11 @@ /// @property(readonly, nonatomic) NSString *eventDetailText; +/// +/// This string represents the text to show on the "Dismiss" button in the UI instead of "Dismiss". +/// +@property(readonly, nonatomic) NSString *dismissText; + /// /// In lockdown mode this is the message shown to the user when an unknown binary /// is blocked. If this message is not configured, a reasonable default is provided. diff --git a/Source/common/SNTConfigurator.m b/Source/common/SNTConfigurator.m index 8c3ce2fee..55d74ad19 100644 --- a/Source/common/SNTConfigurator.m +++ b/Source/common/SNTConfigurator.m @@ -97,6 +97,7 @@ @implementation SNTConfigurator static NSString *const kMoreInfoURLKey = @"MoreInfoURL"; static NSString *const kEventDetailURLKey = @"EventDetailURL"; static NSString *const kEventDetailTextKey = @"EventDetailText"; +static NSString *const kDismissTextKey = @"DismissText"; static NSString *const kUnknownBlockMessage = @"UnknownBlockMessage"; static NSString *const kBannedBlockMessage = @"BannedBlockMessage"; static NSString *const kBannedUSBBlockMessage = @"BannedUSBBlockMessage"; @@ -227,6 +228,7 @@ - (instancetype)initWithSyncStateFile:(NSString *)syncStateFilePath kMoreInfoURLKey : string, kEventDetailURLKey : string, kEventDetailTextKey : string, + kDismissTextKey : string, kUnknownBlockMessage : string, kBannedBlockMessage : string, kBannedUSBBlockMessage : string, @@ -409,6 +411,10 @@ + (NSSet *)keyPathsForValuesAffectingEventDetailText { return [self configStateSet]; } ++ (NSSet *)keyPathsForValuesAffectingDismissText { + return [self configStateSet]; +} + + (NSSet *)keyPathsForValuesAffectingUnknownBlockMessage { return [self configStateSet]; } @@ -774,6 +780,10 @@ - (NSString *)eventDetailText { return self.configState[kEventDetailTextKey]; } +- (NSString *)dismissText { + return self.configState[kDismissTextKey]; +} + - (NSString *)unknownBlockMessage { return self.configState[kUnknownBlockMessage]; } diff --git a/Source/gui/Resources/MessageWindow.xib b/Source/gui/Resources/MessageWindow.xib index db15e6a82..0290de836 100644 --- a/Source/gui/Resources/MessageWindow.xib +++ b/Source/gui/Resources/MessageWindow.xib @@ -13,6 +13,7 @@ + @@ -286,7 +287,7 @@ DQ