mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into disable-oculus-legacy-on-linux
This commit is contained in:
commit
29fd3e4ea6
1 changed files with 70 additions and 87 deletions
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const electron = require('electron');
|
const electron = require('electron');
|
||||||
const app = electron.app; // Module to control application life.
|
const app = electron.app; // Module to control application life.
|
||||||
const BrowserWindow = electron.BrowserWindow;
|
const BrowserWindow = electron.BrowserWindow;
|
||||||
const nativeImage = electron.nativeImage;
|
const nativeImage = electron.nativeImage;
|
||||||
|
|
||||||
|
@ -57,10 +57,7 @@ function getBuildInfo() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_BUILD_INFO = {
|
const DEFAULT_BUILD_INFO = { releaseType: "", buildIdentifier: "dev" };
|
||||||
releaseType: "",
|
|
||||||
buildIdentifier: "dev"
|
|
||||||
};
|
|
||||||
var buildInfo = DEFAULT_BUILD_INFO;
|
var buildInfo = DEFAULT_BUILD_INFO;
|
||||||
|
|
||||||
if (buildInfoPath) {
|
if (buildInfoPath) {
|
||||||
|
@ -107,7 +104,6 @@ const ipcMain = electron.ipcMain;
|
||||||
|
|
||||||
|
|
||||||
var isShuttingDown = false;
|
var isShuttingDown = false;
|
||||||
|
|
||||||
function shutdown() {
|
function shutdown() {
|
||||||
if (!isShuttingDown) {
|
if (!isShuttingDown) {
|
||||||
// if the home server is running, show a prompt before quit to ask if the user is sure
|
// if the home server is running, show a prompt before quit to ask if the user is sure
|
||||||
|
@ -287,7 +283,8 @@ function openFileBrowser(path) {
|
||||||
// NOTE: this looks like it does nothing, but it's very important.
|
// NOTE: this looks like it does nothing, but it's very important.
|
||||||
// Without it the default behaviour is to quit the app once all windows closed
|
// Without it the default behaviour is to quit the app once all windows closed
|
||||||
// which is absolutely not what we want for a taskbar application.
|
// which is absolutely not what we want for a taskbar application.
|
||||||
app.on('window-all-closed', function() {});
|
app.on('window-all-closed', function() {
|
||||||
|
});
|
||||||
|
|
||||||
function startInterface(url) {
|
function startInterface(url) {
|
||||||
var argArray = [];
|
var argArray = [];
|
||||||
|
@ -323,11 +320,7 @@ LogWindow.prototype = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
this.window = new BrowserWindow({
|
this.window = new BrowserWindow({ width: 700, height: 500, icon: appIcon });
|
||||||
width: 700,
|
|
||||||
height: 500,
|
|
||||||
icon: appIcon
|
|
||||||
});
|
|
||||||
this.window.loadURL('file://' + __dirname + '/log.html');
|
this.window.loadURL('file://' + __dirname + '/log.html');
|
||||||
|
|
||||||
if (!debug) {
|
if (!debug) {
|
||||||
|
@ -374,7 +367,7 @@ function isStackManagerContentPresent() {
|
||||||
|
|
||||||
if (stats.isFile()) {
|
if (stats.isFile()) {
|
||||||
console.log("Stack Manager entities file discovered at " + modelsPath)
|
console.log("Stack Manager entities file discovered at " + modelsPath)
|
||||||
// we found a content file
|
// we found a content file
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -488,72 +481,70 @@ function buildMenuArray(serverState) {
|
||||||
var menuArray = null;
|
var menuArray = null;
|
||||||
|
|
||||||
if (isShuttingDown) {
|
if (isShuttingDown) {
|
||||||
menuArray = [{
|
menuArray = [
|
||||||
label: "Shutting down...",
|
{
|
||||||
enabled: false
|
label: "Shutting down...",
|
||||||
}];
|
enabled: false
|
||||||
|
}
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
menuArray = [{
|
menuArray = [
|
||||||
label: 'Server - Stopped',
|
{
|
||||||
enabled: false
|
label: 'Server - Stopped',
|
||||||
}, {
|
enabled: false
|
||||||
label: 'Version - ' + buildInfo.buildIdentifier,
|
|
||||||
enabled: false
|
|
||||||
}, {
|
|
||||||
type: 'separator'
|
|
||||||
}, {
|
|
||||||
label: 'Go Home',
|
|
||||||
click: goHomeClicked,
|
|
||||||
enabled: false
|
|
||||||
}, {
|
|
||||||
type: 'separator'
|
|
||||||
}, {
|
|
||||||
label: 'Start Server',
|
|
||||||
click: function() {
|
|
||||||
homeServer.restart();
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
label: 'Stop Server',
|
|
||||||
visible: false,
|
|
||||||
click: function() {
|
|
||||||
homeServer.stop();
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
label: 'Settings',
|
|
||||||
click: function() {
|
|
||||||
shell.openExternal('http://localhost:40100/settings');
|
|
||||||
},
|
},
|
||||||
enabled: false
|
{
|
||||||
}, {
|
type: 'separator'
|
||||||
label: 'View Logs',
|
},
|
||||||
click: function() {
|
{
|
||||||
logWindow.open();
|
label: 'Go Home',
|
||||||
|
click: goHomeClicked,
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separator'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Start Server',
|
||||||
|
click: function() { homeServer.restart(); }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Stop Server',
|
||||||
|
visible: false,
|
||||||
|
click: function() { homeServer.stop(); }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Settings',
|
||||||
|
click: function() { shell.openExternal('http://localhost:40100/settings'); },
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'View Logs',
|
||||||
|
click: function() { logWindow.open(); }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separator'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Share',
|
||||||
|
click: function() { shell.openExternal('http://localhost:40100/settings/?action=share') }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separator'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Quit',
|
||||||
|
accelerator: 'Command+Q',
|
||||||
|
click: function() { shutdown(); }
|
||||||
}
|
}
|
||||||
}, {
|
];
|
||||||
type: 'separator'
|
|
||||||
}, {
|
|
||||||
label: 'Share',
|
|
||||||
click: function() {
|
|
||||||
shell.openExternal('http://localhost:40100/settings/?action=share')
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
type: 'separator'
|
|
||||||
}, {
|
|
||||||
label: 'Quit',
|
|
||||||
accelerator: 'Command+Q',
|
|
||||||
click: function() {
|
|
||||||
shutdown();
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
|
|
||||||
var foundStackManagerContent = isStackManagerContentPresent();
|
var foundStackManagerContent = isStackManagerContentPresent();
|
||||||
if (foundStackManagerContent) {
|
if (foundStackManagerContent) {
|
||||||
// add a separator and the stack manager content migration option
|
// add a separator and the stack manager content migration option
|
||||||
menuArray.splice(menuArray.length - 1, 0, {
|
menuArray.splice(menuArray.length - 1, 0, {
|
||||||
label: 'Migrate Stack Manager Content',
|
label: 'Migrate Stack Manager Content',
|
||||||
click: function() {
|
click: function() { promptToMigrateContent(); }
|
||||||
promptToMigrateContent();
|
|
||||||
}
|
|
||||||
}, {
|
}, {
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
});
|
});
|
||||||
|
@ -652,13 +643,9 @@ function maybeInstallDefaultContentSet(onComplete) {
|
||||||
|
|
||||||
electron.ipcMain.on('ready', function() {
|
electron.ipcMain.on('ready', function() {
|
||||||
console.log("got ready");
|
console.log("got ready");
|
||||||
|
|
||||||
function sendStateUpdate(state, args) {
|
function sendStateUpdate(state, args) {
|
||||||
// console.log(state, window, args);
|
// console.log(state, window, args);
|
||||||
window.webContents.send('update', {
|
window.webContents.send('update', { state: state, args: args });
|
||||||
state: state,
|
|
||||||
args: args
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var aborted = false;
|
var aborted = false;
|
||||||
|
@ -682,9 +669,7 @@ function maybeInstallDefaultContentSet(onComplete) {
|
||||||
} else {
|
} else {
|
||||||
sendStateUpdate('installing');
|
sendStateUpdate('installing');
|
||||||
}
|
}
|
||||||
}), {
|
}), { throttle: 250 }).on('progress', function(state) {
|
||||||
throttle: 250
|
|
||||||
}).on('progress', function(state) {
|
|
||||||
if (!aborted) {
|
if (!aborted) {
|
||||||
// Update progress popup
|
// Update progress popup
|
||||||
sendStateUpdate('downloading', state);
|
sendStateUpdate('downloading', state);
|
||||||
|
@ -698,7 +683,7 @@ function maybeInstallDefaultContentSet(onComplete) {
|
||||||
console.log("Done", arguments);
|
console.log("Done", arguments);
|
||||||
sendStateUpdate('complete');
|
sendStateUpdate('complete');
|
||||||
});
|
});
|
||||||
unzipper.on('error', function(err) {
|
unzipper.on('error', function (err) {
|
||||||
console.log("aborting");
|
console.log("aborting");
|
||||||
aborted = true;
|
aborted = true;
|
||||||
req.abort();
|
req.abort();
|
||||||
|
@ -788,7 +773,8 @@ app.on('ready', function() {
|
||||||
var currentVersion = null;
|
var currentVersion = null;
|
||||||
try {
|
try {
|
||||||
currentVersion = parseInt(buildInfo.buildIdentifier);
|
currentVersion = parseInt(buildInfo.buildIdentifier);
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
}
|
||||||
|
|
||||||
if (currentVersion !== null) {
|
if (currentVersion !== null) {
|
||||||
const CHECK_FOR_UPDATES_INTERVAL_SECONDS = 60 * 30;
|
const CHECK_FOR_UPDATES_INTERVAL_SECONDS = 60 * 30;
|
||||||
|
@ -818,9 +804,8 @@ app.on('ready', function() {
|
||||||
if (dsPath && acPath) {
|
if (dsPath && acPath) {
|
||||||
domainServer = new Process('domain-server', dsPath, ["--get-temp-name"], logPath);
|
domainServer = new Process('domain-server', dsPath, ["--get-temp-name"], logPath);
|
||||||
acMonitor = new ACMonitorProcess('ac-monitor', acPath, ['-n6',
|
acMonitor = new ACMonitorProcess('ac-monitor', acPath, ['-n6',
|
||||||
'--log-directory', logPath,
|
'--log-directory', logPath,
|
||||||
'--http-status-port', httpStatusPort
|
'--http-status-port', httpStatusPort], httpStatusPort, logPath);
|
||||||
], httpStatusPort, logPath);
|
|
||||||
homeServer = new ProcessGroup('home', [domainServer, acMonitor]);
|
homeServer = new ProcessGroup('home', [domainServer, acMonitor]);
|
||||||
logWindow = new LogWindow(acMonitor, domainServer);
|
logWindow = new LogWindow(acMonitor, domainServer);
|
||||||
|
|
||||||
|
@ -829,12 +814,10 @@ app.on('ready', function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
// handle process updates
|
// handle process updates
|
||||||
homeServer.on('state-update', function(processGroup) {
|
homeServer.on('state-update', function(processGroup) { updateTrayMenu(processGroup.state); });
|
||||||
updateTrayMenu(processGroup.state);
|
|
||||||
});
|
|
||||||
|
|
||||||
// start the home server
|
// start the home server
|
||||||
homeServer.start();
|
homeServer.start();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue