Permalink
Browse files

Now sets the correct initial values

original bzr status:
revno: 66
committer: Archimedes Trajano <developer@trajano.net>
branch nick: InsomniaT
timestamp: Wed 2010-06-09 16:02:06 -0400
  • Loading branch information...
1 parent 4b87efa commit 9d0c994e4aeb476c4bd119f3f0971b973ce0b4f3 @trajano committed with Jun 9, 2010
Showing with 15 additions and 6 deletions.
  1. +15 −6 src/prefpane/InsomniaT/InsomniaTPref.m
@@ -29,12 +29,21 @@ - (void) mainViewDidLoad
IOConnectCallScalarMethod(connect, 3, NULL, 0, output, &count);
IOServiceClose(connect);
- [statusLevel setIntValue: 1];
- [statusLevelText setStringValue: @"InsomniaT: OnAAAA"];
- [statusLevelBlurb setTitleWithMnemonic: @"The MacBook willAAA not suspend when the lid closed."];
- [startStopButton setTitle: @"StopAAAA"];
- [startStopButtonBlurb setTitleWithMnemonic: @"Click StAAAAop to turn InsominaT off"];
- [startStopButton setEnabled: true];
+ if (output[0] != 1) {
+ [statusLevel setIntValue: 1];
+ [statusLevelText setTitleWithMnemonic: @"InsomniaT: On"];
+ [statusLevelBlurb setTitleWithMnemonic: @"The MacBook will not suspend when the lid closed."];
+ [startStopButton setTitle: @"Stop"];
+ [startStopButtonBlurb setTitleWithMnemonic: @"Click Stop to turn InsominaT off"];
+ [startStopButton setEnabled: true];
+ } else {
+ [statusLevel setIntValue: 0];
+ [statusLevelText setTitleWithMnemonic: @"InsomniaT: Off"];
+ [statusLevelBlurb setTitleWithMnemonic: @"The MacBook will suspend when the lid closed."];
+ [startStopButton setTitle: @"Start"];
+ [startStopButtonBlurb setTitleWithMnemonic: @"Click Start to turn InsominaT on"];
+ [startStopButton setEnabled: true];
+ }
} else {
return;

0 comments on commit 9d0c994

Please sign in to comment.