[File Permissions] Add warning dialog
Added a warning dialog to notify the user of the purpose of the add folder dialog that will pop up after it. Otherwise, they may get the idea that the dialog is a glitch and should be cancelled. Signed-off-by: Christopher Snowhill <kode54@gmail.com>main
parent
f9aa56b18a
commit
5c3b876c04
|
@ -332,13 +332,27 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
|
||||||
|
|
||||||
if(!_entry) {
|
if(!_entry) {
|
||||||
dispatch_sync_reentrant(dispatch_get_main_queue(), ^{
|
dispatch_sync_reentrant(dispatch_get_main_queue(), ^{
|
||||||
|
static BOOL warnedYet = NO;
|
||||||
|
|
||||||
|
if(!warnedYet) {
|
||||||
|
NSAlert *alert = [[NSAlert alloc] init];
|
||||||
|
[alert setMessageText:NSLocalizedString(@"GrantPathTitle", @"Title of file dialog for granting folder access")];
|
||||||
|
[alert setInformativeText:NSLocalizedString(@"GrantPathMessage", @"Message to new users regarding file permissions")];
|
||||||
|
[alert addButtonWithTitle:NSLocalizedString(@"GrantPathOK", @"OK button text")];
|
||||||
|
[alert addButtonWithTitle:NSLocalizedString(@"GrantPathStopWarning", @"Button to stop warnings for session")];
|
||||||
|
|
||||||
|
if([alert runModal] == NSAlertSecondButtonReturn) {
|
||||||
|
warnedYet = YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||||
[panel setAllowsMultipleSelection:NO];
|
[panel setAllowsMultipleSelection:NO];
|
||||||
[panel setCanChooseDirectories:YES];
|
[panel setCanChooseDirectories:YES];
|
||||||
[panel setCanChooseFiles:NO];
|
[panel setCanChooseFiles:NO];
|
||||||
[panel setFloatingPanel:YES];
|
[panel setFloatingPanel:YES];
|
||||||
[panel setDirectoryURL:folderUrl];
|
[panel setDirectoryURL:folderUrl];
|
||||||
[panel setTitle:@"Open to grant access to container folder"];
|
[panel setTitle:NSLocalizedString(@"GrantPathTitle", @"Title of file dialog for granting folder access")];
|
||||||
NSInteger result = [panel runModal];
|
NSInteger result = [panel runModal];
|
||||||
if(result == NSModalResponseOK) {
|
if(result == NSModalResponseOK) {
|
||||||
NSURL *folderUrl = [panel URL];
|
NSURL *folderUrl = [panel URL];
|
||||||
|
|
|
@ -78,3 +78,8 @@
|
||||||
"wdhms" = "%@, %@, %@, %@ and %@";
|
"wdhms" = "%@, %@, %@, %@ and %@";
|
||||||
|
|
||||||
"PrivacyPolicyURL" = "https://www.iubenda.com/privacy-policy/59859310";
|
"PrivacyPolicyURL" = "https://www.iubenda.com/privacy-policy/59859310";
|
||||||
|
|
||||||
|
"GrantPathTitle" = "Open to grant access to container folder";
|
||||||
|
"GrantPathMessage" = "Click OK on the following folder open dialog to grant access to the specified folder. Navigate the dialog further up the folder hierarchy to grant broader access to your files. Press 'Stop warning me' to hide any further warnings for the rest of the session.";
|
||||||
|
"GrantPathOK" = "OK";
|
||||||
|
"GrantPathStopWarning" = "Stop warning me";
|
||||||
|
|
|
@ -81,3 +81,8 @@
|
||||||
"wdhms" = "%@, %@, %@, %@ y %@";
|
"wdhms" = "%@, %@, %@, %@ y %@";
|
||||||
|
|
||||||
"PrivacyPolicyURL" = "https://www.iubenda.com/privacy-policy/57237510";
|
"PrivacyPolicyURL" = "https://www.iubenda.com/privacy-policy/57237510";
|
||||||
|
|
||||||
|
"GrantPathTitle" = "Open to grant access to container folder";
|
||||||
|
"GrantPathMessage" = "Click OK on the following folder open dialog to grant access to the specified folder. Navigate the dialog further up the folder hierarchy to grant broader access to your files. Press 'Stop warning me' to hide any further warnings for the rest of the session.";
|
||||||
|
"GrantPathOK" = "OK";
|
||||||
|
"GrantPathStopWarning" = "Stop warning me";
|
||||||
|
|
|
@ -100,3 +100,8 @@
|
||||||
"wdhms" = "%@, %@, %@, %@ i %@";
|
"wdhms" = "%@, %@, %@, %@ i %@";
|
||||||
|
|
||||||
"PrivacyPolicyURL" = "https://www.iubenda.com/privacy-policy/59859310";
|
"PrivacyPolicyURL" = "https://www.iubenda.com/privacy-policy/59859310";
|
||||||
|
|
||||||
|
"GrantPathTitle" = "Open to grant access to container folder";
|
||||||
|
"GrantPathMessage" = "Click OK on the following folder open dialog to grant access to the specified folder. Navigate the dialog further up the folder hierarchy to grant broader access to your files. Press 'Stop warning me' to hide any further warnings for the rest of the session.";
|
||||||
|
"GrantPathOK" = "OK";
|
||||||
|
"GrantPathStopWarning" = "Stop warning me";
|
||||||
|
|
|
@ -132,3 +132,7 @@
|
||||||
|
|
||||||
"PrivacyPolicyURL" = "https://www.iubenda.com/privacy-policy/59859310";
|
"PrivacyPolicyURL" = "https://www.iubenda.com/privacy-policy/59859310";
|
||||||
|
|
||||||
|
"GrantPathTitle" = "Open to grant access to container folder";
|
||||||
|
"GrantPathMessage" = "Click OK on the following folder open dialog to grant access to the specified folder. Navigate the dialog further up the folder hierarchy to grant broader access to your files. Press 'Stop warning me' to hide any further warnings for the rest of the session.";
|
||||||
|
"GrantPathOK" = "OK";
|
||||||
|
"GrantPathStopWarning" = "Stop warning me";
|
||||||
|
|
Loading…
Reference in New Issue