Shutdown timer via a button
#1
I have a shutdown option on Home couple people have asked for a shutdown timer as a submenu.

I didn't see that option in any other skins, and by the looks of it, closest I can come it to activate SettingsCategory.xml, is that correct?
Image

Check out The Carmichael - A Skin For XBMC

Check out Night - A Skin For XBMC

Check out Unfinished - A Skin For XBMC
Reply
#2
is this what you're looking for?
Code:
<onclick>AlarmClock(shutdowntimer,Shutdown())</onclick>
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Thx as always...
Image

Check out The Carmichael - A Skin For XBMC

Check out Night - A Skin For XBMC

Check out Unfinished - A Skin For XBMC
Reply
#4
no worries, the code can be found in DialogButtonMenu.xml

in case you also want an option to reset the shutdown timer:
Code:
<onclick>CancelAlarm(ShutdownTimer)</onclick>

also, i seem to remember the extra brackets are not needed, so you might as well use:
Code:
<onclick>AlarmClock(shutdowntimer,Shutdown)</onclick>
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
Thx again...To take it one step farther could a visible be set for the cancel button? Like:

<visible>alarm clock is set</visible>
Image

Check out The Carmichael - A Skin For XBMC

Check out Night - A Skin For XBMC

Check out Unfinished - A Skin For XBMC
Reply
#6
yup:
<visible>System.HasAlarm(ShutdownTimer)</visible>
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#7
ronie Wrote:no worries, the code can be found in DialogButtonMenu.xml
.......

And then there is always http://wiki.xbmc.org/?title=List_of_Built_In_Functions

Quote:AlarmClock(name,command,time[,silent]) Pops up a dialog asking for the length of time for the alarm (unless the parameter time is specified), and starts a timer. When the timer runs out, it'll execute the built-in command (the parameter command) if it is specified, otherwise it'll pop up an alarm notice. Set silent to true to hide the alarm notification.

Quote:CancelAlarm(name) Cancel a running alarm

and http://wiki.xbmc.org/?title=List_of_Boolean_Conditions
Quote:System.HasAlarm(alarm) Returns true if the system has the ?alarm? alarm set.
and
Quote:System.AlarmLessOrEqual(alarmname,seconds) Returns true if the alarm with ?alarmname? has less or equal to ?seconds? left. Standard use would be system.alarmlessorequal(shutdowntimer,119), which would return true when the shutdowntimer has less then 2 minutes left.
Reply

Logout Mark Read Team Forum Stats Members Help
Shutdown timer via a button0