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
10 10
11(function() { // BEGIN LOCAL_SCOPE11(function() { // BEGIN LOCAL_SCOPE
12 12
13//check if script already running.
14var scriptData = ScriptDiscoveryService.getRunning();
15var scripts = scriptData.filter(function (datum) { return datum.name === 'debugWindow.js'; });
16if (scripts.length >= 2) {
17 //2nd instance of the script is too much
18 return;
19}
20
13// Set up the qml ui21// Set up the qml ui
14var qml = Script.resolvePath('debugWindow.qml');22var qml = Script.resolvePath('debugWindow.qml');
23
15var window = new OverlayWindow({24var window = new OverlayWindow({
16 title: 'Debug Window',25 title: 'Debug Window',
17 source: qml,26 source: qml,
18 width: 400, height: 900,27 width: 400, height: 900,
19});28});
29
20window.setPosition(25, 50);30window.setPosition(25, 50);
21window.closed.connect(function() { Script.stop(); });31window.closed.connect(function() { Script.stop(); });
22 32