Bug 1004506 - Telemetry experiments: Properly handle install states & their transitions in addon manager UI. r=unfocused

This commit is contained in:
Georg Fritzsche 2014-05-07 20:48:07 +02:00
Родитель c2d8fdf055
Коммит e55c45fbb7
3 изменённых файлов: 34 добавлений и 18 удалений

Просмотреть файл

@ -250,3 +250,8 @@ richlistitem:not([selected]) * {
.view-pane:not([type="experiment"]) #detail-experiment-container {
display: none;
}
.addon[type="experiment"][status="installing"] .experiment-time,
.addon[type="experiment"][status="installing"] .experiment-state {
display: none;
}

Просмотреть файл

@ -2649,6 +2649,13 @@ var gListView = {
// the existing item
if (aInstall.existingAddon)
this.removeItem(aInstall, true);
if (aInstall.addon.type == "experiment") {
let item = this.getListItemForID(aInstall.addon.id);
if (item) {
item.endDate = getExperimentEndDate(aInstall.addon);
}
}
},
addItem: function gListView_addItem(aObj, aIsInstall) {

Просмотреть файл

@ -1364,9 +1364,11 @@
this._debugBtn.disabled = this._debugBtn.hidden = !debuggable
if (this.mAddon.type == "experiment") {
this.removeAttribute("notification");
let prefix = "experiment.";
let active = this.mAddon.isActive;
if (!showProgress) {
let stateKey = prefix + "state." + (active ? "active" : "complete");
this._experimentState.value = gStrings.ext.GetStringFromName(stateKey);
@ -1376,6 +1378,7 @@
let timeKey = prefix + "time.";
let timeMessage;
if (days < 1) {
timeKey += (active ? "endsToday" : "endedToday");
timeMessage = gStrings.ext.GetStringFromName(timeKey);
@ -1389,6 +1392,7 @@
this._experimentTime.value = timeMessage;
}
}
]]></body>
</method>