If we don't have the permission to connect to the dnscrypt-updater socket,

gray out the check boxes.
This commit is contained in:
Frank Denis
2011-12-09 16:35:15 -08:00
parent 43a559ed84
commit 731b77e1ad
@@ -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;
}