commit 0fc3252895b0cd1b2d1213aae6ce822114048ec2
parent ef4a1f9cb7c50013386fb9e127539875a43a881c
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 24 Feb 2010 21:07:23 +0000
Closes #1637, Load "Start" page on upgrade
Show start page when first run pref is on and either the DB was just initialized or there's no username and password in the Sync pane
Diffstat:
3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js
@@ -181,17 +181,19 @@ var ZoteroPane = new function()
}
}, 1000);
}
- // If the database was initialized and Zotero hasn't been run before
- // in this profile, display the Quick Start Guide -- this way the guide
- // won't be displayed when they sync their DB to another profile or if
- // the DB is initialized erroneously (e.g. while switching data
- // directory locations)
- else if (Zotero.Schema.dbInitialized && Zotero.Prefs.get('firstRun')) {
+ // If the database was initialized or there are no sync credentials and
+ // Zotero hasn't been run before in this profile, display the start page
+ // -- this way the page won't be displayed when they sync their DB to
+ // another profile or if the DB is initialized erroneously (e.g. while
+ // switching data directory locations)
+ else if (Zotero.Prefs.get('firstRun2')
+ && (Zotero.Schema.dbInitialized || !Zotero.Sync.Server.enabled)) {
setTimeout(function () {
var url = "http://zotero.org/start";
gBrowser.selectedTab = gBrowser.addTab(url);
}, 400);
- Zotero.Prefs.set('firstRun', false);
+ Zotero.Prefs.set('firstRun2', false);
+ Zotero.Prefs.clear('firstRun');
}
// Hide sync debugging menu by default
diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js
@@ -1309,6 +1309,16 @@ Zotero.Prefs = new function(){
}
+ this.clear = function (pref) {
+ try {
+ this.prefBranch.clearUserPref(pref);
+ }
+ catch (e) {
+ throw ("Invalid preference '" + pref + "'");
+ }
+ }
+
+
//
// Methods to register a preferences observer
//
diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js
@@ -3,7 +3,7 @@
// Add new user-adjustable hidden preferences to
// http://www.zotero.org/documentation/hidden_prefs
-pref("extensions.zotero.firstRun", true);
+pref("extensions.zotero.firstRun2", true);
pref("extensions.zotero@chnm.gmu.edu.description", "chrome://zotero/locale/zotero.properties");
pref("extensions.zotero.useDataDir", false);