home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2011 November
/
CHIP_2011_11.iso
/
Programy
/
Narzedzia
/
AIMP2
/
aimp_2.61.583.exe
/
$TEMP
/
YandexPackSetup.msi
/
filA46E0E1D5268F9DD8D468F3D69F1CDCD
< prev
next >
Wrap
Extensible Markup Language
|
2010-07-12
|
22KB
|
506 lines
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE widget SYSTEM "town.dtd">
<widget icon="icons/weather.png" name="&wgt.town.widget.name;" unique="false" xmlns="http://bar.yandex.ru/dev/gui" xmlns:f="http://bar.yandex.ru/dev/functional">
<f:setting name="id" scope="instance">
<control label="&wgt.town.setting.town;:" source="geobase.xml" template="geobase.xsl" type="combobox"/>
</f:setting>
<f:setting name="title" scope="instance">
<control label="&wgt.town.setting.title;:" type="textedit"/>
</f:setting>
<f:setting default="true" name="show-weather" scope="instance">
<control label="&wgt.town.setting.show.weather;" type="checkbox"/>
</f:setting>
<f:setting default="true" name="show-traffic" scope="instance">
<control label="&wgt.town.setting.show.traffic;" type="checkbox"/>
</f:setting>
<f:setting default="5" name="update-interval" scope="widget">
<control label="&wgt.town.setting.interval;:" label-after="&wgt.town.settings.min.label;" max="1000" min="0" spin="5" type="textedit" value-type="int"/>
</f:setting>
<f:variable name="update-id" scope="instance"/>
<f:variable name="throbber-end-time" scope="instance"/>
<f:data name="info-request">
<f:request>
<f:param name="url">
<f:concat>
<f:value type="string">http://export.yandex.ru/bar/reginfo.xml?region=</f:value>
<f:value-of name="id"/>
</f:concat>
</f:param>
<f:param name="update">
<f:mul>
<f:value-of name="update-interval"/>
<f:value type="number">60</f:value>
</f:mul>
</f:param>
<f:param name="expire">
<f:value type="number">3600</f:value>
</f:param>
</f:request>
</f:data>
<f:data name="info">
<f:content>
<f:value-of name="info-request"/>
</f:content>
</f:data>
<f:data name="town-name">
<f:try>
<f:xpath>
<f:value type="string">string(info/region/title)</f:value>
<f:value-of name="info"/>
</f:xpath>
<f:param name="...">
<f:value type="empty"/>
</f:param>
</f:try>
</f:data>
<f:data name="weather-info">
<f:try>
<f:xpath>
<f:value type="string">info/weather</f:value>
<f:value-of name="info"/>
</f:xpath>
<f:param name="...">
<f:value type="empty"/>
</f:param>
</f:try>
</f:data>
<f:data name="weather-url">
<f:try>
<f:xpath>
<f:value type="string">string(info/weather/url)</f:value>
<f:value-of name="info"/>
</f:xpath>
<f:param name="...">
<f:value type="empty"/>
</f:param>
</f:try>
</f:data>
<f:data name="temperature">
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/weather/day/day_part/temperature)</f:value>
</f:xpath>
</f:data>
<f:data name="traffic">
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/traffic/level)</f:value>
</f:xpath>
</f:data>
<f:data name="weather-icon-from-info">
<f:xpath>
<f:param name="source">
<f:file>
<f:param name="type">
<f:value type="string">xml</f:value>
</f:param>
<f:param name="path">
<f:value type="string">weather/convert.xml</f:value>
</f:param>
</f:file>
</f:param>
<f:concat>
<f:value type="string">string(//convert[@from='</f:value>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/weather/day/day_part/image)</f:value>
</f:xpath>
<f:value type="string">']/@to)</f:value>
</f:concat>
</f:xpath>
</f:data>
<f:data name="weather-icon">
<f:try>
<f:if>
<f:equal>
<f:value-of name="weather-icon-from-info"/>
<f:value type="string"/>
</f:equal>
<f:throw/>
<f:value-of name="weather-icon-from-info"/>
</f:if>
<f:param name="...">
<f:value type="string">icons/weather.png</f:value>
</f:param>
</f:try>
</f:data>
<f:data name="traffic-icon">
<f:concat>
<f:value type="string">traffic/</f:value>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/traffic/icon)</f:value>
</f:xpath>
<f:value type="string">.png</f:value>
</f:concat>
</f:data>
<f:data name="hide-throbber">
<f:or>
<f:is-empty>
<f:value-of name="update-id"/>
</f:is-empty>
<f:and>
<f:finished>
<f:value-of name="update-id"/>
</f:finished>
<f:time-arrived>
<f:value-of name="throbber-end-time"/>
</f:time-arrived>
</f:and>
</f:or>
</f:data>
<button>
<text>
<f:coalesce>
<f:value-of name="title"/>
<f:value-of name="town-name"/>
<f:value type="string">&wgt.town.widget.name;</f:value>
</f:coalesce>
</text>
<tooltip>&wgt.town.setup;</tooltip>
<menu>
<menuitem>
<text>&wgt.town.refresh;</text>
<action>
<f:assign name="update-id">
<f:update>
<f:value-of name="info-request"/>
</f:update>
</f:assign>
<f:assign name="throbber-end-time">
<f:add>
<f:timestamp/>
<f:value type="number">1.5</f:value>
</f:add>
</f:assign>
</action>
</menuitem>
<separator/>
<menuitem>
<text>&wgt.town.setup;</text>
<action>
<f:setup-widget/>
</action>
</menuitem>
<menuitem>
<text>&wgt.town.delete;</text>
<action>
<f:remove-widget/>
</action>
</menuitem>
<menuitem>
<text>&wgt.town.add;</text>
<action>
<f:add-widget/>
</action>
</menuitem>
</menu>
</button>
<f:optional>
<f:value-of name="show-weather"/>
<button>
<icon>
<f:if>
<f:value-of name="hide-throbber"/>
<f:if>
<f:is-empty>
<f:value-of name="info"/>
</f:is-empty>
<f:value type="string">icons/weather.png</f:value>
<f:value-of name="weather-icon"/>
</f:if>
<f:value type="string">xb://toolkit/images/throbber.gif</f:value>
</f:if>
</icon>
<text>
<f:value-of name="temperature"/>
</text>
<url action="2200">
<f:coalesce>
<f:value-of name="weather-url"/>
<f:value type="string">http://weather.yandex.ru</f:value>
</f:coalesce>
</url>
<f:optional>
<f:is-empty>
<f:value-of name="weather-info"/>
</f:is-empty>
<tooltip>&wgt.town.weather.nodata;</tooltip>
</f:optional>
<f:optional>
<f:not>
<f:is-empty>
<f:value-of name="weather-info"/>
</f:is-empty>
</f:not>
<tooltip>
<grid>
<column h-align="right"/>
<row>
<cell h-align="left">
<icon>
<f:value-of name="weather-icon"/>
</icon>
</cell>
<cell h-align="center">
<style font-weight="bold">
<f:concat>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/weather/day/country)</f:value>
</f:xpath>
<f:value type="string">, </f:value>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/weather/day/title)</f:value>
</f:xpath>
</f:concat>
</style>
</cell>
<cell merge-left="true"/>
</row>
<row>
<cell>&wgt.town.weather.label;:</cell>
<cell merge-left="true"/>
<cell>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/weather/day/day_part/weather_type)</f:value>
</f:xpath>
</cell>
</row>
<row>
<cell>&wgt.town.temperature.label;:</cell>
<cell merge-left="true"/>
<cell>
<f:concat>
<f:value-of name="temperature"/>
<f:value type="string"> ºC</f:value>
</f:concat>
</cell>
</row>
<row>
<cell>&wgt.town.wind.label;:</cell>
<cell merge-left="true"/>
<cell>
<f:concat>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/weather/day/day_part/wind_direction)</f:value>
</f:xpath>
<f:value type="string">, </f:value>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/weather/day/day_part/wind_speed)</f:value>
</f:xpath>
<f:value type="string"> &wgt.town.wind.ms;</f:value>
</f:concat>
</cell>
</row>
<row>
<cell>&wgt.town.pressure.label;:</cell>
<cell merge-left="true"/>
<cell>
<f:concat>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/weather/day/day_part/pressure)</f:value>
</f:xpath>
<f:value type="string"> &wgt.town.pressure.mm.label;</f:value>
</f:concat>
</cell>
</row>
<row>
<cell>&wgt.town.dampness.label;:</cell>
<cell merge-left="true"/>
<cell>
<f:concat>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/weather/day/day_part/dampness)</f:value>
</f:xpath>
<f:value type="string"> %</f:value>
</f:concat>
</cell>
</row>
<f:optional>
<f:not>
<f:is-empty>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">info/weather/tonight/temperature</f:value>
</f:xpath>
</f:is-empty>
</f:not>
<row>
<cell>&wgt.town.night;:</cell>
<cell merge-left="true"/>
<cell>
<f:concat>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/weather/tonight/temperature)</f:value>
</f:xpath>
<f:value type="string"> ºC</f:value>
</f:concat>
</cell>
</row>
</f:optional>
<f:optional>
<f:not>
<f:is-empty>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">info/weather/tomorrow/temperature</f:value>
</f:xpath>
</f:is-empty>
</f:not>
<row>
<cell>&wgt.town.tomorrow;:</cell>
<cell merge-left="true"/>
<cell>
<f:concat>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/weather/tomorrow/temperature)</f:value>
</f:xpath>
<f:value type="string"> ºC</f:value>
</f:concat>
</cell>
</row>
</f:optional>
</grid>
</tooltip>
</f:optional>
</button>
</f:optional>
<f:optional>
<f:and>
<f:value-of name="show-traffic"/>
<f:not>
<f:is-empty>
<f:xpath>
<f:value type="string">info/traffic</f:value>
<f:value-of name="info"/>
</f:xpath>
</f:is-empty>
</f:not>
</f:and>
<button>
<icon>
<f:if>
<f:value-of name="hide-throbber"/>
<f:value-of name="traffic-icon"/>
<f:value type="string">xb://toolkit/images/throbber.gif</f:value>
</f:if>
</icon>
<text>
<f:value-of name="traffic"/>
</text>
<url action="710">
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/traffic/url)</f:value>
</f:xpath>
</url>
<tooltip>
<grid>
<column h-align="right"/>
<row>
<cell h-align="left">
<icon>
<f:value-of name="traffic-icon"/>
</icon>
</cell>
<cell h-align="center">
<style font-weight="bold">
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/traffic/title)</f:value>
</f:xpath>
</style>
</cell>
<cell merge-left="true"/>
</row>
<row>
<cell>&wgt.town.traffic.points;:</cell>
<cell merge-left="true"/>
<cell>
<f:value-of name="traffic"/>
</cell>
</row>
<row>
<cell>&wgt.town.traffic.description;:</cell>
<cell merge-left="true"/>
<cell>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">string(info/traffic/hint)</f:value>
</f:xpath>
</cell>
</row>
<row>
<cell>&wgt.town.traffic.length;:</cell>
<cell merge-left="true"/>
<cell>
<f:concat>
<f:format-number>
<f:div>
<f:xpath>
<f:param name="source">
<f:value-of name="info"/>
</f:param>
<f:value type="string">number(info/traffic/length)</f:value>
</f:xpath>
<f:value type="number">1000</f:value>
</f:div>
<f:param name="precision">
<f:value type="number">1</f:value>
</f:param>
</f:format-number>
<f:value type="string"> &wgt.town.traffic.length.km;</f:value>
</f:concat>
</cell>
</row>
</grid>
</tooltip>
</button>
</f:optional>
</widget>