Bug 591131 - Sync UI: Point users at status page when we hit sync delay/503s. r=mconnor a=blocking-beta7

This commit is contained in:
Philipp von Weitershausen 2010-09-24 00:19:42 +02:00
Родитель 7fa6b027e5
Коммит 22bd8614f5
1 изменённых файлов: 21 добавлений и 2 удалений

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

@ -192,7 +192,13 @@ let gSyncUI = {
// basically, we want to just inform users that stuff is going to take a while // basically, we want to just inform users that stuff is going to take a while
let title = this._stringBundle.GetStringFromName("error.sync.no_node_found.title"); let title = this._stringBundle.GetStringFromName("error.sync.no_node_found.title");
let description = this._stringBundle.GetStringFromName("error.sync.no_node_found"); let description = this._stringBundle.GetStringFromName("error.sync.no_node_found");
let notification = new Weave.Notification(title, description, null, Weave.Notifications.PRIORITY_INFO); let buttons = [new Weave.NotificationButton(
this._stringBundle.GetStringFromName("error.sync.serverStatusButton.label"),
this._stringBundle.GetStringFromName("error.sync.serverStatusButton.accesskey"),
function() { gWeaveWin.openServerStatus(); return true; }
)];
let notification = new Weave.Notification(
title, description, null, Weave.Notifications.PRIORITY_INFO, buttons);
Weave.Notifications.replaceTitle(notification); Weave.Notifications.replaceTitle(notification);
this._wasDelayed = true; this._wasDelayed = true;
}, },
@ -256,6 +262,11 @@ let gSyncUI = {
Weave.Notifications.replaceTitle(notification); Weave.Notifications.replaceTitle(notification);
}, },
openServerStatus: function () {
let statusURL = Services.prefs.getCharPref("services.sync.statusURL");
window.openUILinkIn(statusURL, "tab");
},
// Commands // Commands
doLogin: function SUI_doLogin() { doLogin: function SUI_doLogin() {
Weave.Service.login(); Weave.Service.login();
@ -356,7 +367,15 @@ let gSyncUI = {
function() { gSyncUI.openQuotaDialog(); return true; } ) function() { gSyncUI.openQuotaDialog(); return true; } )
); );
} }
else if (!Weave.Status.enforceBackoff) { else if (Weave.Status.enforceBackoff) {
priority = Weave.Notifications.PRIORITY_INFO;
buttons.push(new Weave.NotificationButton(
this._stringBundle.GetStringFromName("error.sync.serverStatusButton.label"),
this._stringBundle.GetStringFromName("error.sync.serverStatusButton.accesskey"),
function() { gSyncUI.openServerStatus(); return true; }
));
}
else {
priority = Weave.Notifications.PRIORITY_INFO; priority = Weave.Notifications.PRIORITY_INFO;
buttons.push(new Weave.NotificationButton( buttons.push(new Weave.NotificationButton(
this._stringBundle.GetStringFromName("error.sync.tryAgainButton.label"), this._stringBundle.GetStringFromName("error.sync.tryAgainButton.label"),