Skip to content

Commit 5003734

Browse files
committed
Close the plugin, don't kill the engine so it doesn't close all other active plugins
See https://musescore.org/en/node/304874#comment-999964 for context
1 parent 921039d commit 5003734

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

TempoStretch.qml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ import QtQuick 2.2
99
import QtQuick.Controls 1.1
1010
import QtQuick.Controls.Styles 1.3
1111
import QtQuick.Layouts 1.1
12+
import QtQuick.Window 2.2
1213
import Qt.labs.settings 1.0
1314

1415
import MuseScore 3.0
1516

1617
MuseScore {
1718
menuPath: "Plugins.TempoStretch"
18-
version: "1.1.0"
19+
version: "1.2.0"
1920
description: qsTr("Apply a % change to (selected) tempo markers")
2021
pluginType: "dialog"
2122
requiresScore: true
23+
id: 'pluginId'
2224

2325
property int startBPMvalue: 120 // Always as 1/4th == this value
2426
property int beatBaseIndex: 5
@@ -46,7 +48,8 @@ MuseScore {
4648
onRun: {
4749
if ((mscoreMajorVersion == 3) && (mscoreMinorVersion == 0) && (mscoreUpdateVersion < 5)) {
4850
console.log(qsTr("Unsupported MuseScore version.\nTempoStretch needs v3.0.5 or above.\n"));
49-
Qt.quit();
51+
pluginId.parent.Window.window.close();
52+
return;
5053
}
5154
findStartBPM();
5255
// Now show it
@@ -354,20 +357,20 @@ MuseScore {
354357
text: qsTranslate("PrefsDialogBase", "Apply")
355358
onClicked: {
356359
applyTempoStretch();
357-
Qt.quit();
360+
pluginId.parent.Window.window.close();
358361
}
359362
}
360363
}
361364

362365
Keys.onEscapePressed: {
363-
Qt.quit();
366+
pluginId.parent.Window.window.close();
364367
}
365368
Keys.onReturnPressed: {
366369
applyTempoStretch();
367-
Qt.quit();
370+
pluginId.parent.Window.window.close();
368371
}
369372
Keys.onEnterPressed: {
370373
applyTempoStretch();
371-
Qt.quit();
374+
pluginId.parent.Window.window.close();
372375
}
373376
}

0 commit comments

Comments
 (0)