Files
Mozilla/mozilla/toolkit/mozapps/update/content/updates.xml
ben%bengoodger.com 81e31b2cd0 245953 - software update works poorly, including:
- various problems with update wizard
- hides app update notification icon for that session after the user has
visited the products page
- makes sure the app update info is cleared when no newer versions are present
- make app update work when extension update is disabled, general code
correctness etc.
- make sure the browser window that contains the product page is focused.


git-svn-id: svn://10.0.0.236/trunk@159051 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-12 08:57:18 +00:00

166 lines
6.4 KiB
XML

<?xml version="1.0"?>
<!DOCTYPE bindings SYSTEM "chrome://mozapps/locale/update/update.dtd">
<bindings id="updatesBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="updateStatusbarNotification" extends="chrome://global/content/bindings/general.xml#statusbarpanel">
<resources>
<stylesheet src="chrome://mozapps/skin/update/update.css"/>
</resources>
<content>
<xul:hbox flex="1" class="updateIndicator" xbl:inherits="updateCount"
anonid="infoPanel">
<xul:image xbl:inherits="severity" class="updateIcon"/>
<xul:label xbl:inherits="value=updateCount" flex="1" crop="right"/>
</xul:hbox>
</content>
<implementation implements="nsIObserver">
<destructor>
<![CDATA[
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
os.removeObserver(this, "Update:Ended");
]]>
</destructor>
<method name="init">
<body>
<![CDATA[
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
os.addObserver(this, "Update:Ended", false);
this.refreshData();
]]>
</body>
</method>
<method name="observe">
<parameter name="aSubject"/>
<parameter name="aTopic"/>
<parameter name="aData"/>
<body>
<![CDATA[
if (aTopic == "Update:Ended")
this.refreshData();
]]>
</body>
</method>
<method name="refreshData">
<body>
<![CDATA[
var updates = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIUpdateService);
this.severity = updates.updateSeverity;
this.updateCount = updates.updateCount;
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
var updateStrings = sbs.createBundle("chrome://mozapps/locale/update/update.properties");
var key;
if (this.updateCount > 0)
key = "updatesAvailableTooltip-" + this.severity;
else
key = "updatesCheckForUpdatesTooltip";
var tooltip = updateStrings.GetStringFromName(key);
this.setAttribute("tooltiptext", tooltip);
]]>
</body>
</method>
<method name="showUpdates">
<body>
<![CDATA[
var updates = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIUpdateService);
updates.checkForUpdates([], 0, Components.interfaces.nsIUpdateItem.TYPE_ANY,
Components.interfaces.nsIUpdateService.SOURCE_EVENT_USER,
window);
]]>
</body>
</method>
<property name="severity" onset="this.setAttribute('severity', val); return val;"
onget="return this.getAttribute('severity');"/>
<property name="updateCount" onset="this.setAttribute('updateCount', val); return val;"
onget="return this.getAttribute('updateCount');"/>
</implementation>
<handlers>
<handler event="dblclick">
<![CDATA[
this.showUpdates();
]]>
</handler>
</handlers>
</binding>
<binding id="updateItem">
<resources>
<stylesheet src="chrome://mozapps/skin/update/update.css"/>
</resources>
<content>
<xul:hbox flex="1">
<xul:stack>
<xul:vbox align="center">
<xul:image class="updateItemIcon" xbl:inherits="src=icon"/>
</xul:vbox>
<xul:vbox align="right">
<xul:checkbox class="updateItemChecked" anonid="updateItemChecked" xbl:inherits="checked"/>
</xul:vbox>
</xul:stack>
<xul:vbox flex="1">
<xul:hbox class="updateItemNameRow" align="center">
<xul:label class="updateItemName" xbl:inherits="value=name" flex="1" crop="right"/>
</xul:hbox>
<xul:hbox class="updateItemInfoRow" anonid="updateItemInfoRow" align="center" hidden="true">
<xul:label class="updateItemInfo" anonid="updateItemText" flex="1" crop="right">&appInfo.label;</xul:label>
</xul:hbox>
<xul:hbox class="updateItemDetailsRow" align="center">
<xul:label class="updateItemFromLabel">&from.label;</xul:label>
<xul:textbox class="updateItemURL" xbl:inherits="value=url" flex="1" readonly="true" crop="right"/>
</xul:hbox>
</xul:vbox>
</xul:hbox>
</content>
<implementation>
<property name="name" onset="this.setAttribute('name', val); return val;"
onget="return this.getAttribute('name');"/>
<property name="url" onset="this.setAttribute('url', val); return val;"
onget="return this.getAttribute('url');"/>
<property name="icon" onset="this.setAttribute('icon', val); return val;"
onget="return this.getAttribute('icon');"/>
<property name="type" onget="return parseInt(this.getAttribute('type'));">
<setter>
<![CDATA[
this.setAttribute("type", val);
if (val == Components.interfaces.nsIUpdateItem.TYPE_APP) {
var infoRow = document.getAnonymousElementByAttribute(this, "anonid", "updateItemInfoRow");
infoRow.removeAttribute("hidden");
}
return val;
]]>
</setter>
</property>
<property name="checked">
<setter>
var checkbox = document.getAnonymousElementByAttribute(this, "anonid", "updateItemChecked");
checkbox.checked = val;
return val;
</setter>
<getter>
var checkbox = document.getAnonymousElementByAttribute(this, "anonid", "updateItemChecked");
return checkbox.checked;
</getter>
</property>
</implementation>
</binding>
</bindings>