diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js index 0cfa35dc54..c2744ec87d 100644 --- a/chrome/content/zotero/preferences/preferences.js +++ b/chrome/content/zotero/preferences/preferences.js @@ -59,11 +59,7 @@ var Zotero_Preferences = { } }, - openHelpLink: function () { - var url = "http://www.zotero.org/support/preferences/"; - var helpTopic = document.getElementsByTagName("prefwindow")[0].currentPane.helpTopic; - url += helpTopic; - + openURL: function (url, windowName) { // Non-instantApply prefwindows are usually modal, so we can't open in the topmost window, // since it's probably behind the window var instantApply = Zotero.Prefs.get("browser.preferences.instantApply", true); @@ -88,7 +84,7 @@ var Zotero_Preferences = { var win = ww.openWindow( window, url, - "helpWindow", + windowName ? windowName : null, "chrome=no,menubar=yes,location=yes,toolbar=yes,personalbar=yes,resizable=yes,scrollbars=yes,status=yes", null ); @@ -96,6 +92,14 @@ var Zotero_Preferences = { } }, + openHelpLink: function () { + var url = "http://www.zotero.org/support/preferences/"; + var helpTopic = document.getElementsByTagName("prefwindow")[0].currentPane.helpTopic; + url += helpTopic; + + this.openURL(url, "helpWindow"); + }, + /** * Opens a URI in the basic viewer in Standalone, or a new window in Firefox diff --git a/chrome/content/zotero/preferences/preferences_advanced.js b/chrome/content/zotero/preferences/preferences_advanced.js index a7eed4fc3b..4535c51d5b 100644 --- a/chrome/content/zotero/preferences/preferences_advanced.js +++ b/chrome/content/zotero/preferences/preferences_advanced.js @@ -191,34 +191,37 @@ Zotero_Preferences.Advanced = { var useDataDir = Zotero.Prefs.get('useDataDir'); // If triggered from the Choose button, don't show the dialog, since - // Zotero.chooseZoteroDirectory() shows its own + // Zotero.chooseZoteroDirectory() (called below due to the radio button + // change) shows its own if (event.originalTarget && event.originalTarget.tagName == 'button') { return true; } - // Fx3.6 - else if (event.explicitOriginalTarget && event.explicitOriginalTarget.tagName == 'button') { - return true; - } - // If directory not set or invalid, prompt for location - if (!this.getDataDirPath()) { + // If changing from default to custom + if (!useDataDir) { event.stopPropagation(); - var file = Zotero.chooseZoteroDirectory(true); + var file = Zotero.chooseZoteroDirectory(true, false, function () { + Zotero_Preferences.openURL('http://zotero.org/support/zotero_data'); + }); radiogroup.selectedIndex = file ? 1 : 0; return !!file; } var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); - var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING) - + (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL); - var app = Zotero.isStandalone ? Zotero.getString('app.standalone') : Zotero.getString('app.firefox'); + var buttonFlags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING + + ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL + + ps.BUTTON_POS_2 * ps.BUTTON_TITLE_IS_STRING; + var app = Zotero.appName; var index = ps.confirmEx(window, Zotero.getString('general.restartRequired'), - Zotero.getString('general.restartRequiredForChange', app), + Zotero.getString('general.restartRequiredForChange', app) + '\n\n' + + Zotero.getString('dataDir.moveFilesToNewLocation', app), buttonFlags, - Zotero.getString('general.restartNow'), - null, null, null, {}); + Zotero.getString('general.quitApp', app), + null, + Zotero.getString('general.moreInformation'), + null, {}); if (index == 0) { useDataDir = !!radiogroup.selectedIndex; @@ -226,8 +229,10 @@ Zotero_Preferences.Advanced = { Zotero.Prefs.set('useDataDir', useDataDir); var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"] .getService(Components.interfaces.nsIAppStartup); - appStartup.quit(Components.interfaces.nsIAppStartup.eAttemptQuit - | Components.interfaces.nsIAppStartup.eRestart); + appStartup.quit(Components.interfaces.nsIAppStartup.eAttemptQuit); + } + else if (index == 2) { + Zotero_Preferences.openURL('http://zotero.org/support/zotero_data'); } radiogroup.selectedIndex = useDataDir ? 1 : 0; diff --git a/chrome/content/zotero/preferences/preferences_advanced.xul b/chrome/content/zotero/preferences/preferences_advanced.xul index d6cfad2653..e95bc6aa8b 100644 --- a/chrome/content/zotero/preferences/preferences_advanced.xul +++ b/chrome/content/zotero/preferences/preferences_advanced.xul @@ -198,6 +198,8 @@ + +