Skip to content

Commit 972e7a1

Browse files
committed
Merge #269: Introduce the Shutdown page
4fcba20 qml: introduce the Shutdown page (johnny9) 879d3b1 qml: introduce the shutdown icon (johnny9) Pull request description: This page appears when quitting by sending an interrupt signal to the node. The page will clear out the current views while the node is shutting down. This fixes various null errors in the gui when the node is shutdown in the background. Based on: https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?node-id=2643%3A66321&t=3tsT34chWmtE21N9-0 [![Windows](https://img.shields.io/badge/OS-Windows-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/insecure_win_gui.zip?branch=pull/269) [![Intel macOS](https://img.shields.io/badge/OS-Intel%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/insecure_mac_gui.zip?branch=pull/269) [![Apple Silicon macOS](https://img.shields.io/badge/OS-Apple%20Silicon%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos_arm64/insecure_mac_arm64_gui.zip?branch=pull/269) [![ARM64 Android](https://img.shields.io/badge/OS-Android-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/insecure_android_apk.zip?branch=pull/269) ACKs for top commit: jarolrod: ACK 4fcba20 Tree-SHA512: 4e86cd26ae8cea9e14c2e141755a0eecc485b430d922b24ee044faf7530546b2d8535e5744c3a8d1558398968e1bf132376c2114c3b9e89fe0ad4f0aa59075a1
2 parents bc10f64 + 4fcba20 commit 972e7a1

File tree

7 files changed

+70
-0
lines changed

7 files changed

+70
-0
lines changed

src/Makefile.qt.include

+2
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ QML_RES_ICONS = \
324324
qml/res/icons/info.png \
325325
qml/res/icons/network-dark.png \
326326
qml/res/icons/network-light.png \
327+
qml/res/icons/shutdown.png \
327328
qml/res/icons/storage-dark.png \
328329
qml/res/icons/storage-light.png
329330

@@ -368,6 +369,7 @@ QML_RES_QML = \
368369
qml/pages/node/NodeRunner.qml \
369370
qml/pages/node/NodeSettings.qml \
370371
qml/pages/node/Peers.qml \
372+
qml/pages/node/Shutdown.qml \
371373
qml/pages/onboarding/OnboardingBlockclock.qml \
372374
qml/pages/onboarding/OnboardingConnection.qml \
373375
qml/pages/onboarding/OnboardingCover.qml \

src/qml/bitcoin_qml.qrc

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<file>pages/node/NodeRunner.qml</file>
3939
<file>pages/node/NodeSettings.qml</file>
4040
<file>pages/node/Peers.qml</file>
41+
<file>pages/node/Shutdown.qml</file>
4142
<file>pages/onboarding/OnboardingBlockclock.qml</file>
4243
<file>pages/onboarding/OnboardingConnection.qml</file>
4344
<file>pages/onboarding/OnboardingCover.qml</file>
@@ -66,6 +67,7 @@
6667
<file alias="info">res/icons/info.png</file>
6768
<file alias="network-dark">res/icons/network-dark.png</file>
6869
<file alias="network-light">res/icons/network-light.png</file>
70+
<file alias="shutdown">res/icons/shutdown.png</file>
6971
<file alias="storage-dark">res/icons/storage-dark.png</file>
7072
<file alias="storage-light">res/icons/storage-light.png</file>
7173
</qresource>

src/qml/imageprovider.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ QPixmap ImageProvider::requestPixmap(const QString& id, QSize* size, const QSize
9797
return QIcon(":/icons/network-light").pixmap(requested_size);
9898
}
9999

100+
if (id == "shutdown") {
101+
*size = requested_size;
102+
return QIcon(":/icons/shutdown").pixmap(requested_size);
103+
}
104+
100105
if (id == "storage-dark") {
101106
*size = requested_size;
102107
return QIcon(":/icons/storage-dark").pixmap(requested_size);

src/qml/pages/main.qml

+13
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

+37
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+
}

src/qml/res/icons/shutdown.png

3.1 KB
Loading

src/qml/res/src/shutdown.svg

+11
Loading

0 commit comments

Comments
 (0)