Bug 1003860 - Various tweaks to the storage inspector. r=mratcliffe

This commit is contained in:
Alexandre Poirot 2016-02-02 01:31:34 -08:00
parent ccedcd936b
commit 68316a7690
3 changed files with 19 additions and 4 deletions

View File

@ -57,7 +57,10 @@ StoragePanel.prototype = {
this.emit("ready");
return this;
}).catch(this.destroy);
}).catch(e => {
console.log("error while opening storage panel", e);
this.destroy();
});
},
/**

View File

@ -490,6 +490,7 @@ function* selectTreeItem(ids) {
let selector = "[data-id='" + JSON.stringify(ids) + "'] > .tree-widget-item";
let target = gPanelWindow.document.querySelector(selector);
ok(target, "tree item found with ids " + JSON.stringify(ids));
let updated = gUI.once("store-objects-updated");
@ -506,6 +507,7 @@ function* selectTreeItem(ids) {
function* selectTableItem(id) {
let selector = ".table-widget-cell[data-id='" + id + "']";
let target = gPanelWindow.document.querySelector(selector);
ok(target, "table item found with ids " + id);
yield click(target);
yield gUI.once("sidebar-updated");

View File

@ -341,11 +341,16 @@ StorageUI.prototype = {
populateStorageTree: function(storageTypes) {
this.storageTypes = {};
for (let type in storageTypes) {
// Ignore `from` field, which is just a protocol.js implementation artifact
if (type === "from") {
continue;
}
let typeLabel = L10N.getStr("tree.labels." + type);
let typeLabel = type;
try {
typeLabel = L10N.getStr("tree.labels." + type);
} catch(e) {
console.error("Unable to localize tree label type:" + type);
}
this.tree.add([{id: type, label: typeLabel, type: "store"}]);
if (!storageTypes[type].hosts) {
continue;
@ -568,7 +573,12 @@ StorageUI.prototype = {
if (!uniqueKey) {
this.table.uniqueId = uniqueKey = key;
}
columns[key] = L10N.getStr("table.headers." + type + "." + key);
columns[key] = key;
try {
columns[key] = L10N.getStr("table.headers." + type + "." + key);
} catch(e) {
console.error("Unable to localize table header type:" + type + " key:" + key);
}
}
this.table.setColumns(columns, null, HIDDEN_COLUMNS);
this.shouldResetColumns = false;