on b83f384 help sign in
unity8/qml/Components/ModeSwitchWarningDialog.qml
74 lines 1.8 kB history raw
1import QtQuick 2.4
2import QtQuick.Layouts 1.1
3import Ubuntu.Components 1.2
4import Ubuntu.Components.ListItems 1.2
5import Ubuntu.Components.Popups 1.2
7Dialog {
8 id: root
10 property alias model: appRepeater.model
12 signal forceClose();
14 Label {
15 text: i18n.tr("Apps may have unsaved data:")
16 fontSize: "large"
17 }
19 Repeater {
20 id: appRepeater
21 RowLayout {
22 spacing: units.gu(2)
23 Image {
24 Layout.preferredHeight: units.gu(2)
25 Layout.preferredWidth: units.gu(2)
26 source: model.icon
27 sourceSize.width: width
28 sourceSize.height: height
29 }
30 Label {
31 Layout.fillWidth: true
32 text: model.name
33 }
34 }
35 }
37 Label {
38 text: i18n.tr("Re-dock, save your work and close these apps to continue.")
39 wrapMode: Text.WordWrap
40 }
42 Label {
43 text: i18n.tr("Or force close now (unsaved data will be lost).")
44 wrapMode: Text.WordWrap
45 }
47 ThinDivider {}
49 RowLayout {
50 Label {
51 objectName: "reconnectLabel"
52 Layout.fillWidth: true
53 property bool clicked: false
54 property string notClickedText: i18n.tr("OK, I will reconnect")
55 property string clickedText: i18n.tr("Reconnect now!")
56 text: clicked ? clickedText : notClickedText
58 MouseArea {
59 anchors.fill: parent
60 onClicked: parent.clicked = true;
61 }
62 }
64 Button {
65 objectName: "forceCloseButton"
66 text: i18n.tr("Close all")
67 color: UbuntuColors.red
68 onClicked: {
69 root.forceClose();
70 PopupUtils.close(root);
71 }
72 }
73 }