PDA

View Full Version : Getting a value from guisettings.xml


gregwa
May 11th, 2009, 11:58 AM
I'm trying to find a way to get a value from the guisettings.xml file. Specifically, the <weather><areacode1> value.

I'm sure there's a way, but everything I see in the developer docs seem to be for the application level, not the boxee level.

Thanks in advance.

ameno
May 11th, 2009, 12:33 PM
On the Boxee level (if you mean within the Boxee xml tags), the easiest way I have found to do this is, first, in your rss, put:

<boxee:property name="custom1">Here is my arbitrary string</boxee:property>

(that's not a smiley face, that's a : and a p)

then, in your app xml, put this code

<label>$INFO[Container(111).ListItem.property(custom1)]</label>

That would be, for example, the custom1 value for the currently selected ListItem in the Container with id 111.

Does that help?

gregwa
May 11th, 2009, 03:55 PM
I don't think so. In guisettings.xml, there is an element named weather and a subelement called zipcode1. This holds the city/state that you want the weather icon on the menu to use to display the information.

I need that value to be able to grab weather data without having to ask the user (again) for the city/state info.

gregwa
May 14th, 2009, 09:04 AM
Still looking for help on this one.

Anyone?

gregwa
June 1st, 2009, 08:22 AM
Thanks to DPK's weather channel app, I was able to get this to work.

So for all the people looking for this same answer here it his code...

bxe_mcc = mc.GetApp().GetLocalConfig()
location = xbmc.executehttpapi("getguisetting(3,weather.areacode1)").replace( "<li>", "" ).split(" - ")[1]

Thanks DPK!!!!!!!!!!!!!!!!!!!!!!

DPK
June 1st, 2009, 10:42 AM
Lol, no problem. It took me forever to figure out how to grab that data as it's so obscure and relative to xbmc. Sorry I missed this thread earlier when you originally asked the question.

Your reasoning is the same as mine for my Weather Channel app. I didn't want to annoy the user with a prompt asking them to input their location again.

gregwa
June 1st, 2009, 04:07 PM
Thanks again.

I'll have mine up soon.

Not as nice as yours, but it seems to work.