commit 39092b7c82f78085635eb6c4af8710a173d4425e
parent c1054b57d68e6a5d1cd0def0a1ade8f1e58ac170
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 14 Dec 2009 20:15:47 +0000
Display "Open Sync Preferences..." button instead of "Report Errors..." on WebDAV verification failure during sync
Diffstat:
2 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js
@@ -99,8 +99,23 @@ Zotero.Sync.Storage = new function () {
}
else {
Zotero.debug(_session.name + " verification failed");
- _callbacks.onError(_session.name + " verification failed. Verify your "
- + "WebDAV settings in the Sync pane of the Zotero preferences.");
+
+ var e = new Zotero.Error(
+ _session.name + " verification failed. Verify your "
+ + "WebDAV settings in the Sync pane of the Zotero preferences.",
+ 0,
+ {
+ // TODO: localize
+ dialogButtonText: "Open Sync Preferences...",
+ dialogButtonCallback: function () {
+ var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
+ .getService(Components.interfaces.nsIWindowMediator);
+ var lastWin = wm.getMostRecentWindow("navigator:browser");
+ lastWin.ZoteroPane.openPreferences('zotero-prefpane-sync');
+ }
+ }
+ );
+ _callbacks.onError(e);
}
}
diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js
@@ -805,8 +805,15 @@ Zotero.Sync.Runner = new function () {
Components.utils.reportError(message);
}
+ if (typeof buttonText == 'undefined') {
+ // TODO: localize
+ buttonText = "Report Error...";
+ buttonCallback = function () {
+ win.ZoteroPane.reportErrors();
+ }
+ }
// If secondary button is explicitly null, just use an alert
- if (buttonText === null) {
+ else if (buttonText === null) {
pr.alert(title, message);
return;
}
@@ -818,15 +825,12 @@ Zotero.Sync.Runner = new function () {
message,
buttonFlags,
"",
- // TODO: localize
- "Report Error...",
+ buttonText,
"", null, {}
);
if (index == 1) {
- win.setTimeout(function () {
- win.ZoteroPane.reportErrors();
- }, 1);
+ setTimeout(buttonCallback, 1);
}
}
}