Debian Codegraph @

src/app/qml/dialogs/ExtractingDialog.qml

raw
1 import QtQuick 2.4
2 import Lomiri.Components 1.3
3 import Lomiri.Components.Popups 1.3
4
5 Dialog {
6 id: dialog
7 modal: true
8 property string fileName: ""
9 property var archives
10
11 Row {
12 id: row
13 width: parent.width
14 spacing: units.gu(2)
15
16 ActivityIndicator {
17 id: loadingSpinner
18 running: true
19 anchors.verticalCenter: parent.verticalCenter
20 }
21
22 Label {
23 text: i18n.tr("Extracting archive '%1'").arg(fileName)
24 color: theme.palette.normal.backgroundSecondaryText
25 anchors.verticalCenter: parent.verticalCenter
26 width: row.width - loadingSpinner.width - row.spacing
27 maximumLineCount: 2
28 wrapMode: Text.WrapAnywhere
29 elide: Text.ElideRight
30 }
31 }
32
33 Button {
34 id: okButton
35 text: i18n.tr("OK")
36 visible: false
37 onClicked: {
38 PopupUtils.close(dialog)
39 }
40 }
41
42 Button {
43 id: cancelButton
44 text: i18n.tr("Cancel")
45 visible: true
46 onClicked: {
47 archives.cancelArchiveExtraction()
48 }
49 }
50
51 Connections {
52 target: archives
53 onFinished: {
54 if (success) {
55 PopupUtils.close(dialog)
56 } else {
57 row.visible = false
58 cancelButton.visible = false
59 title = i18n.tr("Extracting failed")
60 text = i18n.tr("Extracting the archive '%1' failed.").arg(fileName)
61 okButton.visible = true
62 }
63 }
64 }
65 }