Chaque script peut utiliser un panneau spécifique de paramètres, écrit en langage Qml, pour régler les options et former une ligne de commande valide.
Ouvrir "Voir les sources" ![]()
Le bouton "Pannel source"
affiche le script du panneau de paramètres courant.
ListElement {
icon: "../../icons/hello.png"
description: "Ten hellos"
command: "./hello.sh"
params: "Hello.qml"
tty: true
help: "Run script \"hello.sh\"."
}
Le script hello.sh sera exécuté depuis le répertoire courant avec des paramètres optionnels construits par Hello.qml.
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Layouts 1.1
import Qt.labs.settings 1.0
Item {
id: page
property int requiredWidth: 150
anchors.fill: parent
anchors.margins: 3
ColumnLayout {
width: parent.width-10
anchors.horizontalCenter: parent.horizontalCenter
spacing: 5
Text {
height: 20
text: "Iterations"
font.bold: true
horizontalAlignment: Qt.AlignHCenter
}
TextField {
id: hellocount
Layout.fillWidth: true
height: 25
text: "10"
validator: IntValidator { bottom: 0; top: 20; }
horizontalAlignment: Qt.AlignHCenter
onTextChanged: sx_scriptargs = text;
}
}
}
La propriété requiredWidth est obligatoire pour définir la largeur du panneau de paramètres. Settings {
property alias hellocount: hellocount.text
}
Les réglages sont stockés dans le fichier : ~/.config/BeRoot/Scriptomatix.conf.