Use Zotero.startupError for connector-related errors and use the DB busy error if Zotero switched to
connector mode and then couldn't contact the connector.
This commit is contained in:
parent
c24aad3af4
commit
3e26c36b69
2 changed files with 25 additions and 19 deletions
|
@ -178,7 +178,12 @@ var ZoteroOverlay = new function()
|
|||
* Hides/displays the Zotero interface
|
||||
*/
|
||||
this.toggleDisplay = function(makeVisible)
|
||||
{
|
||||
{
|
||||
if(!Zotero || !Zotero.initialized) {
|
||||
ZoteroPane.displayStartupError();
|
||||
return;
|
||||
}
|
||||
|
||||
if(makeVisible || makeVisible === undefined) {
|
||||
if(Zotero.isConnector) {
|
||||
// If in connector mode, bring Zotero Standalone to foreground
|
||||
|
@ -191,11 +196,6 @@ var ZoteroOverlay = new function()
|
|||
}
|
||||
}
|
||||
|
||||
if(!Zotero || !Zotero.initialized) {
|
||||
ZoteroPane.displayStartupError();
|
||||
return;
|
||||
}
|
||||
|
||||
if(makeVisible === undefined) makeVisible = zoteroPane.hidden || zoteroPane.collapsed;
|
||||
|
||||
zoteroSplitter.setAttribute('hidden', !makeVisible);
|
||||
|
|
|
@ -24,23 +24,29 @@
|
|||
*/
|
||||
|
||||
Zotero.Connector_Browser = new function() {
|
||||
var _incompatibleVersionMessageShown;
|
||||
|
||||
/**
|
||||
* Called if Zotero version is determined to be incompatible with Standalone
|
||||
*/
|
||||
this.onIncompatibleStandaloneVersion = function(zoteroVersion, standaloneVersion) {
|
||||
if(_incompatibleVersionMessageShown) return;
|
||||
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].
|
||||
createInstance(Components.interfaces.nsIPromptService);
|
||||
ps.alert(null,
|
||||
Zotero.getString("connector.error.title"),
|
||||
'Zotero '+zoteroVersion+' is incompatible with the running '+
|
||||
Zotero.startupError = 'Zotero for Firefox '+Zotero.version+' is incompatible with the running '+
|
||||
'version of Zotero Standalone'+(standaloneVersion ? " ("+standaloneVersion+")" : "")+
|
||||
'. Zotero Connector will continue to operate, but functionality that relies upon '+
|
||||
'Zotero Standalone may be unavaliable.\n\n'+
|
||||
'Please ensure that you have installed the latest version of these components. See '+
|
||||
'http://www.zotero.org/support/standalone for more details.');
|
||||
_incompatibleVersionMessageShown = true;
|
||||
'.\n\nPlease ensure that you have installed the latest version of these components. See '+
|
||||
'http://www.zotero.org/support/standalone for more details.';
|
||||
Zotero.initialized = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called if connector is offline. This should only happen if Zotero is getting a DB busy
|
||||
* message and no connector is open, so use the DB busy error message here.
|
||||
*/
|
||||
this.onStateChange = function(isOnline) {
|
||||
if(isOnline) return;
|
||||
|
||||
var msg = Zotero.localeJoin([
|
||||
Zotero.getString('startupError.databaseInUse'),
|
||||
Zotero.getString(Zotero.isStandalone ? 'startupError.closeFirefox' : 'startupError.closeStandalone')
|
||||
]);
|
||||
Zotero.startupError = msg;
|
||||
Zotero.initialized = false;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue