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 / fil76922583CC715925213D6347B9BFF177 < prev    next >
Extensible Markup Language  |  2010-07-12  |  9KB  |  203 lines

  1. <?xml version="1.0"?>
  2. <!DOCTYPE bindings [
  3.     <!ENTITY % locale SYSTEM "chrome://yasearch/locale/package-management/package-management.dtd">
  4.     %locale;
  5. ]>
  6.  
  7. <bindings xmlns="http://www.mozilla.org/xbl"
  8.           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  9.           xmlns:xbl="http://www.mozilla.org/xbl"
  10.           xmlns:html="http://www.w3.org/1999/xhtml">
  11.     
  12.     <binding id="update"
  13.              extends="../package-management.xml#package-management"
  14.              inheritstyle="false">
  15.         
  16.         <resources>
  17.             <stylesheet src="update.css"/>
  18.         </resources>
  19.         
  20.         <content>
  21.             
  22.             <xul:vbox step="confirm">
  23.                 <xul:head class="confirm-head" title="&update.select.head.title;" description="&update.select.head.description;"/>
  24.                 <xul:hbox class="buttons">
  25.                     <xul:button label="&button.update;" oncommand="_stepSelect();"/>
  26.                     <xul:button label="&button.postpone;" oncommand="dialog.close();"/>
  27.                 </xul:hbox>
  28.                 <xul:more open="true" label-opened="&more.opened;" label-closed="&more.closed;">
  29.                     <xul:label value="&update.select.list.description;"/>
  30.                     <xul:components class="confirm-components"/>
  31.                 </xul:more>
  32.             </xul:vbox>
  33.             
  34.             <xul:vbox step="download">
  35.                 <xul:head class="download-head" title="&update.download.head.title;"  description="&update.download.head.description;"/>
  36.                 <xul:progressmeter class="download-progressmeter" mode="determined" max="100" value="0" flex="1"/>
  37.                 <xul:hbox class="buttons">
  38.                     <xul:button label="&button.cancel;" oncommand="dialog.close();"/>
  39.                 </xul:hbox>
  40.             </xul:vbox>
  41.             
  42.             <xul:vbox step="conflict">
  43.                 <xul:head class="conflict-head" mode="warning" title="&update.conflict.head.title;" description="&update.conflict.head.description;"/>
  44.                 <xul:components class="conflict-deleted"/>
  45.                 <xul:hbox class="buttons">
  46.                     <xul:button label="&button.accept;" oncommand="_stepConflictResolved();"/>
  47.                     <xul:button label="&button.cancel;" oncommand="dialog.close();"/>
  48.                 </xul:hbox>
  49.             </xul:vbox>
  50.             
  51.             <xul:vbox step="placement">
  52.                 <xul:head class="placement-head" title="&update.placement.head.title;" description="&update.placement.head.description;"/>
  53.                 <xul:hbox class="buttons">
  54.                     <xul:button label="&button.save;" oncommand="_stepApply();"/>
  55.                     <xul:button label="&button.cancel;" oncommand="dialog.close();"/>
  56.                 </xul:hbox>
  57.                 <xul:more label-opened="&more.opened;" label-closed="&more.closed;">
  58.                     <xul:label value="&placement.placement.label;"/>
  59.                     <xul:placement class="placement-placement" no-replace="true"/>
  60.                     <xul:label value="&placement.list.label;"/>
  61.                     <xul:components class="placement-widgets"/>
  62.                 </xul:more>
  63.             </xul:vbox>
  64.             
  65.             <xul:vbox step="finish">
  66.                 <xul:head class="finish-head" title="&update.finish.head.title;" description="&update.finish.head.description;"/>
  67.                 <xul:hbox class="buttons">
  68.                     <xul:button label="&button.finish;" oncommand="dialog.close();"/>
  69.                 </xul:hbox>
  70.             </xul:vbox>
  71.             
  72.             <xul:vbox step="error">
  73.                 <xul:head class="error-head" mode="warning" title="&error.head.title;" description="&error.head.description;"/>
  74.                 <xul:hbox class="buttons" anonid="error-buttons">
  75.                     <xul:button action="accept" label="&button.accept;" oncommand=""/>
  76.                     <xul:button action="repeat" label="&button.repeat;" oncommand=""/>
  77.                     <xul:button action="close" label="&button.finish;" oncommand=""/>
  78.                 </xul:hbox>
  79.                 <xul:more class="error-more" label-opened="&error.more.opened;" label-closed="&error.more.closed;">
  80.                     <xul:label flex="1" class="error-details"/>
  81.                 </xul:more>
  82.             </xul:vbox>
  83.             
  84.         </content>
  85.         
  86.         <implementation implements="nsIDOMEventListener,nsIWebProgressListener">
  87.             <field name="mode">"update"</field>
  88.             
  89.             <field name="simple">!!this.parameters.simple</field>
  90.             
  91.             <constructor><![CDATA[
  92.                 this._stepConfirm();
  93.             ]]></constructor>
  94.             
  95.             <destructor><![CDATA[
  96.             ]]></destructor>
  97.             
  98.             <method name="_stepConfirm">
  99.                 <body><![CDATA[
  100.                     if (!this.simple)
  101.                         this.step("confirm");
  102.                     
  103.                     this.components = [];
  104.                     var index = [];
  105.                     
  106.                     for each (let manifest in this.parameters.manifests) {
  107.                         let [info, info2] = this._application.selectBestPackage(manifest);
  108.                         let component = {
  109.                             type: "package",
  110.                             checked: true,
  111.                             manifest: manifest,
  112.                             info: info,
  113.                             version: info.version,
  114.                             widgets: []
  115.                         };
  116.                         
  117.                         index[manifest.packageID] = component;
  118.                         this.components.push(component);
  119.                     }
  120.                     
  121.                     for each (let id in this._widgetLibrary.getWidgetProtoIDs()) {
  122.                         let [widgetPackageID, ] = this._widgetLibrary.parseWidgetProtoID(id)
  123.                         let component = index[widgetPackageID];
  124.                         if (component) {
  125.                             component.widgets.push(this._widgetLibrary.getWidgetProto(id));
  126.                         }
  127.                     }
  128.                     
  129.                     for each (let preset in this.parameters.presets) {
  130.                         let component = {
  131.                             type: "preset",
  132.                             checked: true,
  133.                             preset: preset
  134.                         };
  135.                         this.components.push(component);
  136.                     }
  137.                     
  138.                     this._nodeConfirmComponents.items = this.components;
  139.                     
  140.                     if (this.simple)
  141.                         this._stepSelect();
  142.                 ]]></body>
  143.             </method>
  144.             
  145.             <method name="_stepSelect">
  146.                 <body><![CDATA[
  147.                     this._filterComponent(this.components, function(component) {
  148.                         return !!component.checked;
  149.                     });
  150.                     
  151.                     this.presets = [];
  152.                     this.packages = [];
  153.                     for each (let component in this.components) {
  154.                         component.checked = false;
  155.                         
  156.                         if (component.type == "preset")
  157.                             this.presets.push(component.preset);
  158.                         if (component.type == "package")
  159.                             this.packages.push(component);
  160.                     }
  161.                     
  162.                     this.packages = this.packages.filter(function(component) {
  163.                         if (component.widgets.length > 0)
  164.                             return true;
  165.                         
  166.                         let used = false,
  167.                             packageID = component.manifest.packageID;
  168.                         loop: for each (let preset in this.presets)
  169.                             for each (let info in preset.widgetsInfo)
  170.                                 if (packageID == info.packageID) {
  171.                                     used = true;
  172.                                     break loop;
  173.                                 }
  174.                         return used;
  175.                     }, this);
  176.                     
  177.                     this._stepDownloadPackages();
  178.                 ]]></body>
  179.             </method>
  180.             
  181.             <method name="_stepCheckErrors">
  182.                 <body><![CDATA[
  183.                     this._stepPlacement();
  184.                 ]]></body>
  185.             </method>
  186.             
  187.             <method name="_stepPlacement">
  188.                 <body><![CDATA[
  189.                     if (this.widgets.length == 0) {
  190.                         if (this._stepInstall())
  191.                             this.step("finish");
  192.                         return;
  193.                     }
  194.                     
  195.                     this.step("placement");
  196.                     
  197.                     this._nodePlacementWidgets.items = this.widgets;
  198.                 ]]></body>
  199.             </method>
  200.             
  201.         </implementation>
  202.     </binding>
  203. </bindings>