Allow immediate retry on partial data dir migration failure
A common cause of this on Windows will likely be open attachment files, so suggest closing those and make retrying the default action.
This commit is contained in:
parent
0668faa584
commit
98e3a9addf
|
@ -1528,7 +1528,8 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
|
||||||
if (errors.length) {
|
if (errors.length) {
|
||||||
let ps = Services.prompt;
|
let ps = Services.prompt;
|
||||||
let buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING)
|
let buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING)
|
||||||
+ (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_IS_STRING);
|
+ (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_IS_STRING)
|
||||||
|
+ (ps.BUTTON_POS_2) * (ps.BUTTON_TITLE_IS_STRING);
|
||||||
let index = ps.confirmEx(null,
|
let index = ps.confirmEx(null,
|
||||||
Zotero.getString('dataDir.migration.failure.title'),
|
Zotero.getString('dataDir.migration.failure.title'),
|
||||||
Zotero.getString('dataDir.migration.failure.partial.text',
|
Zotero.getString('dataDir.migration.failure.partial.text',
|
||||||
|
@ -1538,13 +1539,17 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
|
||||||
+ "\n\n"
|
+ "\n\n"
|
||||||
+ Zotero.getString('dataDir.migration.failure.partial.new', newDir),
|
+ Zotero.getString('dataDir.migration.failure.partial.new', newDir),
|
||||||
buttonFlags,
|
buttonFlags,
|
||||||
|
Zotero.getString('general.tryAgain'),
|
||||||
|
Zotero.getString('general.tryLater'),
|
||||||
Zotero.getString('dataDir.migration.failure.partial.showDirectoriesAndQuit', Zotero.appName),
|
Zotero.getString('dataDir.migration.failure.partial.showDirectoriesAndQuit', Zotero.appName),
|
||||||
Zotero.getString('general.notNow'),
|
null, {}
|
||||||
null, null, {}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Focus the first file/folder in the old directory
|
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
|
return this.checkForDataDirectoryMigration(newDir, newDir);
|
||||||
|
}
|
||||||
|
// Focus the first file/folder in the old directory
|
||||||
|
else if (index == 2) {
|
||||||
try {
|
try {
|
||||||
let it = new OS.File.DirectoryIterator(oldDir);
|
let it = new OS.File.DirectoryIterator(oldDir);
|
||||||
let entry;
|
let entry;
|
||||||
|
|
|
@ -57,6 +57,8 @@ general.keys.ctrlShift = Ctrl+Shift+
|
||||||
general.keys.cmdShift = Cmd+Shift+
|
general.keys.cmdShift = Cmd+Shift+
|
||||||
general.dontShowAgain = Don’t Show Again
|
general.dontShowAgain = Don’t Show Again
|
||||||
general.fix = Fix…
|
general.fix = Fix…
|
||||||
|
general.tryAgain = Try Again
|
||||||
|
general.tryLater = Try Later
|
||||||
|
|
||||||
general.operationInProgress = A Zotero operation is currently in progress.
|
general.operationInProgress = A Zotero operation is currently in progress.
|
||||||
general.operationInProgress.waitUntilFinished = Please wait until it has finished.
|
general.operationInProgress.waitUntilFinished = Please wait until it has finished.
|
||||||
|
@ -134,15 +136,15 @@ 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.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.inProgress = Migration in progress — do not interrupt…
|
||||||
dataDir.migration.failure.title = Data Directory Migration Error
|
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.text = Some files in your old %1$S data directory could not be transferred to the new location. Close any open attachment files and try again. You can also quit %2$S and attempt to move the remaining files manually.
|
||||||
dataDir.migration.failure.partial.old = Old directory: %S
|
dataDir.migration.failure.partial.old = Old directory: %S
|
||||||
dataDir.migration.failure.partial.new = New directory: %S
|
dataDir.migration.failure.partial.new = New directory: %S
|
||||||
dataDir.migration.failure.partial.showDirectoriesAndQuit = Show Directories and Quit %S
|
dataDir.migration.failure.partial.showDirectoriesAndQuit = Show Directories and Quit
|
||||||
dataDir.migration.failure.full.text1 = Your data directory could not be migrated.
|
dataDir.migration.failure.full.text1 = Your data directory could not be migrated.
|
||||||
dataDir.migration.failure.full.text2 = It is recommended that you close %S and manually move your data directory to the new default location.
|
dataDir.migration.failure.full.text2 = It is recommended that you close %S and manually move your data directory to the new default location.
|
||||||
dataDir.migration.failure.full.current = Current location: %S
|
dataDir.migration.failure.full.current = Current location: %S
|
||||||
dataDir.migration.failure.full.recommended = Recommended location: %S
|
dataDir.migration.failure.full.recommended = Recommended location: %S
|
||||||
dataDir.migration.failure.full.showCurrentDirectoryAndQuit = Show Current Directory and Quit %S
|
dataDir.migration.failure.full.showCurrentDirectoryAndQuit = Show Current Directory and Quit
|
||||||
|
|
||||||
app.standalone = Zotero Standalone
|
app.standalone = Zotero Standalone
|
||||||
app.firefox = Zotero for Firefox
|
app.firefox = Zotero for Firefox
|
||||||
|
|
|
@ -158,11 +158,14 @@ describe("Zotero Core Functions", function () {
|
||||||
let stub4 = sinon.stub(Zotero.File, "reveal").returns(Zotero.Promise.resolve());
|
let stub4 = sinon.stub(Zotero.File, "reveal").returns(Zotero.Promise.resolve());
|
||||||
let stub5 = sinon.stub(Zotero.Utilities.Internal, "quitZotero");
|
let stub5 = sinon.stub(Zotero.Utilities.Internal, "quitZotero");
|
||||||
|
|
||||||
var promise = waitForDialog();
|
var promise2;
|
||||||
|
// Click "Try Again" the first time, and then "Show Directories and Quit Zotero"
|
||||||
|
var promise = waitForDialog(function () {
|
||||||
|
promise2 = waitForDialog(null, 'extra1');
|
||||||
|
});
|
||||||
yield Zotero.checkForDataDirectoryMigration(oldDir, newDir);
|
yield Zotero.checkForDataDirectoryMigration(oldDir, newDir);
|
||||||
Zotero.debug("Waiting for dialog");
|
|
||||||
yield promise;
|
yield promise;
|
||||||
Zotero.debug("Done waiting for dialog");
|
yield promise2;
|
||||||
|
|
||||||
assert.isTrue(stub4.calledTwice);
|
assert.isTrue(stub4.calledTwice);
|
||||||
assert.isTrue(stub4.getCall(0).calledWith(oldStorageDir));
|
assert.isTrue(stub4.getCall(0).calledWith(oldStorageDir));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user