Skip to content

Commit 002af83

Browse files
committed
qml: introduce the Shutdown page
1 parent b60c18f commit 002af83

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

qml/bitcoin_qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<file>pages/node/NodeRunner.qml</file>
3636
<file>pages/node/NodeSettings.qml</file>
3737
<file>pages/node/Peers.qml</file>
38+
<file>pages/node/Shutdown.qml</file>
3839
<file>pages/onboarding/OnboardingBlockclock.qml</file>
3940
<file>pages/onboarding/OnboardingConnection.qml</file>
4041
<file>pages/onboarding/OnboardingCover.qml</file>

qml/pages/main.qml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ ApplicationWindow {
2525
anchors.fill: parent
2626
}
2727

28+
Connections {
29+
target: nodeModel
30+
function onRequestedShutdown() {
31+
main.clear()
32+
main.push(shutdown)
33+
}
34+
}
35+
2836
Component {
2937
id: onboardingWizard
3038
SwipeView {
@@ -43,6 +51,11 @@ ApplicationWindow {
4351
}
4452
}
4553

54+
Component {
55+
id: shutdown
56+
Shutdown {}
57+
}
58+
4659
Component {
4760
id: node
4861
SwipeView {

qml/pages/node/Shutdown.qml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright (c) 2023 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
import QtQuick 2.15
6+
import QtQuick.Controls 2.15
7+
import QtQuick.Layouts 1.15
8+
import "../../controls"
9+
10+
Page {
11+
background: null
12+
13+
ColumnLayout {
14+
anchors.centerIn: parent
15+
width: parent.width
16+
spacing: 10
17+
Button {
18+
Layout.alignment: Qt.AlignCenter
19+
Layout.bottomMargin: 20
20+
background: null
21+
icon.source: "image://images/shutdown"
22+
icon.color: Theme.color.neutral9
23+
icon.width: 60
24+
icon.height: 60
25+
}
26+
Header {
27+
Layout.alignment: Qt.AlignCenter
28+
Layout.fillWidth: true
29+
Layout.leftMargin: 20
30+
Layout.rightMargin: 20
31+
header: qsTr("Saving...")
32+
headerBold: true
33+
description: qsTr("Do not shut down the computer until this is done.")
34+
descriptionColor: Theme.color.neutral7
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)