www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit cf0e1e6972f777a5549e97428b7a3ed3702c1acb
parent 413ed3e749abe30cd3cee97f9cb269519b46ab82
Author: Simon Kornblith <simon@simonster.com>
Date:   Thu, 18 Aug 2011 15:29:13 +0000

Ask before importing files on double-click


Diffstat:
Mchrome/locale/en-US/zotero/zotero.properties | 3+++
Mcomponents/zotero-service.js | 16+++++++++++-----
2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties @@ -409,6 +409,9 @@ ingester.importReferRISDialog.title = Zotero RIS/Refer Import ingester.importReferRISDialog.text = Do you want to import items from "%1$S" into Zotero?\n\nYou can disable automatic RIS/Refer import in the Zotero preferences. ingester.importReferRISDialog.checkMsg = Always allow for this site +ingester.importFile.title = Import File +ingester.importFile.text = Do you want to import the file "%S"?\n\nItems will be added to a new collection. + db.dbCorrupted = The Zotero database '%S' appears to have become corrupted. db.dbCorrupted.restart = Please restart %S to attempt an automatic restore from the last backup. db.dbCorruptedNoBackup = The Zotero database '%S' appears to have become corrupted, and no automatic backup is available.\n\nA new database file has been created. The damaged file was saved in your Zotero directory. diff --git a/components/zotero-service.js b/components/zotero-service.js @@ -380,11 +380,17 @@ ZoteroCommandLineHandler.prototype = { // Install CSL file this.Zotero.Styles.install(file); } else { - // Show file import dialog - var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - var browserWindow = wm.getMostRecentWindow("navigator:browser"); - browserWindow.Zotero_File_Interface.importFile(file); + // Ask before importing + if(Components.classes["@mozilla.org/embedcomp/prompt-service;1"] + .getService(Components.interfaces.nsIPromptService) + .confirm(null, this.Zotero.getString('ingester.importFile.title'), + this.Zotero.getString('ingester.importFile.text', [file.leafName]))) { + // Perform file import in front window + var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] + .getService(Components.interfaces.nsIWindowMediator); + var browserWindow = wm.getMostRecentWindow("navigator:browser"); + browserWindow.Zotero_File_Interface.importFile(file); + } } } }