8import QtQuick.Layouts 1.1
9import QtQuick.Controls 2.2
10import org.kde.purpose 1.0
16 implicitHeight: currentItem.implicitHeight
18 property bool running: false
19 property alias pluginType: altsModel.pluginType
20 property alias inputData: altsModel.inputData
21 property Component highlight
22 property Component header
23 property Component footer
24 property variant verticalLayoutDirection: ListView.TopToBottom
25 property Component delegate: Component {
27 width: ListView.view.width
29 Layout.fillWidth: true
31 elide: Text.ElideRight
34 text: i18nd("libpurpose6_quick",
"Use")
35 onClicked: createJob(index);
37 Keys.onReturnPressed: createJob(index)
38 Keys.onEnterPressed: createJob(index)
48 signal finished(var output,
int error,
string message)
50 PurposeAlternativesModel {
57 function createJob(index) {
58 stack.push(jobComponent, {index: index})
65 for(; stack.depth>1; stack.pop())
69 initialItem: ListView {
74 implicitHeight: contentHeight
76 verticalLayoutDirection: stack.verticalLayoutDirection
77 delegate: stack.delegate
78 highlight: stack.highlight
91 if (state === PurposeJobController.Finished || state === PurposeJobController.Error) {
92 stack.finished(jobView.job.output, jobView.job.error, jobView.job.errorString);
93 }
else if (state === PurposeJobController.Cancelled) {
98 Component.onCompleted:
start()
Q_SCRIPTABLE Q_NOREPLY void start()