commit 61e9ace79e390eadfbf1eb55551ca0efad048f09
parent 50e100ec823825c54ccb78a43efdea4f74978786
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 8 Feb 2010 18:00:09 +0000
Display a clearer error message attempting to import an unsupported file format, with a button pointing to http://zotero.org/support/kb/importing
Diffstat:
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js
@@ -275,9 +275,25 @@ var Zotero_File_Interface = new function() {
Zotero.DB.beginTransaction();
translation.translate();
} else {
- var prompt = Components.classes["@mozilla.org/network/default-prompt;1"]
- .getService(Components.interfaces.nsIPrompt);
- prompt.alert("", Zotero.getString("fileInterface.fileFormatUnsupported"));
+ // TODO: localize and remove fileInterface.fileFormatUnsupported string
+ var unsupportedFormat = "The selected file is not in a supported format.";
+ var viewSupportedFormats = "View Supported Formats...";
+
+ var pr = Components.classes["@mozilla.org/network/default-prompt;1"]
+ .getService(Components.interfaces.nsIPrompt);
+ var buttonFlags = (pr.BUTTON_POS_0) * (pr.BUTTON_TITLE_OK)
+ + (pr.BUTTON_POS_1) * (pr.BUTTON_TITLE_IS_STRING);
+ var index = pr.confirmEx(
+ "",
+ unsupportedFormat,
+ buttonFlags,
+ null,
+ viewSupportedFormats,
+ null, null, {}
+ );
+ if (index == 1) {
+ window.loadURI("http://zotero.org/support/kb/importing");
+ }
}
}