Add a button to the preference pane to disable ipv6
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
@synthesize exceptionsTextField = _exceptionsTextField;
|
||||
@synthesize dnscryptButton = _dnscryptButton;
|
||||
@synthesize fallbackButton = _fallbackButton;
|
||||
@synthesize disableIPv6Button = _disableIPv6Button;
|
||||
@synthesize statusImageView = _statusImageView;
|
||||
@synthesize statusText = _statusText;
|
||||
@synthesize currentResolverTextField = _currentResolverTextField;
|
||||
@@ -55,6 +56,7 @@ NSArray *resolversList;
|
||||
|
||||
_dnscryptButton.state = 0;
|
||||
_fallbackButton.state = 0;
|
||||
_disableIPv6Button.state = 0;
|
||||
|
||||
res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-c", @"cd '" kDNSCRIPT_SCRIPTS_BASE_DIR @"' && exec ./get-dnscrypt-status.sh", nil]];
|
||||
if ([res isEqualToString: @"yes"]) {
|
||||
@@ -64,6 +66,10 @@ NSArray *resolversList;
|
||||
if ([res isEqualToString: @"yes"]) {
|
||||
[_fallbackButton setState: 1];
|
||||
}
|
||||
res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-c", @"cd '" kDNSCRIPT_SCRIPTS_BASE_DIR @"' && exec ./get-aaaa-blocking-status.sh", nil]];
|
||||
if ([res isEqualToString: @"yes"]) {
|
||||
[_disableIPv6Button setState: 1];
|
||||
}
|
||||
res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-c", @"cd '" kDNSCRIPT_SCRIPTS_BASE_DIR @"' && exec ./get-static-resolvers.sh", nil]];
|
||||
[_staticResolversTextField setStringValue: res];
|
||||
res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-c", @"cd '" kDNSCRIPT_SCRIPTS_BASE_DIR @"' && exec ./get-query-logging-status.sh", nil]];
|
||||
@@ -202,6 +208,20 @@ NSArray *resolversList;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
- (BOOL) setDisableIPv6On {
|
||||
[self showSpinners];
|
||||
NSString *res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-c", @"cd '" kDNSCRIPT_SCRIPTS_BASE_DIR @"' && ./create-ticket.sh && ./switch-aaaa-blocking-on.sh", nil]];
|
||||
(void) res;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
- (BOOL) setDisableIPv6Off {
|
||||
[self showSpinners];
|
||||
NSString *res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-c", @"cd '" kDNSCRIPT_SCRIPTS_BASE_DIR @"' && ./create-ticket.sh && ./switch-aaaa-blocking-off.sh", nil]];
|
||||
(void) res;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
- (IBAction)dnscryptButtonPressed:(NSButton *)sender
|
||||
{
|
||||
if (sender.state != 0) {
|
||||
@@ -220,6 +240,15 @@ NSArray *resolversList;
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)disableIPv6ButtonPressed:(NSButton *)sender
|
||||
{
|
||||
if (sender.state != 0) {
|
||||
[self setDisableIPv6On];
|
||||
} else {
|
||||
[self setDisableIPv6Off];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) waitForUpdate {
|
||||
NSString *res;
|
||||
static unsigned int tries;
|
||||
|
||||
Reference in New Issue
Block a user