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/>.
18
import QtQuick.Layouts 1.1
19
import Ubuntu.Components 1.3
20
import Ubuntu.SystemImage 0.1
22
import ".." as LocalComponents
24
LocalComponents.Page {
26
objectName: "systemUpdatePage"
28
title: i18n.tr("Update Device")
29
forwardButtonSourceComponent: forwardButton
31
skip: !SystemImage.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
UbuntuNumberAnimation {}
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 system")
80
font.weight: Font.Light
83
text: i18n.ctr("version of the system update", "Version %1").arg(SystemImage.availableVersion)
87
font.weight: Font.Light
90
text: SystemImage.updateSize
95
anchors.left: parent.left
96
anchors.right: parent.right
97
anchors.leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
98
font.weight: Font.Light
102
text: i18n.tr("This could take a few minutes...")
106
anchors.left: parent.left
107
anchors.leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
108
color: theme.palette.normal.foreground
110
width: buttonLabel.paintedWidth + units.gu(3)
111
height: buttonLabel.paintedHeight + units.gu(1.8)
116
text: i18n.tr("Install and restart now")
117
font.weight: Font.Light
118
anchors.centerIn: parent
123
objectName: "installButton"
126
System.skipUntilFinishedPage();
127
SystemImage.applyUpdate();
131
transformOrigin: Item.Top
132
scale: button.pressed ? 0.98 : 1.0
135
duration: UbuntuAnimation.SnapDuration
136
easing.type: Easing.Linear
144
anchors.centerIn: systemUpdatePage
145
running: SystemImage.updateApplying
151
LocalComponents.StackButton {
152
text: i18n.tr("Skip")
153
onClicked: pageStack.next()