Kodi Community Forum

Full Version: Modding shutdown menu i need API
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there,
i want to mod the behavior of a single voice of the main menu (shutdown section). I have an imac and i want that one voice of the shutdown menu put my display to sleep. I've choose the hibernate voice (in the night skin) because the hibernation isn't supported by mac.
I've navigated through my XBMC.app until i've find the XML files that make the skin work. I've edited the home.xml file and i can read this code:
Code:
<control type="button" id="90187">                        <include>ButtonHomeSubCommonValues</include>
    <label>13010</label>
    <onclick>Hibernate()</onclick>
</control>
What i want to know is which function i've to write in the onclick section to put my display to sleep.
Anyone can help me? It would be intresting to find also a reference about the XBMC's api, can you link me a site?
thank you
what voice are uour talking about ? you want to modify sound?
emh no... i want to modify the behavior of the hibernate menu voice in the sub menu shutdown.
If i click on hibernate it doesn't happen anything, because the doesn't hibernate itself Big Grin So i want to modify the code i've quoted in something like this:
Code:
<control type="button" id="90187">                        <include>ButtonHomeSubCommonValues</include>
    <label>13010</label>
    <onclick>SleepDisplayFunction()</onclick>
</control>
But i don't know the correct SleepDisplayFunction.
I hope that i've explained clearly my idea Big Grin
Shutdown()?

but i still don't understand why you are talking about voice !
Try "ToggleDPMS()".
@ppics With menu voice i want to mean a single line of a menu (i don't know if is the correct english translation of the italian "voce di menu", but i think so Big Grin). Shutdown() makes the Imac shutting down ^^

@vdrfan
Thanks, now i try.

EDIT:
Very very thanks to vdrfan ^^ Your suggestion is right!!! Can i ask you where you find the api used by XMBC?
ok, i thought you want to shutdown, sorry Sad

good you find
Don't worry ppic, thank you for trying to help me.
Now i want to go to the next step: rename Hibernate in Display Sleep. I'm searching the label 13010 in the string.xml, but i can't find it there... Is there another place where to search it?
Most of the current Bult-ins are documented in the wiki. http://wiki.xbmc.org/?title=List_of_Built_In_Functions.

For a complete list you could always check the source code (http://trac.xbmc.org/browser/trunk/xbmc/...iltins.cpp - Line 100+).
Uhm, 13010 is in strings.xml. Search for '<string id="13010">'.
Ok, i've found it. I was searching in the string.xml of the night skin... thank you another time ^^
hey guys this is exactly what i'm needing to do since my XBMC box is also a general server.

i was just wondering was this a source code edit? or am i just missing what file needs to be edited?
c8a7w Wrote:hey guys this is exactly what i'm needing to do since my XBMC box is also a general server.

i was just wondering was this a source code edit? or am i just missing what file needs to be edited?

I don' understand the question. Anyway i'try: this is only an editing of a configuration file, you don't edit any source code.