mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 06:09:55 +02:00
Merge pull request #11653 from vladest/fix_sriptslog_multiply_window
Fix scriptslog multiply window
This commit is contained in:
commit
f7eb57a54c
1 changed files with 11 additions and 0 deletions
|
@ -10,13 +10,24 @@
|
||||||
|
|
||||||
(function() { // BEGIN LOCAL_SCOPE
|
(function() { // BEGIN LOCAL_SCOPE
|
||||||
|
|
||||||
|
//check if script already running.
|
||||||
|
var scriptData = ScriptDiscoveryService.getRunning();
|
||||||
|
var scripts = scriptData.filter(function (datum) { return datum.name === 'debugWindow.js'; });
|
||||||
|
if (scripts.length >= 2) {
|
||||||
|
//2nd instance of the script is too much
|
||||||
|
ScriptDiscoveryService.stopScript(scripts[1].url);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Set up the qml ui
|
// Set up the qml ui
|
||||||
var qml = Script.resolvePath('debugWindow.qml');
|
var qml = Script.resolvePath('debugWindow.qml');
|
||||||
|
|
||||||
var window = new OverlayWindow({
|
var window = new OverlayWindow({
|
||||||
title: 'Debug Window',
|
title: 'Debug Window',
|
||||||
source: qml,
|
source: qml,
|
||||||
width: 400, height: 900,
|
width: 400, height: 900,
|
||||||
});
|
});
|
||||||
|
|
||||||
window.setPosition(25, 50);
|
window.setPosition(25, 50);
|
||||||
window.closed.connect(function() { Script.stop(); });
|
window.closed.connect(function() { Script.stop(); });
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue