History

Rework as script=only solution

vladest committed 9 years ago

Commit 5e322981 parent 72c4f573 files · +14 −18Browse files

Showing the changes to scripts/developer/debugging/debugWindow.js (1 of 3 files). Show all

Unified · Split

scripts/developer/debugging/debugWindow.js+10−0
@@ -10,13 +10,23 @@ · 9 unmodified lines
1010
1111 (function() { // BEGIN LOCAL_SCOPE
1212
13+//check if script already running.
14+var scriptData = ScriptDiscoveryService.getRunning();
15+var scripts = scriptData.filter(function (datum) { return datum.name === 'debugWindow.js'; });
16+if (scripts.length >= 2) {
17+ //2nd instance of the script is too much
18+ return;
19+}
20+
1321 // Set up the qml ui
1422 var qml = Script.resolvePath('debugWindow.qml');
23+
1524 var window = new OverlayWindow({
1625 title: 'Debug Window',
1726 source: qml,
1827 width: 400, height: 900,
1928 });
29+
2030 window.setPosition(25, 50);
2131 window.closed.connect(function() { Script.stop(); });
2232