|
|
@ -27,7 +27,6 @@
|
|
|
|
if (![defaults boolForKey:@"configured"])
|
|
|
|
if (![defaults boolForKey:@"configured"])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
[self initDefaults];
|
|
|
|
[self initDefaults];
|
|
|
|
[self showConfigPanel:nil];
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
[self initialize];
|
|
|
|
[self initialize];
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -87,9 +86,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
[defaults setBool:YES forKey:@"configured"];
|
|
|
|
[defaults setBool:YES forKey:@"configured"];
|
|
|
|
|
|
|
|
|
|
|
|
// sync the defaults to disk
|
|
|
|
|
|
|
|
[defaults synchronize];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Add modal alert "First launch" here...
|
|
|
|
// TODO: Add modal alert "First launch" here...
|
|
|
|
[self showConfigPanel:self];
|
|
|
|
[self showConfigPanel:self];
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -303,30 +299,19 @@
|
|
|
|
[configStateStatus startAnimation:nil];
|
|
|
|
[configStateStatus startAnimation:nil];
|
|
|
|
[configStateStatus setHidden:false];
|
|
|
|
[configStateStatus setHidden:false];
|
|
|
|
|
|
|
|
|
|
|
|
//WRTRequest *wrtr = [[WRTRequest alloc] init];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO check that the request is actually successful
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hostname = [configFieldHostname stringValue];
|
|
|
|
hostname = [configFieldHostname stringValue];
|
|
|
|
[defaults setValue:hostname forKey:@"hostname"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
port = [configFieldPort intValue];
|
|
|
|
port = [configFieldPort intValue];
|
|
|
|
[defaults setInteger:port forKey:@"port"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//NSLog(@"%d", [configFieldProtocol state]);
|
|
|
|
|
|
|
|
if ([configFieldProtocolHTTP state] == 1) {
|
|
|
|
if ([configFieldProtocolHTTP state] == 1) {
|
|
|
|
protocol = @"http";
|
|
|
|
protocol = @"http";
|
|
|
|
} else if ([configFieldProtocolHTTPS state] == 1) {
|
|
|
|
} else if ([configFieldProtocolHTTPS state] == 1) {
|
|
|
|
protocol = @"https";
|
|
|
|
protocol = @"https";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[defaults setValue:protocol forKey:@"protocol"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
refreshTime = [configFieldRefresh integerValue];
|
|
|
|
refreshTime = [configFieldRefresh integerValue];
|
|
|
|
[defaults setInteger:refreshTime forKey:@"refreshTime"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useBytes = ([configFieldUseBytes state] == 1 ? true: false);
|
|
|
|
useBytes = ([configFieldUseBytes state] == 1 ? true: false);
|
|
|
|
[defaults setBool:useBytes forKey:@"useBytes"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ([configFieldShowIcon state] == NSOffState && [defaults boolForKey:@"showMenuIcon"] == true) {
|
|
|
|
if ([configFieldShowIcon state] == NSOffState && [defaults boolForKey:@"showMenuIcon"] == true) {
|
|
|
|
[self hideMenubarIcon];
|
|
|
|
[self hideMenubarIcon];
|
|
|
@ -335,11 +320,12 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
showMenuIcon = ([configFieldShowIcon state] == 1 ? true: false);
|
|
|
|
showMenuIcon = ([configFieldShowIcon state] == 1 ? true: false);
|
|
|
|
[defaults setBool:showMenuIcon forKey:@"showMenuIcon"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[configStateStatus stopAnimation:nil];
|
|
|
|
[configStateStatus stopAnimation:nil];
|
|
|
|
[configStateStatus setHidden:true];
|
|
|
|
[configStateStatus setHidden:true];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[self writeDefaults];
|
|
|
|
|
|
|
|
|
|
|
|
[defaults synchronize];
|
|
|
|
[defaults synchronize];
|
|
|
|
|
|
|
|
|
|
|
|
[self initialize];
|
|
|
|
[self initialize];
|
|
|
|