From c9400c565cc8942f333e3f1930efac65cd67e330 Mon Sep 17 00:00:00 2001 From: Tom Najdek Date: Wed, 6 Jul 2022 22:47:22 +0200 Subject: [PATCH] Mendeley import: detect win close, better feedback * Detect wizard cancel/close and interrupt import. This will still have to wait for current fetch (file or metadata) to complete but will then advance to the cleanup stage * Advance progress bar during metadata fetch * Add some extra logging --- chrome/content/zotero/import/importWizard.js | 7 +- chrome/content/zotero/import/importWizard.xul | 1 + .../import/mendeley/mendeleyAPIUtils.js | 4 +- .../zotero/import/mendeley/mendeleyImport.js | 96 ++++++++++++++----- 4 files changed, 84 insertions(+), 24 deletions(-) diff --git a/chrome/content/zotero/import/importWizard.js b/chrome/content/zotero/import/importWizard.js index 9b9c3d2ecf..48b1c83cb2 100644 --- a/chrome/content/zotero/import/importWizard.js +++ b/chrome/content/zotero/import/importWizard.js @@ -57,7 +57,12 @@ var Zotero_Import_Wizard = { Zotero.Translators.init(); // async }, - + + onCancel: function () { + if (this._translation && this._translation.interrupt) { + this._translation.interrupt(); + } + }, onModeChosen: async function () { var wizard = this._wizard; diff --git a/chrome/content/zotero/import/importWizard.xul b/chrome/content/zotero/import/importWizard.xul index c4eed4c818..4fc12adaf7 100644 --- a/chrome/content/zotero/import/importWizard.xul +++ b/chrome/content/zotero/import/importWizard.xul @@ -10,6 +10,7 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" title="&zotero.import;" + onwizardcancel="Zotero_Import_Wizard.onCancel()" onload="Zotero_Import_Wizard.init()">