2 * Copyright (C) 2016 Canonical Ltd.
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.
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.
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/>.
18import QtQuick.Layouts 1.1
19import Lomiri.Components 1.3
20import Lomiri.SystemSettings.Update 1.0
22import ".." as LocalComponents
26 objectName: "systemUpdatePage"
28 title: i18n.tr("Update Device")
29 forwardButtonSourceComponent: forwardButton
31 skip: !root.updateDownloaded // skip the page when the system update is not ready to install
37 leftMargin: systemUpdatePage.leftMargin
38 rightMargin: systemUpdatePage.rightMargin
39 topMargin: systemUpdatePage.customMargin
42 opacity: spinner.running ? 0.5 : 1
44 LomiriNumberAnimation {}
48 anchors.left: parent.left
49 anchors.right: parent.right
50 anchors.leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
51 font.weight: Font.Light
55 text: i18n.tr("There is a system update available and ready to install. Afterwards, the device will automatically restart.")
61 rowSpacing: units.gu(1)
62 columnSpacing: units.gu(2)
66 Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
67 sourceSize: Qt.size(units.gu(3), units.gu(3))
68 fillMode: Image.PreserveAspectFit
69 source: "image://theme/distributor-logo"
74 font.weight: Font.Normal
76 text: i18n.ctr("string identifying name of the update", "Ubuntu Touch system")
80 font.weight: Font.Light
83 text: i18n.ctr("version of the system update", "Version %1").arg(SystemImage.targetBuildNumber)
88 anchors.left: parent.left
89 anchors.right: parent.right
90 anchors.leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
91 font.weight: Font.Light
95 text: i18n.tr("This could take a few minutes...")
99 anchors.left: parent.left
100 anchors.leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
101 color: theme.palette.normal.foreground
103 width: buttonLabel.paintedWidth + units.gu(3)
104 height: buttonLabel.paintedHeight + units.gu(1.8)
109 text: i18n.tr("Install and restart now")
110 font.weight: Font.Light
111 anchors.centerIn: parent
116 objectName: "installButton"
119 System.skipUntilFinishedPage();
120 SystemImage.applyUpdate();
124 transformOrigin: Item.Top
125 scale: button.pressed ? 0.98 : 1.0
128 duration: LomiriAnimation.SnapDuration
129 easing.type: Easing.Linear
137 anchors.centerIn: systemUpdatePage
143 LocalComponents.StackButton {
144 text: i18n.tr("Skip")
145 onClicked: pageStack.next()