Shutdown/Suspend function
#1
Dear developers,

First off, thanks very much for bringing in this skin to us; I see a lot of potentials. Just started using this, so bear with me with my silly question.

First thing I noticed, this skin follows the "default behavior" for the shutdown function (just like the others), which defined in the "Settings", i.e. either shutdown or suspend at any given time. What I was trying to do is to put XBMC/HTPC in the sleep/suspend mode after a certain amount of inactivity and when I press "Shutdown" button in the the shutdown menu (s on keyboard), I'd like to do a proper shutdown of the machine, like when I go to bed at night. To do that, I looked in the "DialogButtonMenu.xml" and found that 4 times XBMC.ShutDown() have been called as "Shutdown Button".
Code:
xbmc@asus: PAL16x9$ grep -n ">XBMC.ShutDown()<" DialogButtonMenu.xml
271:            <onclick>XBMC.ShutDown()</onclick>
617:            <onclick>XBMC.ShutDown()</onclick>
998:            <onclick>XBMC.ShutDown()</onclick>
1429:           <onclick>XBMC.ShutDown()</onclick>
1728:           <onclick>XBMC.ShutDown()</onclick>
Why we need the very same function four times?. What I'm trying to do is replace this line: <onclick>XBMC.ShutDown()</onclick> by <onclick>System.Exec(/usr/bin/sudo /sbin/shutdown -h now) to get a proper shutdown, whilst "idle" would trigger the "suspend". Is it possible with your skin?

My second question is: How can I add/delete item to/from the individual sub-menu on the Home screen? e.g.when on the homescreen, if I select "Music" and then pres "down arrow" on the remote, a little submenu slides down. What is the file that makes that submenu? Cheers!!
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q150 | KEF Q250c | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply
#2
There exist a XBMC.Powerdown which will turn off the computer no matter what the default action is set.

However I definatly think that there should be a powerdown button in the shutdowndialog
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#3
This will be looked into. Wink
Reply
#4
Hi MacUsers - let's see then..

MacUsers Wrote:...Why we need the very same function four times?. What I'm trying to do is replace this line: <onclick>XBMC.ShutDown()</onclick> by <onclick>System.Exec(/usr/bin/sudo /sbin/shutdown -h now) to get a proper shutdown, whilst "idle" would trigger the "suspend". Is it possible with your skin?

It's there 4 times for 4 different possible conditions you may have - involving the use of profiles or using the master lock. I'm sorry I'm not quite getting what it is you would like to do (it's early and my head hurts!) - Are you saying you can't currently shutdown the computer whilst it's idle? And that you would like an independent of settings power switch - as topfs2 has suggested?

MacUsers Wrote:My second question is: How can I add/delete item to/from the individual sub-menu on the Home screen? e.g.when on the homescreen, if I select "Music" and then pres "down arrow" on the remote, a little submenu slides down. What is the file that makes that submenu? Cheers!!

The sub-menu items are located in the Home.xml (they are at the bottom of the code within <content>...</content>)
Reply
#5
Thanks to both of you - XBMC.Powerdown worked just fine. Now I've started getting a really functioning system - proper PowerDown from the Shutdowm menu and system go to Suspend after a certain amount of inactivity.

Anyone care about replying to me second question - How can I modify the sub-menu to add/delete some item? Or maybe what file I need to edit? Really appreciate any input. cheers!!
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q150 | KEF Q250c | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply
#6
MacUsers Wrote:Anyone care about replying to me second question - How can I modify the sub-menu to add/delete some item? Or maybe what file I need to edit? Really appreciate any input. cheers!!
Well, I've figured out by myself - it's Home.xml in the 720p directory. Looking at the file structure, it seems to me that the files are are all over the places, e.g. "Shutdown Menu" is in the PAL16x9 but home screen in 720p directory, etc. Does it have to be like this way? Cheers!!
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q150 | KEF Q250c | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply
#7
Sharpe Wrote:Are you saying you can't currently shutdown the computer whilst it's idle? And that you would like an independent of settings power switch - as topfs2 has suggested?
Not exactly. what I mean is: presently the Shutdown button just follows what specifies in the System > Power Saving option for the Shutdown Function - if it's "Suspend" in there, then pressing the "Shutdown Button" (in the Shutdown Menu), just puts the computer in sleep, rather proper system shutdown. If "Shutdown" is specified instead, only then the Shutdown Button will shutdown the computer. As far as I understand, that's the default behavior of XBMC.Shutdown() function, which is actually used in the skin. Now, for example, if you you like to put your HTPC in sleep automatically after 10 mins. (or so) inactivity during the day time and want to shutdown the computer properly at night, when you go to bed, with the default/standard coding that doesn't work - the "Shutdown Button" either works as "Shutdown" or "Suspend". Using XBMC.Powerdown() function solves this issue.

