Bug 688574 - Check sync username prefs key instead of using sync's API (r=mfinkle)

This commit is contained in:
Lucas Rocha 2011-10-12 15:13:25 +01:00
Родитель 8a7bbef467
Коммит f0e1f5fa83
4 изменённых файлов: 5 добавлений и 5 удалений

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

@ -1477,7 +1477,7 @@
// Return null if the Weave isn't ready
if (document.getElementById("cmd_remoteTabs").getAttribute("disabled") == "true")
return null;
if (Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED)
if (!Services.prefs.prefHasUserValue("services.sync.username")) {
return null;
return Weave.Engines.get("tabs");

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

@ -1230,7 +1230,7 @@ var BrowserUI = {
AwesomeScreen.activePanel = HistoryList;
break;
case "cmd_remoteTabs":
if (Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED) {
if (!Services.prefs.prefHasUserValue("services.sync.username")) {
// We have to set activePanel before showing sync's dialog
// to make the sure the dialog stacking is correct.
AwesomeScreen.activePanel = RemoteTabsList;

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

@ -101,7 +101,7 @@ Sanitizer.prototype = {
get canClear()
{
return (Weave.Status.checkSetup() != Weave.CLIENT_NOT_CONFIGURED);
return (Services.prefs.prefHasUserValue("services.sync.username"));
}
},

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

@ -53,7 +53,7 @@ let WeaveGlue = {
this.setupData = { account: "", password: "" , synckey: "", serverURL: "" };
// Generating keypairs is expensive on mobile, so disable it
if (Weave.Status.checkSetup() != Weave.CLIENT_NOT_CONFIGURED) {
if (Services.prefs.prefHasUserValue("services.sync.username")) {
// Put the settings UI into a state of "connecting..." if we are going to auto-connect
this._elements.connect.firstChild.disabled = true;
this._elements.connect.setAttribute("title", this._bundle.GetStringFromName("connecting.label"));
@ -259,7 +259,7 @@ let WeaveGlue = {
tryConnect: function login() {
// If Sync is not configured, simply show the setup dialog
if (Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED) {
if (!Services.prefs.prefHasUserValue("services.sync.username")) {
this.open();
return;
}