gharris999;334022 Wrote: 
> How about this:
> 
> Your plugin simply sets the pref:
> 
> noaction: 1
> 
> ..in srvrpowerctrl.prefs
> 
> If my plugin sees that value, it takes no action under any
> circumstances and displays a warning. On startup, assuming that kitchen
> timers don't survive between sessions, I'll clear that pref.
> 
> Would that work?

But what if there are two plugins that want to stop shutdown? Having
both set the value to 1 is easy, but neither would know if it was truly
safe to cange it back to 0 when they were done. I'd rather have two
methods I could call, perhaps

# to say I'm not idle
Plugins::SrvrPowerCtrl::Plugin::takeNoAction($mypluginName);
# to say it's OK
Plugins::SrvrPowerCtrl::Plugin::okToAct($mypluginName);

Internally, you could keep a hash, with the keys being the string
passed to those methods. okToAct() would delete a key (set its value to
undef). To see if anyone objected, you'd count the keys in your hash.

I'd also suggest declaring a public $apiVersion number so plugins could
do stuff like

if (defined($Plugins::SrvrPowerCtrl::Plugin::apiVersion)) {
Plugins::SrvrPowerCtrl::Plugin::takeNoAction($myName);
}


-- 
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

Reply via email to