commit 17466694bbe630cdb28ba8698520089407f51c88
parent add7bef0be852b545a9ee348ddbef6b786c4451f
Author: Simon Kornblith <simon@simonster.com>
Date: Tue, 30 Nov 2010 20:59:21 +0000
fix error message display during Standalone startup
Diffstat:
3 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js
@@ -100,8 +100,14 @@ var ZoteroPane = new function()
*/
function onLoad()
{
- if (!Zotero || !Zotero.initialized) {
- return;
+ if (!Zotero) return;
+ if (!Zotero.initialized) {
+ if(Zotero.isStandalone) {
+ _loaded = true;
+ this.toggleDisplay();
+ } else {
+ return;
+ }
}
if (Zotero.locked) {
@@ -214,11 +220,6 @@ var ZoteroPane = new function()
if (Zotero.Prefs.get('debugShowDuplicates')) {
document.getElementById('zotero-tb-actions-showDuplicates').hidden = false;
}
-
- if(Zotero.isStandalone) {
- this.toggleDisplay(true);
- this.fullScreen(true);
- }
}
@@ -313,7 +314,7 @@ var ZoteroPane = new function()
/*
* Hides/displays the Zotero interface
*/
- function toggleDisplay(forceVisible)
+ function toggleDisplay()
{
if (!ZoteroPane.loaded) {
if (Zotero.locked) {
@@ -336,7 +337,9 @@ var ZoteroPane = new function()
var isCollapsed = true;
}
- var makeVisible = forceVisible || isHidden || isCollapsed;
+ if (isHidden || isCollapsed || Zotero.isStandalone) {
+ var makeVisible = true;
+ }
// If Zotero not initialized, try to get the error handler
// or load the default error page
@@ -364,7 +367,6 @@ var ZoteroPane = new function()
}
else {
if(Zotero.isStandalone) window.close();
-
// TODO: Add a better error page/window here with reporting
// instructions
// window.loadURI('chrome://zotero/content/error.xul');
diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul
@@ -512,9 +512,11 @@
var errMsg = stringBundle.GetStringFromName('startupError');
}
- icon.setAttribute('tooltiptext', errMsg);
- icon.setAttribute('error', 'true');
- icon.setAttribute('hidden', false);
+ if(icon) {
+ icon.setAttribute('tooltiptext', errMsg);
+ icon.setAttribute('error', 'true');
+ icon.setAttribute('hidden', false);
+ }
}
// Used for loading pages from upgrade wizard
diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js
@@ -417,7 +417,7 @@ var Zotero = new function(){
Zotero.getString('startupError.checkPermissions')
]);
this.startupError = msg;
- } else if(e.name == "NS_ERROR_STORAGE_BUSY") {
+ } else if(e.name == "NS_ERROR_STORAGE_BUSY" || e.result == 2153971713) {
var msg = Zotero.localeJoin([
Zotero.getString('startupError.databaseInUse'),
Zotero.getString(Zotero.isStandalone ? 'startupError.closeFirefox' : 'startupError.closeStandalone')