Show access error for translator save attempt to read-only library

Not sure how this works for connector saves
This commit is contained in:
Dan Stillman 2012-01-11 18:12:21 -05:00
parent de696d32e8
commit d63d24c636
3 changed files with 13 additions and 2 deletions

View File

@ -152,6 +152,15 @@ var Zotero_Browser = new function() {
var libraryID = null, collectionID = null;
if(ZoteroPane && !Zotero.isConnector) {
try {
if (!ZoteroPane.collectionsView.editable) {
Zotero_Browser.progress.changeHeadline(Zotero.getString("ingester.scrapeError"));
var desc = Zotero.getString('save.error.cannotMakeChangesToLibrary');
Zotero_Browser.progress.addDescription(desc);
Zotero_Browser.progress.show();
Zotero_Browser.progress.startCloseTimer(8000);
return;
}
libraryID = ZoteroPane.getSelectedLibraryID();
collectionID = ZoteroPane.getSelectedCollection(true);
} catch(e) {}

View File

@ -3498,14 +3498,14 @@ var ZoteroPane = new function()
this.displayCannotEditLibraryMessage = function () {
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
ps.alert(null, "", "You cannot make changes to the currently selected library.");
ps.alert(null, "", Zotero.getString('save.error.cannotMakeChangesToLibrary'));
}
this.displayCannotEditLibraryFilesMessage = function () {
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
ps.alert(null, "", "You cannot add files to the currently selected library.");
ps.alert(null, "", Zotero.getString('save.error.cannotAddFilesToLibrary'));
}

View File

@ -396,6 +396,8 @@ fileTypes.document = Document
save.attachment = Saving Snapshot…
save.link = Saving Link…
save.link.error = An error occurred while saving this link.
save.error.cannotMakeChangesToLibrary = You cannot make changes to the currently selected library.
save.error.cannotAddFilesToLibrary = You cannot add files to the currently selected library.
ingester.saveToZotero = Save to Zotero
ingester.saveToZoteroUsing = Save to Zotero using "%S"