on cfcde21 help sign in
unity8/qml/Components/ModeSwitchWarningDialog.qml
95 lines 2.7 kB history raw
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17import QtQuick 2.4
18import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.3
20import Ubuntu.Components.ListItems 1.3
21import Ubuntu.Components.Popups 1.3
23ShellDialog {
24 id: root
25 objectName: "modeSwitchWarningDialog"
27 property alias model: appRepeater.model
29 signal forceClose();
31 Label {
32 text: i18n.tr("Apps may have unsaved data:")
33 fontSize: "large"
34 color: "#5D5D5D"
35 }
37 Repeater {
38 id: appRepeater
39 RowLayout {
40 spacing: units.gu(2)
41 Image {
42 Layout.preferredHeight: units.gu(2)
43 Layout.preferredWidth: units.gu(2)
44 source: model.icon
45 sourceSize.width: width
46 sourceSize.height: height
47 }
48 Label {
49 Layout.fillWidth: true
50 text: model.name
51 color: "#888888"
52 }
53 }
54 }
56 Label {
57 text: i18n.ctr("Re-dock means connect the device again to an external screen/mouse/keyboard", "Re-dock, save your work and close these apps to continue.")
58 wrapMode: Text.WordWrap
59 color: "#888888"
60 }
62 Label {
63 text: i18n.tr("Or force close now (unsaved data will be lost).")
64 wrapMode: Text.WordWrap
65 color: "#888888"
66 }
68 ThinDivider {}
70 RowLayout {
71 Label {
72 objectName: "reconnectLabel"
73 Layout.fillWidth: true
74 property bool clicked: false
75 property string notClickedText: i18n.tr("OK, I will reconnect")
76 property string clickedText: i18n.tr("Reconnect now!")
77 text: clicked ? clickedText : notClickedText
78 color: "#292929"
80 MouseArea {
81 anchors.fill: parent
82 onClicked: parent.clicked = true;
83 }
84 }
86 Button {
87 objectName: "forceCloseButton"
88 text: i18n.tr("Close all")
89 color: theme.palette.normal.negative
90 onClicked: {
91 root.forceClose();
92 }
93 }
94 }