Cleaning...

This commit is contained in:
Frank Denis
2012-07-31 22:20:31 -07:00
parent edcf64910d
commit 66e8e84187
2 changed files with 28 additions and 7 deletions
+4 -3
View File
@@ -31,13 +31,14 @@ typedef enum {
AuthorizationRef auth;
}
@property (weak) IBOutlet NSButton *enableOpenDNSButton;
@property (weak) IBOutlet NSButton *enableDNSCryptButton;
@property (weak) IBOutlet NSTextField *currentResolverTextField;
@property (weak) IBOutlet NSButton *enableOpenDNSButton;
@property (weak) IBOutlet NSButton *familyShieldButton;
@property (weak) IBOutlet NSButton *enableInsecureDNSButton;
@property (weak) IBOutlet NSTextField *currentResolverTextField;
@property (weak) IBOutlet NSImageView *statusImageView;
@property (weak) IBOutlet NSTextField *statusText;
@property (weak) IBOutlet NSButton *useHTTPSButton;
@property (weak) IBOutlet WebView *previewNotesWebView;
@property (weak) IBOutlet WebView *releaseNotesWebView;
@property (weak) IBOutlet WebView *feedbackWebView;
+24 -4
View File
@@ -14,16 +14,38 @@
@synthesize feedbackWebView;
@synthesize aboutWebView;
@synthesize enableOpenDNSButton;
@synthesize enableDNSCryptButton;
@synthesize enableOpenDNSButton;
@synthesize enableInsecureDNSButton;
@synthesize familyShieldButton;
@synthesize statusImageView;
@synthesize statusText;
@synthesize useHTTPSButton;
@synthesize currentResolverTextField;
DNSConfigurationState currentState = kDNS_CONFIGURATION_UNKNOWN;
- (NSString *) fromCommand: (NSString *) launchPath withArguments: (NSArray *) arguments
{
NSPipe *pipe = [NSPipe pipe];
NSTask *task = [[NSTask alloc] init];
NSData *data;
NSString *result;
task.launchPath = launchPath;
task.arguments = arguments;
task.standardOutput = pipe;
[task launch];
data = [[pipe fileHandleForReading] readDataToEndOfFile];
[task waitUntilExit];
[task release];
result = [[[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding] autorelease];
if ([result hasSuffix: @"\n"]) {
result = [result substringToIndex: result.length - 1];
}
return result;
}
- (void) initializeCheckBoxesWithState: (DNSConfigurationState) currentState
{
switch (currentState) {
@@ -182,7 +204,6 @@ DNSConfigurationState currentState = kDNS_CONFIGURATION_UNKNOWN;
{
if (sender.state == NSOffState && enableDNSCryptButton.state != NSOffState) {
enableDNSCryptButton.state = NSOffState;
useHTTPSButton.state = NSOffState;
}
[self updateConfig];
}
@@ -192,7 +213,6 @@ DNSConfigurationState currentState = kDNS_CONFIGURATION_UNKNOWN;
if (sender.state == NSOnState && enableOpenDNSButton.state != NSOnState) {
enableOpenDNSButton.state = NSOnState;
} else if (sender.state == NSOffState) {
useHTTPSButton.state = NSOffState;
}
[self updateConfig];
}