Bug 668760 - Show message when there are no desktop tabs to display (r=mbrubeck)

This commit is contained in:
Lucas Rocha 2011-08-23 09:16:33 -07:00
parent fb74303629
commit 96fcb0acbf
2 changed files with 14 additions and 2 deletions

View File

@ -1390,6 +1390,7 @@
<body><![CDATA[
let self = this;
this.setAttribute("loading", "true");
this.removeAttribute("message");
if (Weave.Service.isLoggedIn) {
setTimeout(function() self._loadChildren(), 0);
@ -1417,10 +1418,19 @@
let engine = this._getWeaveEngine();
// Only load items if the tabs engine is ready
// Only load items if the tabs engine is ready. In case
// sync fails, WeaveGlue will show an error dialog. If sync
// succeeds but has no data to display, a message is presented
// in the panel (see "message" attribute).
if (engine) {
let items = this._getRemoteTabs(engine);
children.setItems(items.map(this.createItem));
if (items.length) {
children.setItems(items.map(this.createItem));
} else {
let bundle = Services.strings.createBundle("chrome://browser/locale/sync.properties");
this.setAttribute("message", bundle.GetStringFromName("sync.message.notabs"));
}
}
this.removeAttribute("loading");

View File

@ -25,3 +25,5 @@ sync.setup.error.network=No internet connection available
sync.setup.error.nodata=%S could not connect to Sync. Would you like to try again?
sync.setup.tryagain=Try again
sync.setup.manual=Manual setup
sync.message.notabs=No tabs from your other computers.