(2014-09-14, 16:22)schumi2004 Wrote: (2014-09-14, 12:19)sven88 Wrote: (2014-09-08, 21:22)sven88 Wrote: next thing i wanna do is a simple enable/disable button at the gui settings.
i added now an gui option to enable/disable the shutdownHookCheck, which is disabled per default (f0e5f80):
i did the part of the code, where i'm looking for the value of the setting, by parsing the xml on my own.
i'm sure there already has to be an internal xbmc function with something like getValueOfSetting()
and if someone could give me hint, what xbmc function you guys are using for that, i would be very grateful and of course modifying my code to use it.
i already had a look for a function like getValueOfSetting() at the sourcecode, but didn't found what i was looking for yet and playing a little bit around with xml,
was a good exercise for me anyway (also if i will replace it with an internal xbmc function later).
patches are added to the first post.
Nice +1
For other OE users that want to try this out, these are the modified patches to make it compile successfully for OE
Note: based against commit 72b3a4ba
https://www.dropbox.com/s/gt0v95p1arcqya...s.zip?dl=0
Still have some issues with my previous script, added a sleep command in it now and removed echo messages and going to test it later today if it works now.
ok, i tested your script now and i can confirm, that it's working, while xbmc is active.
but when executed as a hook, xbmc hangs. music is still playing, but no interaction is possible.
then i edited your script a little bit to get more debug and saw, that your curl cmd hangs.
there is no answer coming from xbmc and the curl is still waiting for the response.
after killing just the curl process, the rest of the script continued and the expected actions happened.
i don't know, why there is no json answer coming, which would close the connection....so i just made a dirty workaround and added a connection timeout of 1 sec.
you could have a look for the curl debug ('additional stuff not fine transfer'), what this error is about.
maybe someone else has an idea, why this is happening, because the workaround isn't the way, how it should be done.
but i still don't get the use-case for that, why do you want do that at every shutdown?
curl debug info:
Code:
* About to connect() to 127.0.0.1 port 8080 (#0)
* Trying 127.0.0.1...
* connected
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
* Server auth using Basic with user 'xbmc'
> POST /jsonrpc HTTP/1.1
> Authorization: Basic eGJtYzp4Ym1j
> User-Agent: curl/7.26.0
> Host: 127.0.0.1:8080
> Accept: */*
> Content-Type: application/json
> Content-Length: 95
>
} [data not shown]
* upload completely sent off: 95 out of 95 bytes
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
script:
Code:
#!/bin/bash
## XBMC: Simple script to activate login window
## Configure your XBMC details here
XBMC_HOST=127.0.0.1
XBMC_PORT=8080
XBMC_USER=xbmc
XBMC_PASS=xbmc
LOG='/tmp/blub.log'
## No configuration changes needed below
function json () {
curl -vvvvv --max-time 1 -s -i -X POST --header "Content-Type: application/json" -d "$1" http://$XBMC_USER:$XBMC_PASS@$XBMC_HOST:$XBMC_PORT/jsonrpc >>$LOG 2>&1
}
echo "Activating loginscreen on $XBMC_HOST ..." > $LOG
json '{"jsonrpc": "2.0", "method": "GUI.ActivateWindow", "params": {"window":"loginscreen"}, "id": 1}'
echo -e "\ndone." >> $LOG
exit 0
(2014-09-14, 17:05)wsnipex Wrote: @sven88: CSettings::Get().XX
e.g. CSettings::Get().GetBool()
thanks, i will have a look for it.