Purpose

JobDialog.qml
1/*
2 SPDX-FileCopyrightText: 2015 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7import QtQuick 2.4
8import QtQuick.Controls 2.2
9import QtQuick.Layouts 1.1
10import org.kde.purpose 1.0
11
12ApplicationWindow
13{
14 id: window
15
16 flags: Qt.Dialog
17
18 title: i18n("Send File")
19
20 width: Math.max(screen.width/6, 200)
21 height: Math.max(screen.height/4, 300)
22
23 property QtObject q
24 property alias model: jobView.model
25 property alias index: jobView.index
26
27 function start() {
28 jobView.start()
29 }
30
31 JobView {
32 id: jobView
33 anchors.fill: parent
34
35 onStateChanged: {
36 if (state === PurposeJobController.Finished || state === PurposeJobController.Error) {
37 console.log(jobView.job.errorString)
38 window.q.finished(jobView.job.output, jobView.job.error, jobView.job.errorString);
40 } else if (state === PurposeJobController.Cancelled) {
41 window.q.finished(null, 1 /* KIO::ERR_USER_CANCELED */, i18nd("libpurpose6_widgets", "Configuration cancelled"));
43 }
44 }
45 }
46}
Q_SCRIPTABLE Q_NOREPLY void start()
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
QWidget * window(QObject *job)
bool close()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:05 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.