Skip to content

Commit 4fcba20

Browse files
committed
qml: introduce the Shutdown page
1 parent 879d3b1 commit 4fcba20

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ QML_RES_QML = \
366366
qml/pages/node/NodeRunner.qml \
367367
qml/pages/node/NodeSettings.qml \
368368
qml/pages/node/Peers.qml \
369+
qml/pages/node/Shutdown.qml \
369370
qml/pages/onboarding/OnboardingBlockclock.qml \
370371
qml/pages/onboarding/OnboardingConnection.qml \
371372
qml/pages/onboarding/OnboardingCover.qml \

src/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>

src/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 {

src/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)