Bring Check for Updates to front if re-triggered, unify functions (#3861)
This commit is contained in:
parent
0b04a518e7
commit
009f2a5607
4 changed files with 18 additions and 7 deletions
|
@ -739,7 +739,8 @@ const ZoteroStandalone = new function() {
|
||||||
* Checks for updates
|
* Checks for updates
|
||||||
*/
|
*/
|
||||||
this.checkForUpdates = function() {
|
this.checkForUpdates = function() {
|
||||||
window.open('chrome://zotero/content/update/updates.xhtml', 'updateChecker', 'chrome,centerscreen');
|
Zotero.debug('ZoteroStandalone.checkForUpdates is deprecated -- use Zotero.openCheckForUpdatesWindow() instead');
|
||||||
|
Zotero.openCheckForUpdatesWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1337,7 +1337,7 @@ Zotero.Sync.Runner_Module = function (options = {}) {
|
||||||
e.errorType = 'warning';
|
e.errorType = 'warning';
|
||||||
e.dialogButtonText = Zotero.getString('general.checkForUpdates');
|
e.dialogButtonText = Zotero.getString('general.checkForUpdates');
|
||||||
e.dialogButtonCallback = () => {
|
e.dialogButtonCallback = () => {
|
||||||
Zotero.openCheckForUpdatesWindow();
|
Zotero.openCheckForUpdatesWindow({ modal: true });
|
||||||
};
|
};
|
||||||
e.dialogButton2Text = Zotero.getString('general.moreInformation');
|
e.dialogButton2Text = Zotero.getString('general.moreInformation');
|
||||||
e.dialogButton2Callback = () => {
|
e.dialogButton2Callback = () => {
|
||||||
|
|
|
@ -649,7 +649,7 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
||||||
|
|
||||||
// "Check for Update" button
|
// "Check for Update" button
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
Zotero.openCheckForUpdatesWindow();
|
Zotero.openCheckForUpdatesWindow({ modal: true });
|
||||||
}
|
}
|
||||||
// Load More Info page
|
// Load More Info page
|
||||||
else if (index == 2) {
|
else if (index == 2) {
|
||||||
|
@ -973,9 +973,19 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.openCheckForUpdatesWindow = function () {
|
this.openCheckForUpdatesWindow = function ({ modal } = {}) {
|
||||||
Services.ww.openWindow(null, 'chrome://zotero/content/update/updates.xhtml',
|
let win = Services.wm.getMostRecentWindow('Update:Wizard');
|
||||||
'updateChecker', 'chrome,centerscreen,modal', null);
|
if (win) {
|
||||||
|
win.focus();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let flags = 'chrome,centerscreen';
|
||||||
|
if (modal) {
|
||||||
|
flags += ',modal';
|
||||||
|
}
|
||||||
|
Services.ww.openWindow(null, 'chrome://zotero/content/update/updates.xhtml',
|
||||||
|
'updateChecker', flags, null);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -772,7 +772,7 @@
|
||||||
<menuitem id="checkForUpdates"
|
<menuitem id="checkForUpdates"
|
||||||
accesskey="&helpCheckForUpdates.accesskey;"
|
accesskey="&helpCheckForUpdates.accesskey;"
|
||||||
label="&helpCheckForUpdates.label;"
|
label="&helpCheckForUpdates.label;"
|
||||||
oncommand="ZoteroStandalone.checkForUpdates();"/>
|
oncommand="Zotero.openCheckForUpdatesWindow();"/>
|
||||||
<menuitem id="aboutName"
|
<menuitem id="aboutName"
|
||||||
accesskey="&aboutProduct.accesskey;"
|
accesskey="&aboutProduct.accesskey;"
|
||||||
label="&aboutProduct.label;"
|
label="&aboutProduct.label;"
|
||||||
|
|
Loading…
Reference in a new issue