Skip to content

Commit 51a05e9

Browse files
committed
Merge bitcoin-core/gui-qml#269: Introduce the Shutdown page
002af83 qml: introduce the Shutdown page (johnny9) b60c18f 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 002af83 Tree-SHA512: 4e86cd26ae8cea9e14c2e141755a0eecc485b430d922b24ee044faf7530546b2d8535e5744c3a8d1558398968e1bf132376c2114c3b9e89fe0ad4f0aa59075a1
2 parents f2743fd + 002af83 commit 51a05e9

File tree

6 files changed

+68
-0
lines changed

6 files changed

+68
-0
lines changed

qml/bitcoin_qml.qrc

Lines changed: 2 additions & 0 deletions
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>

qml/imageprovider.cpp

Lines changed: 5 additions & 0 deletions
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);

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

qml/res/icons/shutdown.png

3.1 KB
Loading

qml/res/src/shutdown.svg

Lines changed: 11 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)