Sharpe Wrote:The sub-menu items are located in the Home.xml (they are at the bottom of the code within <content>...</content>)
I haven't noticed that you already answered about Home.xml, sorry about that. But again, I see there three sets of <content>...</content> and only the last one has effects on the sub-menu. What are the other two for? Another thing, the Home.xml is the 720p directory while rest of the stuff in the PAL16x9 directory. Does it have to be like this? Cheers!!
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q150 | KEF Q250c | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply
#8
MacUsers Wrote:I haven't noticed that you already answered about Home.xml, sorry about that. But again, I see there three sets of <content>...</content> and only the last one has effects on the sub-menu. What are the other two for? Another thing, the Home.xml is the 720p directory while rest of the stuff in the PAL16x9 directory. Does it have to be like this? Cheers!!

The other <content> controls either relate to the film strip items (for the small and default size controls) or a different set of submenu controls for the different film strip options.

Re the 720p thing - It doesn't have to be like that - it just is for now. Eventually it will all be in the 720p folder when I get the time to scale everything up.

Cheers
Reply
#9
Sharpe Wrote:The sub-menu items are located in the Home.xml (they are at the bottom of the code within <content>...</content>)
I think I need some help here: I started editing the Music sub-menu to put my selected streaming radio stations in there. So, I added my "Streaming Radio" directory to the Music source; this is the sources.xml after that:
Code:
<music>
        <default pathversion="1"></default>
        <source>
            <name>Music</name>
            <path pathversion="1">/home/xbmc/Music/iTunes/iTunes Music/</path>
        </source>
        <source>
            <name>Streaming Radio</name>
            <path pathversion="1">/home/xbmc/Music/Streaming Radio/</path>
        </source>
</music>

Then I added these to the Home.xml
Code:
<item id="25">
    <description>Internet Streaming Radio</description>
    <label>Web Radio</label>
    <onclick>SetFocus(21)</onclick>                                          
    <onclick>xbmc.ActivateWindow([color=blue]MusicFiles[/color],Streaming Radio,Return)</onclick>
    <visible>Container(11).HasFocus(7)</visible>
</item>
to get one like this:

Image

Now the problem is: with this "Web Radio" opens/works just fine but if I click on Music itself (*not* the sub-menu elements) I get the very same screen in stead of my music library.

If I change it to
<onclick>xbmc.ActivateWindow(MusicLibrary,Streaming Radio,Return)</onclick>
then Music works fine but I get a nothing for "Web Radio". Any idea what am I missing? I did that very same thing in Rapier and that worked but not working for Back Row. Could you please tell me what am I doing wrong? cheers!!
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q150 | KEF Q250c | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply
#10
Sure - it's because currently the main music control content says this:

Code:
<item id="7">
    <label>2</label>
    <icon>Listen Music.png</icon>
    <thumb>Listen Music.png</thumb>
    <onclick>SetFocus(21)</onclick>
    <onclick>XBMC.ActivateWindow(MyMusic)</onclick>
    <visible>!Skin.HasSetting(Music)</visible>
</item>

It just opens up what you were last looking at - to default it to the music library you would need change the XBMC.ActivateWindow(MyMusic) line.
Reply
#11
Sharpe Wrote:It just opens up what you were last looking at - to default it to the music library you would need change the XBMC.ActivateWindow(MyMusic) line.
Thanks Sharpe for your [Live] support; you rock!!
So, what should I change it to? Like this?
xbmc.ActivateWindow(MusicLibrary,Music,Return)
Or is there any thing (env_variable??) already defined for "Music Library", other than fixing static route? Cheers!!
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q150 | KEF Q250c | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply
#12
Other than, like you say, specifying where in the library the control will take you to, there aren't any other variables I can think of. eg - this takes you to albums etc...

Code:
<onclick>xbmc.activatewindow(musiclibrary,Albums,return)</onclick>
Reply
#13
Sharpe Wrote:Other than, like you say, specifying where in the library the control will take you to, there aren't any other variables I can think of. eg - this takes you to albums etc...
hummm.........
How can I always bring up this page/menu

Image

regardless of where I were last time? Is it possible? Cheers!!
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q150 | KEF Q250c | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply
#14
Just ignore my previous question; figured out by myself: XBMC.ActivateWindow(MusicLbrary)
Cheers!!

EDIT: sorry, I was wrong; that didn't answer my previous question. So, my question is still valid.
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q150 | KEF Q250c | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply
#15
MacUsers Wrote:hummm.........
How can I always bring up this page/menu

regardless of where I were last time? Is it possible? Cheers!!

This should do it -

Code:
<onclick>xbmc.activatewindow(musiclibrary,root)</onclick>
Reply

Logout Mark Read Team Forum Stats Members Help
Shutdown/Suspend function0