Changeset View
Changeset View
Standalone View
Standalone View
qmlUiKirigami/ShareDialog.qml
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.7 | 20 | import QtQuick 2.7 | ||
21 | import QtQuick.Layouts 1.3 | 21 | import QtQuick.Layouts 1.3 | ||
22 | import QtQuick.Controls 2.1 as Controls | 22 | import QtQuick.Controls 2.0 as Controls | ||
23 | import org.kde.purpose 1.0 as Purpose | 23 | import org.kde.purpose 1.0 as Purpose | ||
24 | import org.kde.kirigami 2.1 as Kirigami | 24 | import org.kde.kirigami 2.1 as Kirigami | ||
25 | 25 | | |||
26 | Kirigami.OverlaySheet | 26 | Controls.Popup { | ||
27 | { | | |||
28 | id: window | 27 | id: window | ||
28 | modal: true | ||||
29 | focus: true | ||||
29 | property alias inputData: view.inputData | 30 | property alias inputData: view.inputData | ||
30 | property bool running: false | 31 | property bool running: false | ||
31 | signal finished(var output, int error, string message) | 32 | signal finished(var output, int error, string message) | ||
33 | width: Kirigami.Units.gridUnit * 25 | ||||
34 | height: Kirigami.Units.gridUnit * 28 | ||||
32 | 35 | | |||
33 | Controls.BusyIndicator { | 36 | Controls.BusyIndicator { | ||
34 | visible: window.running | 37 | visible: window.running | ||
35 | anchors.fill: parent | 38 | anchors.fill: parent | ||
36 | } | 39 | } | ||
37 | 40 | | |||
38 | contentItem: ColumnLayout { | 41 | Rectangle { | ||
39 | height: Kirigami.Units.gridUnit * 16 | 42 | anchors.fill: parent | ||
40 | 43 | color: Kirigami.Theme.viewBackgroundColor | |||
41 | Kirigami.Heading { | | |||
42 | text: window.inputData.mimeType ? i18n("Shares for '%1'", window.inputData.mimeType) : "" | | |||
43 | } | | |||
44 | Purpose.AlternativesView { | 44 | Purpose.AlternativesView { | ||
45 | id: view | 45 | id: view | ||
46 | Layout.fillWidth: true | 46 | anchors.fill:parent | ||
47 | Layout.fillHeight: true | 47 | clip: true | ||
48 | pluginType: "Export" | 48 | pluginType: "Export" | ||
49 | 49 | header: Kirigami.Heading { | |||
50 | text: window.inputData.mimeType ? i18n("Shares for '%1'", window.inputData.mimeType) : "" | ||||
51 | } | ||||
50 | delegate: Kirigami.BasicListItem { | 52 | delegate: Kirigami.BasicListItem { | ||
51 | label: model.display | 53 | label: model.display | ||
52 | icon: "arrow-right" | 54 | icon: "arrow-right" | ||
53 | onClicked: view.createJob (model.index) | 55 | onClicked: view.createJob (model.index) | ||
54 | Keys.onReturnPressed: view.createJob (model.index) | 56 | Keys.onReturnPressed: view.createJob (model.index) | ||
55 | Keys.onEnterPressed: view.createJob (model.index) | 57 | Keys.onEnterPressed: view.createJob (model.index) | ||
56 | } | 58 | } | ||
57 | 59 | | |||
58 | onRunningChanged: window.running = running | 60 | onRunningChanged: window.running = running | ||
59 | onFinished: { | 61 | onFinished: { | ||
60 | window.finished(output, error, message) | 62 | window.finished(output, error, message) | ||
61 | } | 63 | } | ||
62 | } | 64 | } | ||
63 | } | 65 | } | ||
64 | } | 66 | } |