Display "Migration in progress — do not interrupt…" during migration

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.
This commit is contained in:
Dan Stillman 2016-11-16 01:07:26 -05:00
parent 062ff18596
commit 4863670104
2 changed files with 8 additions and 1 deletions

View file

@ -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)

View file

@ -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