From 901537f8d5f37b2a28063feade92866097746312 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 25 Sep 2012 23:10:16 +0200 Subject: [PATCH] Enable "View log" button. --- DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h | 3 +++ DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m | 4 ++++ .../DNSCrypt/en.lproj/DNSCrypt.xib | 13 +++++++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h index debe3ec..7b2e126 100644 --- a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h +++ b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h @@ -18,6 +18,8 @@ #define kDNSCRYPT_VAR_BASE_DIR @"/Library/Application Support/DNSCrypt" #define kDNSCRYPT_CONTROL_DIR kDNSCRYPT_VAR_BASE_DIR @"/control" +#define kDNSCRYPT_QUERY_LOG_FILE "/var/log/dnscrypt-query.log" + #define kOPENDNS_URL @"http://www.opendns.com" #define kBUNDLE_IDENTIFIER @"com.opendns.osx.DNSCrypt" @@ -65,5 +67,6 @@ typedef enum { - (IBAction)staticResolversTextFieldChanged:(NSTextField *)sender; - (IBAction)parentalControlsButtonPressed:(NSButtonCell *)sender; - (IBAction)queryLoggingButtonPressed:(NSButtonCell *)sender; +- (IBAction)viewLogButtonPushed:(NSButton *)sender; @end diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m index f111f2a..803ed02 100644 --- a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m +++ b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m @@ -423,4 +423,8 @@ DNSConfigurationState currentState = kDNS_CONFIGURATION_UNKNOWN; } } +- (IBAction)viewLogButtonPushed:(NSButton *)sender { + [self fromCommand: @"/bin/ksh" withArguments: [NSArray arrayWithObjects: @"-c", @"open /Applications/Utilities/Console.app " kDNSCRYPT_QUERY_LOG_FILE " || open " kDNSCRYPT_QUERY_LOG_FILE, nil]]; +} + @end diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/en.lproj/DNSCrypt.xib b/DNSCrypt-Preference-Pane/DNSCrypt/en.lproj/DNSCrypt.xib index a90e413..2751b32 100644 --- a/DNSCrypt-Preference-Pane/DNSCrypt/en.lproj/DNSCrypt.xib +++ b/DNSCrypt-Preference-Pane/DNSCrypt/en.lproj/DNSCrypt.xib @@ -1368,11 +1368,11 @@ aW91cy5leGFtcGxlLm5ldA - queryLoggingButtonPressed: + viewLogButtonPushed: - + - 439 + 441 @@ -2093,7 +2093,7 @@ aW91cy5leGFtcGxlLm5ldA - 439 + 441 @@ -2110,6 +2110,7 @@ aW91cy5leGFtcGxlLm5ldA NSButtonCell NSTextField NSButton + NSButton @@ -2148,6 +2149,10 @@ aW91cy5leGFtcGxlLm5ldA uninstallPushed: NSButton + + viewLogButtonPushed: + NSButton + NSTabViewItem