refine the sleep option's text a little
This commit is contained in:
parent
c443e88444
commit
bcfaf3c56d
|
@ -3035,7 +3035,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
{
|
{
|
||||||
NSEnumerator * enumerator;
|
NSEnumerator * enumerator;
|
||||||
Torrent * torrent;
|
Torrent * torrent;
|
||||||
BOOL active, canSleep;
|
BOOL active, allowSleep;
|
||||||
|
|
||||||
switch (messageType)
|
switch (messageType)
|
||||||
{
|
{
|
||||||
|
@ -3060,20 +3060,20 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
|
|
||||||
case kIOMessageCanSystemSleep:
|
case kIOMessageCanSystemSleep:
|
||||||
|
|
||||||
canSleep = YES;
|
allowSleep = YES;
|
||||||
if ([fDefaults boolForKey: @"SleepPrevent"])
|
if ([fDefaults boolForKey: @"SleepPrevent"])
|
||||||
{
|
{
|
||||||
//prevent idle sleep unless all inactive
|
//prevent idle sleep unless no torrents are active
|
||||||
enumerator = [fTorrents objectEnumerator];
|
enumerator = [fTorrents objectEnumerator];
|
||||||
while ((torrent = [enumerator nextObject]))
|
while ((torrent = [enumerator nextObject]))
|
||||||
if ([torrent isActive] && ![torrent isStalled] && ![torrent isError])
|
if ([torrent isActive] && ![torrent isStalled] && ![torrent isError])
|
||||||
{
|
{
|
||||||
canSleep = NO;
|
allowSleep = NO;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canSleep)
|
if (allowSleep)
|
||||||
IOAllowPowerChange(fRootPort, (long) messageArgument);
|
IOAllowPowerChange(fRootPort, (long) messageArgument);
|
||||||
else
|
else
|
||||||
IOCancelPowerChange(fRootPort, (long) messageArgument);
|
IOCancelPowerChange(fRootPort, (long) messageArgument);
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
<key>IBEditorPositions</key>
|
<key>IBEditorPositions</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>153</key>
|
<key>153</key>
|
||||||
<string>558 568 583 268 0 0 1680 1028 </string>
|
<string>548 568 583 268 0 0 1680 1028 </string>
|
||||||
<key>28</key>
|
<key>28</key>
|
||||||
<string>558 511 583 348 0 0 1680 1028 </string>
|
<string>558 528 563 348 0 0 1680 1028 </string>
|
||||||
<key>41</key>
|
<key>41</key>
|
||||||
<string>548 550 583 305 0 0 1680 1028 </string>
|
<string>569 482 583 305 0 0 1680 1028 </string>
|
||||||
<key>66</key>
|
<key>66</key>
|
||||||
<string>334 527 583 144 0 0 1680 1028 </string>
|
<string>548 630 583 144 0 0 1680 1028 </string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>IBFramework Version</key>
|
<key>IBFramework Version</key>
|
||||||
<string>446.1</string>
|
<string>446.1</string>
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
</array>
|
</array>
|
||||||
<key>IBOpenObjects</key>
|
<key>IBOpenObjects</key>
|
||||||
<array>
|
<array>
|
||||||
<integer>153</integer>
|
<integer>28</integer>
|
||||||
</array>
|
</array>
|
||||||
<key>IBSystem Version</key>
|
<key>IBSystem Version</key>
|
||||||
<string>8R4031</string>
|
<string>8R4031</string>
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue