diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index 3912940fc..a9b4d7c05 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -1398,10 +1398,12 @@ Zotero.ItemTreeView.prototype.onDragStart = function (evt,transferData,action) var items = Zotero.Items.get(this.saveSelection()); - // If at least one file is a non-web-link attachment, enable dragging to file system + // If at least one file is a non-web-link attachment and can be found, + // enable dragging to file system for (var i=0; i 0) { + // On platforms that use a temporary directory, an alert here + // would interrupt the dragging process, so we just log a + // warning to the console + if (useTemp) { + for each(var name in notFoundNames) { + var msg = "Attachment file for dragged item '" + name + "' not found"; + Zotero.log(msg, 'warning', + 'chrome://zotero/content/xpcom/itemTreeView.js'); + } + } + else { + promptService.alert(null, Zotero.getString('general.warning'), + Zotero.getString('dragAndDrop.filesNotFound') + "\n\n" + + notFoundNames.join("\n")); + } + } + // Display alert if existing files were skipped if (existingItems.length > 0) { - var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] - .getService(Components.interfaces.nsIPromptService); - promptService.alert(null, Zotero.getString('general.warning'), Zotero.getString('dragAndDrop.existingFiles') + "\n\n" + existingFileNames.join("\n")); diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index b6f34efb3..449661eb9 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -366,6 +366,7 @@ zotero.preferences.export.quickCopy.exportFormats = Export Formats zotero.preferences.export.quickCopy.instructions = Quick Copy allows you to copy selected references to the clipboard by pressing a shortcut key (%S) or dragging items into a text box on a web page. dragAndDrop.existingFiles = The following files already existed in the destination directory and were not copied: +dragAndDrop.filesNotFound = The following files were not found and could not be copied: fileInterface.itemsImported = Importing items... fileInterface.itemsExported = Exporting items...