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 >
Extensible Markup Language  |  2010-07-12  |  22KB  |  506 lines

  1. ∩╗┐<?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE widget SYSTEM "town.dtd">
  3. <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">
  4.     <f:setting name="id" scope="instance">
  5.         <control label="&wgt.town.setting.town;:" source="geobase.xml" template="geobase.xsl" type="combobox"/>
  6.     </f:setting>
  7.     <f:setting name="title" scope="instance">
  8.         <control label="&wgt.town.setting.title;:" type="textedit"/>
  9.     </f:setting>
  10.     <f:setting default="true" name="show-weather" scope="instance">
  11.         <control label="&wgt.town.setting.show.weather;" type="checkbox"/>
  12.     </f:setting>
  13.     <f:setting default="true" name="show-traffic" scope="instance">
  14.         <control label="&wgt.town.setting.show.traffic;" type="checkbox"/>
  15.     </f:setting>
  16.     <f:setting default="5" name="update-interval" scope="widget">
  17.         <control label="&wgt.town.setting.interval;:" label-after="&wgt.town.settings.min.label;" max="1000" min="0" spin="5" type="textedit" value-type="int"/>
  18.     </f:setting>
  19.     <f:variable name="update-id" scope="instance"/>
  20.     <f:variable name="throbber-end-time" scope="instance"/>
  21.     <f:data name="info-request">
  22.         <f:request>
  23.             <f:param name="url">
  24.                 <f:concat>
  25.                     <f:value type="string">http://export.yandex.ru/bar/reginfo.xml?region=</f:value>
  26.                     <f:value-of name="id"/>
  27.                 </f:concat>
  28.             </f:param>
  29.             <f:param name="update">
  30.                 <f:mul>
  31.                     <f:value-of name="update-interval"/>
  32.                     <f:value type="number">60</f:value>
  33.                 </f:mul>
  34.             </f:param>
  35.             <f:param name="expire">
  36.                 <f:value type="number">3600</f:value>
  37.             </f:param>
  38.         </f:request>
  39.     </f:data>
  40.     <f:data name="info">
  41.         <f:content>
  42.             <f:value-of name="info-request"/>
  43.         </f:content>
  44.     </f:data>
  45.     <f:data name="town-name">
  46.         <f:try>
  47.             <f:xpath>
  48.                 <f:value type="string">string(info/region/title)</f:value>
  49.                 <f:value-of name="info"/>
  50.             </f:xpath>
  51.             <f:param name="...">
  52.                 <f:value type="empty"/>
  53.             </f:param>
  54.         </f:try>
  55.     </f:data>
  56.     <f:data name="weather-info">
  57.         <f:try>
  58.             <f:xpath>
  59.                 <f:value type="string">info/weather</f:value>
  60.                 <f:value-of name="info"/>
  61.             </f:xpath>
  62.             <f:param name="...">
  63.                 <f:value type="empty"/>
  64.             </f:param>
  65.         </f:try>
  66.     </f:data>
  67.     <f:data name="weather-url">
  68.         <f:try>
  69.             <f:xpath>
  70.                 <f:value type="string">string(info/weather/url)</f:value>
  71.                 <f:value-of name="info"/>
  72.             </f:xpath>
  73.             <f:param name="...">
  74.                 <f:value type="empty"/>
  75.             </f:param>
  76.         </f:try>
  77.     </f:data>
  78.     <f:data name="temperature">
  79.         <f:xpath>
  80.             <f:param name="source">
  81.                 <f:value-of name="info"/>
  82.             </f:param>
  83.             <f:value type="string">string(info/weather/day/day_part/temperature)</f:value>
  84.         </f:xpath>
  85.     </f:data>
  86.     <f:data name="traffic">
  87.         <f:xpath>
  88.             <f:param name="source">
  89.                 <f:value-of name="info"/>
  90.             </f:param>
  91.             <f:value type="string">string(info/traffic/level)</f:value>
  92.         </f:xpath>
  93.     </f:data>
  94.     <f:data name="weather-icon-from-info">
  95.         <f:xpath>
  96.             <f:param name="source">
  97.                 <f:file>
  98.                     <f:param name="type">
  99.                         <f:value type="string">xml</f:value>
  100.                     </f:param>
  101.                     <f:param name="path">
  102.                         <f:value type="string">weather/convert.xml</f:value>
  103.                     </f:param>
  104.                 </f:file>
  105.             </f:param>
  106.             <f:concat>
  107.                 <f:value type="string">string(//convert[@from='</f:value>
  108.                 <f:xpath>
  109.                     <f:param name="source">
  110.                         <f:value-of name="info"/>
  111.                     </f:param>
  112.                     <f:value type="string">string(info/weather/day/day_part/image)</f:value>
  113.                 </f:xpath>
  114.                 <f:value type="string">']/@to)</f:value>
  115.             </f:concat>
  116.         </f:xpath>
  117.     </f:data>
  118.     <f:data name="weather-icon">
  119.         <f:try>
  120.             <f:if>
  121.                 <f:equal>
  122.                     <f:value-of name="weather-icon-from-info"/>
  123.                     <f:value type="string"/>
  124.                 </f:equal>
  125.                 <f:throw/>
  126.                 <f:value-of name="weather-icon-from-info"/>
  127.             </f:if>
  128.             <f:param name="...">
  129.                 <f:value type="string">icons/weather.png</f:value>
  130.             </f:param>
  131.         </f:try>
  132.     </f:data>
  133.     <f:data name="traffic-icon">
  134.         <f:concat>
  135.             <f:value type="string">traffic/</f:value>
  136.             <f:xpath>
  137.                 <f:param name="source">
  138.                     <f:value-of name="info"/>
  139.                 </f:param>
  140.                 <f:value type="string">string(info/traffic/icon)</f:value>
  141.             </f:xpath>
  142.             <f:value type="string">.png</f:value>
  143.         </f:concat>
  144.     </f:data>
  145.     <f:data name="hide-throbber">
  146.         <f:or>
  147.             <f:is-empty>
  148.                 <f:value-of name="update-id"/>
  149.             </f:is-empty>
  150.             <f:and>
  151.                 <f:finished>
  152.                     <f:value-of name="update-id"/>
  153.                 </f:finished>
  154.                 <f:time-arrived>
  155.                     <f:value-of name="throbber-end-time"/>
  156.                 </f:time-arrived>
  157.             </f:and>
  158.         </f:or>
  159.     </f:data>
  160.     <button>
  161.         <text>
  162.             <f:coalesce>
  163.                 <f:value-of name="title"/>
  164.                 <f:value-of name="town-name"/>
  165.                 <f:value type="string">&wgt.town.widget.name;</f:value>
  166.             </f:coalesce>
  167.         </text>
  168.         <tooltip>&wgt.town.setup;</tooltip>
  169.         <menu>
  170.             <menuitem>
  171.                 <text>&wgt.town.refresh;</text>
  172.                 <action>
  173.                     <f:assign name="update-id">
  174.                         <f:update>
  175.                             <f:value-of name="info-request"/>
  176.                         </f:update>
  177.                     </f:assign>
  178.                     <f:assign name="throbber-end-time">
  179.                         <f:add>
  180.                             <f:timestamp/>
  181.                             <f:value type="number">1.5</f:value>
  182.                         </f:add>
  183.                     </f:assign>
  184.                 </action>
  185.             </menuitem>
  186.             <separator/>
  187.             <menuitem>
  188.                 <text>&wgt.town.setup;</text>
  189.                 <action>
  190.                     <f:setup-widget/>
  191.                 </action>
  192.             </menuitem>
  193.             <menuitem>
  194.                 <text>&wgt.town.delete;</text>
  195.                 <action>
  196.                     <f:remove-widget/>
  197.                 </action>
  198.             </menuitem>
  199.             <menuitem>
  200.                 <text>&wgt.town.add;</text>
  201.                 <action>
  202.                     <f:add-widget/>
  203.                 </action>
  204.             </menuitem>
  205.         </menu>
  206.     </button>
  207.     <f:optional>
  208.         <f:value-of name="show-weather"/>
  209.         <button>
  210.             <icon>
  211.                 <f:if>
  212.                     <f:value-of name="hide-throbber"/>
  213.                     <f:if>
  214.                         <f:is-empty>
  215.                             <f:value-of name="info"/>
  216.                         </f:is-empty>
  217.                         <f:value type="string">icons/weather.png</f:value>
  218.                         <f:value-of name="weather-icon"/>
  219.                     </f:if>
  220.                     <f:value type="string">xb://toolkit/images/throbber.gif</f:value>
  221.                 </f:if>
  222.             </icon>
  223.             <text>
  224.                 <f:value-of name="temperature"/>
  225.             </text>
  226.             <url action="2200">
  227.                 <f:coalesce>
  228.                     <f:value-of name="weather-url"/>
  229.                     <f:value type="string">http://weather.yandex.ru</f:value>
  230.                 </f:coalesce>
  231.             </url>
  232.             <f:optional>
  233.                 <f:is-empty>
  234.                     <f:value-of name="weather-info"/>
  235.                 </f:is-empty>
  236.                 <tooltip>&wgt.town.weather.nodata;</tooltip>
  237.             </f:optional>
  238.             <f:optional>
  239.                 <f:not>
  240.                     <f:is-empty>
  241.                         <f:value-of name="weather-info"/>
  242.                     </f:is-empty>
  243.                 </f:not>
  244.                 <tooltip>
  245.                     <grid>
  246.                         <column h-align="right"/>
  247.                         <row>
  248.                             <cell h-align="left">
  249.                                 <icon>
  250.                                     <f:value-of name="weather-icon"/>
  251.                                 </icon>
  252.                             </cell>
  253.                             <cell h-align="center">
  254.                                 <style font-weight="bold">
  255.                                     <f:concat>
  256.                                         <f:xpath>
  257.                                             <f:param name="source">
  258.                                                 <f:value-of name="info"/>
  259.                                             </f:param>
  260.                                             <f:value type="string">string(info/weather/day/country)</f:value>
  261.                                         </f:xpath>
  262.                                         <f:value type="string">,┬á</f:value>
  263.                                         <f:xpath>
  264.                                             <f:param name="source">
  265.                                                 <f:value-of name="info"/>
  266.                                             </f:param>
  267.                                             <f:value type="string">string(info/weather/day/title)</f:value>
  268.                                         </f:xpath>
  269.                                     </f:concat>
  270.                                 </style>
  271.                             </cell>
  272.                             <cell merge-left="true"/>
  273.                         </row>
  274.                         <row>
  275.                             <cell>&wgt.town.weather.label;:</cell>
  276.                             <cell merge-left="true"/>
  277.                             <cell>
  278.                                 <f:xpath>
  279.                                     <f:param name="source">
  280.                                         <f:value-of name="info"/>
  281.                                     </f:param>
  282.                                     <f:value type="string">string(info/weather/day/day_part/weather_type)</f:value>
  283.                                 </f:xpath>
  284.                             </cell>
  285.                         </row>
  286.                         <row>
  287.                             <cell>&wgt.town.temperature.label;:</cell>
  288.                             <cell merge-left="true"/>
  289.                             <cell>
  290.                                 <f:concat>
  291.                                     <f:value-of name="temperature"/>
  292.                                     <f:value type="string">┬á┬║C</f:value>
  293.                                 </f:concat>
  294.                             </cell>
  295.                         </row>
  296.                         <row>
  297.                             <cell>&wgt.town.wind.label;:</cell>
  298.                             <cell merge-left="true"/>
  299.                             <cell>
  300.                                 <f:concat>
  301.                                     <f:xpath>
  302.                                         <f:param name="source">
  303.                                             <f:value-of name="info"/>
  304.                                         </f:param>
  305.                                         <f:value type="string">string(info/weather/day/day_part/wind_direction)</f:value>
  306.                                     </f:xpath>
  307.                                     <f:value type="string">,┬á</f:value>
  308.                                     <f:xpath>
  309.                                         <f:param name="source">
  310.                                             <f:value-of name="info"/>
  311.                                         </f:param>
  312.                                         <f:value type="string">string(info/weather/day/day_part/wind_speed)</f:value>
  313.                                     </f:xpath>
  314.                                     <f:value type="string">┬á&wgt.town.wind.ms;</f:value>
  315.                                 </f:concat>
  316.                             </cell>
  317.                         </row>
  318.                         <row>
  319.                             <cell>&wgt.town.pressure.label;:</cell>
  320.                             <cell merge-left="true"/>
  321.                             <cell>
  322.                                 <f:concat>
  323.                                     <f:xpath>
  324.                                         <f:param name="source">
  325.                                             <f:value-of name="info"/>
  326.                                         </f:param>
  327.                                         <f:value type="string">string(info/weather/day/day_part/pressure)</f:value>
  328.                                     </f:xpath>
  329.                                     <f:value type="string">┬á&wgt.town.pressure.mm.label;</f:value>
  330.                                 </f:concat>
  331.                             </cell>
  332.                         </row>
  333.                         <row>
  334.                             <cell>&wgt.town.dampness.label;:</cell>
  335.                             <cell merge-left="true"/>
  336.                             <cell>
  337.                                 <f:concat>
  338.                                     <f:xpath>
  339.                                         <f:param name="source">
  340.                                             <f:value-of name="info"/>
  341.                                         </f:param>
  342.                                         <f:value type="string">string(info/weather/day/day_part/dampness)</f:value>
  343.                                     </f:xpath>
  344.                                     <f:value type="string">┬á%</f:value>
  345.                                 </f:concat>
  346.                             </cell>
  347.                         </row>
  348.                         <f:optional>
  349.                             <f:not>
  350.                                 <f:is-empty>
  351.                                     <f:xpath>
  352.                                         <f:param name="source">
  353.                                             <f:value-of name="info"/>
  354.                                         </f:param>
  355.                                         <f:value type="string">info/weather/tonight/temperature</f:value>
  356.                                     </f:xpath>
  357.                                 </f:is-empty>
  358.                             </f:not>
  359.                             <row>
  360.                                 <cell>&wgt.town.night;:</cell>
  361.                                 <cell merge-left="true"/>
  362.                                 <cell>
  363.                                     <f:concat>
  364.                                         <f:xpath>
  365.                                             <f:param name="source">
  366.                                                 <f:value-of name="info"/>
  367.                                             </f:param>
  368.                                             <f:value type="string">string(info/weather/tonight/temperature)</f:value>
  369.                                         </f:xpath>
  370.                                         <f:value type="string">┬á┬║C</f:value>
  371.                                     </f:concat>
  372.                                 </cell>
  373.                             </row>
  374.                         </f:optional>
  375.                         <f:optional>
  376.                             <f:not>
  377.                                 <f:is-empty>
  378.                                     <f:xpath>
  379.                                         <f:param name="source">
  380.                                             <f:value-of name="info"/>
  381.                                         </f:param>
  382.                                         <f:value type="string">info/weather/tomorrow/temperature</f:value>
  383.                                     </f:xpath>
  384.                                 </f:is-empty>
  385.                             </f:not>
  386.                             <row>
  387.                                 <cell>&wgt.town.tomorrow;:</cell>
  388.                                 <cell merge-left="true"/>
  389.                                 <cell>
  390.                                     <f:concat>
  391.                                         <f:xpath>
  392.                                             <f:param name="source">
  393.                                                 <f:value-of name="info"/>
  394.                                             </f:param>
  395.                                             <f:value type="string">string(info/weather/tomorrow/temperature)</f:value>
  396.                                         </f:xpath>
  397.                                         <f:value type="string">┬á┬║C</f:value>
  398.                                     </f:concat>
  399.                                 </cell>
  400.                             </row>
  401.                         </f:optional>
  402.                     </grid>
  403.                 </tooltip>
  404.             </f:optional>
  405.         </button>
  406.     </f:optional>
  407.     <f:optional>
  408.         <f:and>
  409.             <f:value-of name="show-traffic"/>
  410.             <f:not>
  411.                 <f:is-empty>
  412.                     <f:xpath>
  413.                         <f:value type="string">info/traffic</f:value>
  414.                         <f:value-of name="info"/>
  415.                     </f:xpath>
  416.                 </f:is-empty>
  417.             </f:not>
  418.         </f:and>
  419.         <button>
  420.             <icon>
  421.                 <f:if>
  422.                     <f:value-of name="hide-throbber"/>
  423.                     <f:value-of name="traffic-icon"/>
  424.                     <f:value type="string">xb://toolkit/images/throbber.gif</f:value>
  425.                 </f:if>
  426.             </icon>
  427.             <text>
  428.                 <f:value-of name="traffic"/>
  429.             </text>
  430.             <url action="710">
  431.                 <f:xpath>
  432.                     <f:param name="source">
  433.                         <f:value-of name="info"/>
  434.                     </f:param>
  435.                     <f:value type="string">string(info/traffic/url)</f:value>
  436.                 </f:xpath>
  437.             </url>
  438.             <tooltip>
  439.                 <grid>
  440.                     <column h-align="right"/>
  441.                     <row>
  442.                         <cell h-align="left">
  443.                             <icon>
  444.                                 <f:value-of name="traffic-icon"/>
  445.                             </icon>
  446.                         </cell>
  447.                         <cell h-align="center">
  448.                             <style font-weight="bold">
  449.                                 <f:xpath>
  450.                                     <f:param name="source">
  451.                                         <f:value-of name="info"/>
  452.                                     </f:param>
  453.                                     <f:value type="string">string(info/traffic/title)</f:value>
  454.                                 </f:xpath>
  455.                             </style>
  456.                         </cell>
  457.                         <cell merge-left="true"/>
  458.                     </row>
  459.                     <row>
  460.                         <cell>&wgt.town.traffic.points;:</cell>
  461.                         <cell merge-left="true"/>
  462.                         <cell>
  463.                             <f:value-of name="traffic"/>
  464.                         </cell>
  465.                     </row>
  466.                     <row>
  467.                         <cell>&wgt.town.traffic.description;:</cell>
  468.                         <cell merge-left="true"/>
  469.                         <cell>
  470.                             <f:xpath>
  471.                                 <f:param name="source">
  472.                                     <f:value-of name="info"/>
  473.                                 </f:param>
  474.                                 <f:value type="string">string(info/traffic/hint)</f:value>
  475.                             </f:xpath>
  476.                         </cell>
  477.                     </row>
  478.                     <row>
  479.                         <cell>&wgt.town.traffic.length;:</cell>
  480.                         <cell merge-left="true"/>
  481.                         <cell>
  482.                             <f:concat>
  483.                                 <f:format-number>
  484.                                     <f:div>
  485.                                         <f:xpath>
  486.                                             <f:param name="source">
  487.                                                 <f:value-of name="info"/>
  488.                                             </f:param>
  489.                                             <f:value type="string">number(info/traffic/length)</f:value>
  490.                                         </f:xpath>
  491.                                         <f:value type="number">1000</f:value>
  492.                                     </f:div>
  493.                                     <f:param name="precision">
  494.                                         <f:value type="number">1</f:value>
  495.                                     </f:param>
  496.                                 </f:format-number>
  497.                                 <f:value type="string">┬á&wgt.town.traffic.length.km;</f:value>
  498.                             </f:concat>
  499.                         </cell>
  500.                     </row>
  501.                 </grid>
  502.             </tooltip>
  503.         </button>
  504.     </f:optional>
  505. </widget>
  506.