If we don't have the permission to connect to the dnscrypt-updater socket,
gray out the check boxes.
This commit is contained in:
@@ -142,6 +142,13 @@ BOOL checkBoxesHaveBeenInitialized = NO;
|
||||
return [config writeToFile: prefPaneConfigFile atomically: YES];
|
||||
}
|
||||
|
||||
- (void) setReadOnly: (BOOL) readOnly {
|
||||
enableOpenDNSButton.enabled = !readOnly;
|
||||
enableDNSCryptButton.enabled = !readOnly;
|
||||
useHTTPSButton.enabled = !readOnly;
|
||||
enableInsecureDNSButton.enabled = !readOnly;
|
||||
}
|
||||
|
||||
- (BOOL) loadPrefPaneConfig
|
||||
{
|
||||
NSString *prefPaneConfigFile = [self getPrefPaneConfigFile];
|
||||
@@ -160,6 +167,9 @@ BOOL checkBoxesHaveBeenInitialized = NO;
|
||||
if ([enableInsecure_ isKindOfClass: [NSNumber class]]) {
|
||||
enableInsecure = [enableInsecure_ boolValue];
|
||||
}
|
||||
if ([self sendCommandToConfigUpdater: @"dc.w $4E71"] == FALSE) {
|
||||
[self setReadOnly: YES];
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user