зеркало из https://github.com/mozilla/gecko-dev.git
Bug 554938 - Some cleanup and fixes for new Add-on Manager features [r=vingtetun]
This commit is contained in:
Родитель
f8c79eb725
Коммит
858a09b469
|
@ -199,7 +199,7 @@
|
|||
</binding>
|
||||
|
||||
<binding id="extension-message" extends="chrome://browser/content/bindings.xml#richlistitem">
|
||||
<content orient="vertical" align="center">
|
||||
<content orient="vertical" align="center" nohighlight="true">
|
||||
<xul:hbox align="center">
|
||||
<xul:image src="chrome://browser/skin/images/throbber.png" xbl:inherits="hidden=hidethrobber"/>
|
||||
<xul:label class="normal" xbl:inherits="value=message"/>
|
||||
|
@ -226,13 +226,10 @@
|
|||
</binding>
|
||||
|
||||
<binding id="extension-search-showmore" extends="chrome://browser/content/bindings.xml#richlistitem">
|
||||
<content orient="vertical">
|
||||
<xul:hbox align="start">
|
||||
<content orient="vertical" nohighlight="true">
|
||||
<xul:hbox align="center">
|
||||
<xul:image class="addon-showmore-image" xbl:inherits="src=image"/>
|
||||
<xul:vbox flex="1">
|
||||
<xul:label class="title" xbl:inherits="value=title"/>
|
||||
<xul:description class="normal" xbl:inherits="xbl:text=description" flex="1"/>
|
||||
</xul:vbox>
|
||||
<xul:label class="title" xbl:inherits="value=label"/>
|
||||
<xul:spacer flex="1"/>
|
||||
<xul:button label="&addonShowPage.label;" oncommand="ExtensionsView.showMoreResults(document.getBindingParent(this));"/>
|
||||
</xul:hbox>
|
||||
|
|
|
@ -348,11 +348,11 @@
|
|||
</hbox>
|
||||
<notificationbox id="addons-messages" flex="1">
|
||||
<richlistbox id="addons-list" flex="1" onselect="ExtensionsView.hideOnSelect(event)">
|
||||
<richlistitem id="addons-local" class="section-header" align="center">
|
||||
<richlistitem id="addons-local" class="section-header" align="center" nohighlight="true">
|
||||
<label value="&addonsLocal.label;" flex="1"/>
|
||||
<spacer flex="1"/>
|
||||
</richlistitem>
|
||||
<richlistitem id="addons-repo" class="section-header">
|
||||
<richlistitem id="addons-repo" class="section-header" nohighlight="true">
|
||||
<label value="&addonsRepo.label;" flex="1"/>
|
||||
<textbox id="addons-search-text" emptytext="&addonsSearch2.emptytext;" type="search" searchbutton="false"
|
||||
oncommand="ExtensionsView.getAddonsFromRepo(this.value);"/>
|
||||
|
|
|
@ -164,13 +164,17 @@ var ExtensionsView = {
|
|||
this._msg.appendNotification(aMsg, aValue, "", this._msg.PRIORITY_WARNING_LOW, buttons).hideclose = !aShowCloseButton;
|
||||
},
|
||||
|
||||
showRestart: function ev_showRestart() {
|
||||
showRestart: function ev_showRestart(aMode) {
|
||||
// Increment the count in case the view is not completely initialized
|
||||
this._restartCount++;
|
||||
|
||||
// Pick the right message key from the properties file
|
||||
aMode = aMode || "normal";
|
||||
|
||||
if (this._msg) {
|
||||
let strings = Elements.browserBundle;
|
||||
this.showMessage(strings.getString("notificationRestart.label"), "restart-app",
|
||||
let message = "notificationRestart." + aMode;
|
||||
this.showMessage(strings.getString(message), "restart-app",
|
||||
strings.getString("notificationRestart.button"), false, "addons-restart-app");
|
||||
}
|
||||
},
|
||||
|
@ -605,13 +609,9 @@ var ExtensionsView = {
|
|||
let showmore = document.createElement("richlistitem");
|
||||
showmore.setAttribute("typeName", "showmore");
|
||||
|
||||
let titleBase = strings.getString("addonsSearchMore.label");
|
||||
let title = PluralForm.get(aTotalResults, titleBase).replace("#1", aTotalResults);
|
||||
showmore.setAttribute("title", title);
|
||||
|
||||
let descBase = strings.getString("addonsSearchMore.description");
|
||||
let desc = PluralForm.get(aAddons.length, descBase).replace("#1", aAddons.length);
|
||||
showmore.setAttribute("description", desc);
|
||||
let labelBase = strings.getString("addonsSearchMore.label");
|
||||
let label = PluralForm.get(aTotalResults, labelBase).replace("#1", aTotalResults);
|
||||
showmore.setAttribute("label", label);
|
||||
|
||||
let url = gPrefService.getCharPref("extensions.getAddons.search.browseURL");
|
||||
url = url.replace(/%TERMS%/g, encodeURIComponent(this.searchBox.value));
|
||||
|
@ -624,8 +624,7 @@ var ExtensionsView = {
|
|||
} else {
|
||||
let showmore = document.createElement("richlistitem");
|
||||
showmore.setAttribute("typeName", "showmore");
|
||||
showmore.setAttribute("title", strings.getString("addonsBrowseAll.label"));
|
||||
showmore.setAttribute("description", strings.getString("addonsBrowseAll.description"));
|
||||
showmore.setAttribute("label", strings.getString("addonsBrowseAll.label"));
|
||||
|
||||
let url = formatter.formatURLPref("extensions.getAddons.browseAddons");
|
||||
showmore.setAttribute("url", url);
|
||||
|
@ -677,10 +676,11 @@ var ExtensionsView = {
|
|||
case "addon-update-ended":
|
||||
let status = parseInt(aData);
|
||||
let updateable = false;
|
||||
let statusMsg = null;
|
||||
const nsIAUCL = Ci.nsIAddonUpdateCheckListener;
|
||||
switch (status) {
|
||||
case nsIAUCL.STATUS_UPDATE:
|
||||
var statusMsg = strings.getFormattedString("addonUpdate.updating", [addon.version]);
|
||||
statusMsg = strings.getFormattedString("addonUpdate.updating", [addon.version]);
|
||||
updateable = true;
|
||||
break;
|
||||
case nsIAUCL.STATUS_VERSIONINFO:
|
||||
|
@ -694,7 +694,8 @@ var ExtensionsView = {
|
|||
break;
|
||||
case nsIAUCL.STATUS_APP_MANAGED:
|
||||
case nsIAUCL.STATUS_NO_UPDATE:
|
||||
statusMsg = strings.getString("addonUpdate.noupdate");
|
||||
// Ignore if no updated was found. Just let the message go blank.
|
||||
//statusMsg = strings.getString("addonUpdate.noupdate");
|
||||
break;
|
||||
case nsIAUCL.STATUS_NOT_MANAGED:
|
||||
statusMsg = strings.getString("addonUpdate.notsupported");
|
||||
|
@ -703,9 +704,14 @@ var ExtensionsView = {
|
|||
statusMsg = strings.getString("addonUpdate.notsupported");
|
||||
break;
|
||||
default:
|
||||
statusMsg = strings.getString("addonUpdate.noupdate");
|
||||
// Ignore if no updated was found. Just let the message go blank.
|
||||
//statusMsg = strings.getString("addonUpdate.noupdate");
|
||||
}
|
||||
element.setAttribute("updateStatus", statusMsg);
|
||||
|
||||
if (statusMsg)
|
||||
element.setAttribute("updateStatus", statusMsg);
|
||||
else
|
||||
element.removeAttribute("updateStatus");
|
||||
|
||||
// Tag the add-on so the XPInstallDownloadManager knows it's an update
|
||||
if (updateable)
|
||||
|
@ -799,6 +805,7 @@ XPInstallDownloadManager.prototype = {
|
|||
|
||||
this._failed = [];
|
||||
this._succeeded = [];
|
||||
this._updating = false;
|
||||
|
||||
ExtensionsView.installFromXPI(items, aManager);
|
||||
|
||||
|
@ -821,6 +828,7 @@ XPInstallDownloadManager.prototype = {
|
|||
|
||||
_failed: [],
|
||||
_succeeded: [],
|
||||
_updating: false,
|
||||
onInstallEnded: function(aAddon, aStatus) {
|
||||
// Track success/failure for each addon
|
||||
if (Components.isSuccessCode(aStatus))
|
||||
|
@ -842,6 +850,9 @@ XPInstallDownloadManager.prototype = {
|
|||
let strings = Elements.browserBundle;
|
||||
element.setAttribute("updateStatus", strings.getFormattedString("addonUpdate.updated", [aAddon.version]));
|
||||
element.removeAttribute("updating");
|
||||
|
||||
// Remember that we are updating so we can customize the restart message
|
||||
this._updating = true;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -850,7 +861,7 @@ XPInstallDownloadManager.prototype = {
|
|||
|
||||
// If even one add-on succeeded, display the restart notif
|
||||
if (this._succeeded.length > 0)
|
||||
ExtensionsView.showRestart();
|
||||
ExtensionsView.showRestart(this._updating ? "update" : "normal");
|
||||
|
||||
if (ExtensionsView.visible)
|
||||
return;
|
||||
|
|
|
@ -68,7 +68,8 @@ alertDownloadsStart=Downloading: %S
|
|||
alertDownloadsDone=%S has finished downloading
|
||||
|
||||
# Notifications
|
||||
notificationRestart.label=Restart to complete changes
|
||||
notificationRestart.normal=Restart to complete changes.
|
||||
notificationRestart.update=Add-ons updated. Restart to complete changes.
|
||||
notificationRestart.button=Restart
|
||||
|
||||
# Popup Blocker
|
||||
|
|
|
@ -436,7 +436,7 @@ richlistitem[selected="true"] {
|
|||
background-color: white;
|
||||
}
|
||||
|
||||
richlistitem:active:not([selected="true"]):not([typeName="message"]):not(.section-header) {
|
||||
richlistitem:active:not([selected="true"]):not([nohighlight="true"]) {
|
||||
background-color: #8db8d8;
|
||||
}
|
||||
|
||||
|
|
|
@ -633,7 +633,7 @@ richlistitem[selected="true"] {
|
|||
background-color: white;
|
||||
}
|
||||
|
||||
richlistitem:active:not([selected="true"]):not([typeName="message"]):not(.section-header) {
|
||||
richlistitem:active:not([selected="true"]):not([nohighlight="true"]) {
|
||||
background-color: #8db8d8;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче