11import org.kde.kirigami as Kirigami
15 property alias model: jobController.model
16 property alias index: jobController.index
18 readonly property alias state: jobController.state
19 readonly property alias job: jobController.job
21 implicitHeight: mainLoader.implicitHeight
24 jobController.configure()
27 PurposeJobController {
36 switch (jobController.state) {
37 case PurposeJobController.Configuring:
39 case PurposeJobController.Running:
53 anchors.centerIn: parent
65 Layout.leftMargin:
Kirigami.Units.largeSpacing
66 Layout.rightMargin:
Kirigami.Units.largeSpacing
67 Layout.topMargin:
Kirigami.Units.largeSpacing
69 Layout.fillHeight:
true
70 Layout.fillWidth:
true
72 Component.onCompleted: setSource(jobController.configuration.configSourceCode, jobController.configuration.data)
75 var initialData = jobController.configuration.data;
76 for (var i in jobController.configuration.neededArguments) {
77 var arg = jobController.configuration.neededArguments[i];
78 if (arg in configLoader.item) {
79 item[arg +
"Changed"].connect(dataHasChanged);
80 initialData[arg] = item[arg];
82 console.warn(
"property not found", arg);
85 jobController.configuration.data = initialData;
88 function dataHasChanged() {
89 var jobData = jobController.configuration.data;
90 for (var i in jobController.configuration.neededArguments) {
91 var arg = jobController.configuration.neededArguments[i];
92 if (arg in configLoader.item) {
93 jobData[arg] = configLoader.item[arg];
95 console.warn(
"property not found", arg);
97 jobController.configuration.data = jobData;
102 textFormat:
Text.PlainText
103 Layout.fillWidth:
true
104 Layout.fillHeight:
true
105 horizontalAlignment:
Text.AlignHCenter
106 verticalAlignment:
Text.AlignVCenter
107 visible: configLoader.status === Loader.Error
108 wrapMode:
Text.WordWrap
109 text: configLoader.status === Loader.Error
110 ?
i18nd(
"libpurpose6_quick",
"Failed to load the configuration page for this action:\n\n%1", configLoader.sourceComponent.errorString())
123 text:
i18nd(
"libpurpose6_quick",
"Send")
124 icon.
name:
"document-send"
125 enabled: jobController.configuration
126 && jobController.configuration.isReady
127 onClicked: jobController.startJob()
131 text:
i18nd(
"libpurpose6_quick",
"Cancel")
132 icon.
name:
"dialog-cancel"
133 onClicked: jobController.
cancel()
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
QString name(StandardAction id)