From 48636701046b182a2c47fbb97172be3e1446c0cd Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 16 Nov 2016 01:07:26 -0500 Subject: [PATCH] =?UTF-8?q?Display=20"Migration=20in=20progress=20?= =?UTF-8?q?=E2=80=94=20do=20not=20interrupt=E2=80=A6"=20during=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Would be nice to have a determinate progress meter on Windows, but that will require enumerating all files, which maybe would just make things slower. Might be safer, though, by discouraging people from force-quitting. --- chrome/content/zotero/xpcom/zotero.js | 8 +++++++- chrome/locale/en-US/zotero/zotero.properties | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 0363627777d..ac1e5962705 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -1466,9 +1466,15 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); partial = true; } + // Not yet used + let progressHandler = function (progress, progressMax) { + this.updateZoteroPaneProgressMeter(Math.round(progress / progressMax)); + }.bind(this); + let errors; try { - errors = yield Zotero.migrateDataDirectory(oldDir, newDir, partial); + this.showZoteroPaneProgressMeter(Zotero.getString("dataDir.migration.inProgress")); + errors = yield Zotero.migrateDataDirectory(oldDir, newDir, partial, progressHandler); } catch (e) { // Complete failure (failed to create new directory, copy marker, or move database) diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 8c22d425a99..147f183979d 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -131,6 +131,7 @@ dataDir.selectedDirEmpty.useNewDir = Use the new directory? dataDir.moveFilesToNewLocation = Be sure to move files from your existing Zotero data directory to the new location before reopening %1$S. dataDir.incompatibleDbVersion.title = Incompatible Database Version dataDir.incompatibleDbVersion.text = The currently selected data directory is not compatible with Zotero Standalone, which can share a database only with Zotero for Firefox 2.1b3 or later.\n\nUpgrade to the latest version of Zotero for Firefox first or select a different data directory for use with Zotero Standalone. +dataDir.migration.inProgress = Migration in progress — do not interrupt… dataDir.migration.failure.title = Data Directory Migration Error dataDir.migration.failure.partial.text = Some files in your old %1$S data directory could not be transferred to the new location. You should close %2$S and attempt to move the remaining files manually. dataDir.migration.failure.partial.old = Old directory: %S