diff options
author | Damiano Galassi <[email protected]> | 2018-06-09 09:07:46 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2018-06-09 09:07:46 +0200 |
commit | 047c78c7946aeba026a259c1a9cad8937975115b (patch) | |
tree | 1936943e3caea0377bcbea05ec227e96e763225a /macosx | |
parent | 291fc6bee201e86304ecaa761a169b94d6afb468 (diff) |
MacGui: show the copy protection alert at most once each time HandBrake is run.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/HBController.m | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/macosx/HBController.m b/macosx/HBController.m index 12eb06d7b..d4393aa50 100644 --- a/macosx/HBController.m +++ b/macosx/HBController.m @@ -134,6 +134,9 @@ @property (nonatomic, readwrite) NSColor *labelColor; +// Alerts +@property (nonatomic) BOOL suppressCopyProtectionWarning; + @end #define WINDOW_HEIGHT_OFFSET_INIT 48 @@ -551,7 +554,7 @@ { NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText:NSLocalizedString(@"Copy-Protected sources are not supported.", nil)]; - [alert setInformativeText:NSLocalizedString(@"Please note that HandBrake does not support the removal of copy-protection from DVD Discs. You can if you wish use any other 3rd party software for this function.", nil)]; + [alert setInformativeText:NSLocalizedString(@"Please note that HandBrake does not support the removal of copy-protection from DVD Discs. You can if you wish use any other 3rd party software for this function. This warning will be shown only once each time HandBrake is run.", nil)]; [alert addButtonWithTitle:NSLocalizedString(@"Attempt Scan Anyway", nil)]; [alert addButtonWithTitle:NSLocalizedString(@"Cancel", nil)]; @@ -579,17 +582,14 @@ NSURL *mediaURL = [HBUtilities mediaURLFromURL:fileURL]; NSError *outError = NULL; - BOOL suppressWarning = [[NSUserDefaults standardUserDefaults] boolForKey:@"suppressCopyProtectionAlert"]; // Check if we can scan the source and if there is any warning. BOOL canScan = [self.core canScan:mediaURL error:&outError]; // Notify the user that we don't support removal of copy proteciton. - if (canScan && [outError code] == 101 && !suppressWarning) + if (canScan && [outError code] == 101 && !self.suppressCopyProtectionWarning) { - // Only show the user this warning once. They may be using a solution we don't know about. Notifying them each time is annoying. - [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"suppressCopyProtectionAlert"]; - + self.suppressCopyProtectionWarning = YES; if ([self runCopyProtectionAlert] == NSAlertFirstButtonReturn) { // User chose to override our warning and scan the physical dvd anyway, at their own peril. on an encrypted dvd this produces massive log files and fails |