Give option to use default Standalone location when a <2.1b3 directory is selected
This commit is contained in:
parent
2f802fe74d
commit
d359974bb7
1 changed files with 25 additions and 8 deletions
|
@ -471,36 +471,53 @@ var Zotero = new function(){
|
||||||
var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"]
|
var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"]
|
||||||
.getService(Components.interfaces.nsIAppStartup);
|
.getService(Components.interfaces.nsIAppStartup);
|
||||||
|
|
||||||
|
var dir = Zotero.getProfileDirectory();
|
||||||
|
dir.append('zotero');
|
||||||
|
|
||||||
var zs = Zotero.getString('app.standalone');
|
var zs = Zotero.getString('app.standalone');
|
||||||
var zf = Zotero.getString('app.firefox');
|
var zf = Zotero.getString('app.firefox');
|
||||||
// TODO: localize
|
// TODO: localize
|
||||||
var msg = zs + " can share a data directory only with "
|
var msg = "The currently selected data directory is not compatible "
|
||||||
+ zf + " 2.1b3 or later. Upgrade to the latest "
|
+ "with " + zs + ", which can share a database only with "
|
||||||
+ "version of " + zf + " or select a different data "
|
+ zf + " 2.1b3 or later."
|
||||||
+ "directory for use with " + zs + ".";
|
+ "\n\n"
|
||||||
|
+ "Upgrade to the latest version of " + zf + " first or select a "
|
||||||
|
+ "different data directory for use with " + zs + ".";
|
||||||
|
|
||||||
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||||
.createInstance(Components.interfaces.nsIPromptService);
|
.createInstance(Components.interfaces.nsIPromptService);
|
||||||
var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING)
|
var 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_1_DEFAULT;
|
+ (ps.BUTTON_POS_2) * (ps.BUTTON_TITLE_IS_STRING)
|
||||||
|
+ ps.BUTTON_POS_2_DEFAULT;
|
||||||
var index = ps.confirmEx(
|
var index = ps.confirmEx(
|
||||||
null,
|
null,
|
||||||
// TODO: localize
|
// TODO: localize
|
||||||
"Incompatible Database Version",
|
"Incompatible Database Version",
|
||||||
msg,
|
msg,
|
||||||
buttonFlags,
|
buttonFlags,
|
||||||
|
"Use Default",
|
||||||
Zotero.getString('dataDir.standaloneMigration.selectCustom'),
|
Zotero.getString('dataDir.standaloneMigration.selectCustom'),
|
||||||
"Quit " + zs,
|
"Quit",
|
||||||
null,
|
|
||||||
null,
|
null,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
|
||||||
var quit = false;
|
var quit = false;
|
||||||
|
|
||||||
// Select new data directory
|
// Default location
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
|
Zotero.File.createDirectoryIfMissing(dir);
|
||||||
|
|
||||||
|
Zotero.Prefs.set("useDataDir", false)
|
||||||
|
|
||||||
|
appStartup.quit(
|
||||||
|
Components.interfaces.nsIAppStartup.eAttemptQuit
|
||||||
|
| Components.interfaces.nsIAppStartup.eRestart
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// Select new data directory
|
||||||
|
else if (index == 1) {
|
||||||
var dir = Zotero.chooseZoteroDirectory(true);
|
var dir = Zotero.chooseZoteroDirectory(true);
|
||||||
if (!dir) {
|
if (!dir) {
|
||||||
quit = true;
|
quit = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue