mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-17 04:09:21 +00:00
Add flag to enable/disable screenshots (#1301)
* Bump TransformerKit to fix compile Fixes build issue with Xcode 15 by raising minimum deployment target to 10.13 * Add flag to disable screenshots Make it possible to disable/enable screenshots, this is disabled by default, to enable use: $ defaults write com.hicknhacksoftware.MacPass AllowScreenshots YES and to disable it use: $ defaults write com.hicknhacksoftware.MacPass AllowScreenshots NO --------- Co-authored-by: Michael Starke <michael.starke@hicknhack-software.com>
This commit is contained in:
@@ -100,6 +100,14 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
|||||||
[super windowDidLoad];
|
[super windowDidLoad];
|
||||||
|
|
||||||
self.window.delegate = self.documentWindowDelegate;
|
self.window.delegate = self.documentWindowDelegate;
|
||||||
|
BOOL allowScreenshots = [NSUserDefaults.standardUserDefaults boolForKey:kMPSettingsKeyAllowScreenshots];
|
||||||
|
if(!allowScreenshots) {
|
||||||
|
self.window.sharingType = NSWindowSharingNone;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
self.window.sharingType = NSWindowSharingReadOnly;
|
||||||
|
}
|
||||||
|
|
||||||
if (@available(macOS 11.0, *)) {
|
if (@available(macOS 11.0, *)) {
|
||||||
/* let the user decide how to dipsplay the toolbar */
|
/* let the user decide how to dipsplay the toolbar */
|
||||||
BOOL useUnifiedToolbar = [NSUserDefaults.standardUserDefaults boolForKey:kMPSettingsKeyUseUnifiedToolbar];
|
BOOL useUnifiedToolbar = [NSUserDefaults.standardUserDefaults boolForKey:kMPSettingsKeyUseUnifiedToolbar];
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyFaviconDownloadMethod;
|
|||||||
|
|
||||||
/* UI */
|
/* UI */
|
||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyUseUnifiedToolbar;
|
APPKIT_EXTERN NSString *const kMPSettingsKeyUseUnifiedToolbar;
|
||||||
|
APPKIT_EXTERN NSString *const kMPSettingsKeyAllowScreenshots;
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, MPFileChangeStrategy) {
|
typedef NS_ENUM(NSUInteger, MPFileChangeStrategy) {
|
||||||
MPFileChangeStrategyAsk,
|
MPFileChangeStrategyAsk,
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ NSString *const kMPSettingsKeyAllowRemoteFetchOfPluginRepository
|
|||||||
NSString *const kMPSettingsKeyFaviconDownloadMethod = @"FaviconDownloadMethod";
|
NSString *const kMPSettingsKeyFaviconDownloadMethod = @"FaviconDownloadMethod";
|
||||||
|
|
||||||
NSString *const kMPSettingsKeyUseUnifiedToolbar = @"UseUnifiedToolbar";
|
NSString *const kMPSettingsKeyUseUnifiedToolbar = @"UseUnifiedToolbar";
|
||||||
|
NSString *const kMPSettingsKeyAllowScreenshots = @"AllowScreenshots";
|
||||||
|
|
||||||
/* Deprecated */
|
/* Deprecated */
|
||||||
NSString *const kMPDeprecatedSettingsKeyRememberKeyFilesForDatabases = @"kMPSettingsKeyRememberKeyFilesForDatabases";
|
NSString *const kMPDeprecatedSettingsKeyRememberKeyFilesForDatabases = @"kMPSettingsKeyRememberKeyFilesForDatabases";
|
||||||
@@ -186,6 +187,7 @@ NSString *const kMPDepricatedSettingsKeyEntryTouchIdDatabaseEncryptedKeyFormat
|
|||||||
kMPSettingsKeyFaviconDownloadMethod: @(MPFaviconDownloadMethodDirect), // Download directly from host
|
kMPSettingsKeyFaviconDownloadMethod: @(MPFaviconDownloadMethodDirect), // Download directly from host
|
||||||
kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection: @NO,
|
kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection: @NO,
|
||||||
kMPSettingsKeyUseUnifiedToolbar: @YES, // Do not use unified toolbar under Big Sur and above
|
kMPSettingsKeyUseUnifiedToolbar: @YES, // Do not use unified toolbar under Big Sur and above
|
||||||
|
kMPSettingsKeyAllowScreenshots: @NO, // Do not allow screenshots or screen recordings of MacPass
|
||||||
kMPSettingsKeyFocusSearchAfterUnlock: @NO, // Do not enter search directly after unlocking the database
|
kMPSettingsKeyFocusSearchAfterUnlock: @NO, // Do not enter search directly after unlocking the database
|
||||||
kMPSettingsKeyUsePrivateBrowsingWhenOpeningURLs: @NO // No private mode when option URLs by default
|
kMPSettingsKeyUsePrivateBrowsingWhenOpeningURLs: @NO // No private mode when option URLs by default
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user