gharris999;334045 Wrote:
> Actually, if the 'blocking' plugins were well behaved, they could just
> increment and decrement the blockaction pref.
True!
My way is something like:
Code:
--------------------
$Plugins::SrvrPowerCtrl::Plugin::apiVersion = 1.0;
my %blockHash;
sub takeNoAction($) {
my $name = shift;
$blockHash{$name} = $name;
}
sub okToAct($) {
my $name = shift;
$blockHash{$name} = undef;
}
sub somethingIsBlocking {
foreach my $plugin (keys $blockHash) {
if ( defined($blockHash{$plugin}) ) {
$log->info("not shutting down, asked by $blockHash{$plugin} not to");
return 1;
}
}
return 0;
}
--------------------
--
peterw
http://www.tux.org/~peterw/
free plugins: http://www.tux.org/~peterw/#slim
AllQuiet BlankSaver ContextMenu FuzzyTime PlayLog
PowerCenter/BottleRocket
SaverSwitcher SettingsManager SleepFade StatusFirst SyncOptions
VolumeLock
------------------------------------------------------------------------
peterw's Profile: http://forums.slimdevices.com/member.php?userid=2107
View this thread: http://forums.slimdevices.com/showthread.php?t=48521
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins