Skip to content

Commit 2a56d6b

Browse files
authored
Merge branch 'bitcoin-core:main' into qml-custom-datadir-display
2 parents 7341bdf + a7ccfc3 commit 2a56d6b

16 files changed

+189
-79
lines changed

.github/workflows/artifacts.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
7373
- name: Depends cache
7474
id: depends_cache
75-
uses: actions/cache@v3
75+
uses: actions/cache@v4
7676
with:
7777
path: |
7878
depends/built
@@ -93,7 +93,7 @@ jobs:
9393
make -j$(nproc) HOST=${{ matrix.host.triplet }} LOG=1
9494
9595
- name: Restore Ccache cache
96-
uses: actions/cache/restore@v3
96+
uses: actions/cache/restore@v4
9797
id: ccache-cache
9898
with:
9999
path: ${{ env.CCACHE_DIR }}
@@ -112,13 +112,13 @@ jobs:
112112
ccache --version | head -n 1 && ccache --show-stats
113113
114114
- name: Save Ccache cache
115-
uses: actions/cache/save@v3
115+
uses: actions/cache/save@v4
116116
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
117117
with:
118118
path: ${{ env.CCACHE_DIR }}
119119
key: ${{ matrix.host.triplet }}-ccache-${{ github.run_id }}
120120

121-
- uses: actions/upload-artifact@v3
121+
- uses: actions/upload-artifact@v4
122122
with:
123123
name: ${{ matrix.host.artifact }}
124124
path: src/qt/${{ matrix.host.gui_exe }}
@@ -183,7 +183,7 @@ jobs:
183183
run: |
184184
make -j$(nproc) -C src/qt apk
185185
186-
- uses: actions/upload-artifact@v3
186+
- uses: actions/upload-artifact@v4
187187
with:
188188
name: ${{ matrix.host.artifact }}
189189
path: src/qt/android/build/outputs/apk/debug/android-debug.apk

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
6767

6868
- name: Restore Ccache cache
69-
uses: actions/cache/restore@v3
69+
uses: actions/cache/restore@v4
7070
with:
7171
path: ${{ env.CCACHE_DIR }}
7272
key: ${{ github.job }}-ccache-${{ github.run_id }}
@@ -76,7 +76,7 @@ jobs:
7676
run: ./ci/test_run_all.sh
7777

7878
- name: Save Ccache cache
79-
uses: actions/cache/save@v3
79+
uses: actions/cache/save@v4
8080
if: github.event_name != 'pull_request'
8181
with:
8282
path: ${{ env.CCACHE_DIR }}
@@ -151,7 +151,7 @@ jobs:
151151
152152
- name: Restore static Qt cache
153153
id: static-qt-cache
154-
uses: actions/cache/restore@v3
154+
uses: actions/cache/restore@v4
155155
with:
156156
path: C:\Qt_static
157157
key: ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }}
@@ -194,14 +194,14 @@ jobs:
194194

195195
- name: Save static Qt cache
196196
if: steps.static-qt-cache.outputs.cache-hit != 'true'
197-
uses: actions/cache/save@v3
197+
uses: actions/cache/save@v4
198198
with:
199199
path: C:\Qt_static
200200
key: ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }}
201201

202202
- name: Ccache installation cache
203203
id: ccache-installation-cache
204-
uses: actions/cache@v3
204+
uses: actions/cache@v4
205205
with:
206206
path: |
207207
C:\ProgramData\chocolatey\lib\ccache
@@ -217,7 +217,7 @@ jobs:
217217
Copy-Item -Path "$env:ChocolateyInstall\lib\ccache\tools\ccache-$env:CI_CCACHE_VERSION-windows-x86_64\ccache.exe" -Destination "C:\ccache\cl.exe"
218218
219219
- name: Restore Ccache cache
220-
uses: actions/cache/restore@v3
220+
uses: actions/cache/restore@v4
221221
with:
222222
path: ~/AppData/Local/ccache
223223
key: ${{ github.job }}-ccache-${{ github.run_id }}
@@ -232,13 +232,13 @@ jobs:
232232
Get-Content -Path "$env:GITHUB_WORKSPACE\vcpkg_commit"
233233
234234
- name: vcpkg tools cache
235-
uses: actions/cache@v3
235+
uses: actions/cache@v4
236236
with:
237237
path: C:/vcpkg/downloads/tools
238238
key: ${{ github.job }}-vcpkg-tools
239239

240240
- name: vcpkg binary cache
241-
uses: actions/cache@v3
241+
uses: actions/cache@v4
242242
with:
243243
path: ~/AppData/Local/vcpkg/archives
244244
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('vcpkg_commit', 'msbuild_version', 'build_msvc/vcpkg.json') }}
@@ -256,7 +256,7 @@ jobs:
256256
run: ccache --show-stats
257257

258258
- name: Save Ccache cache
259-
uses: actions/cache/save@v3
259+
uses: actions/cache/save@v4
260260
if: github.event_name != 'pull_request'
261261
with:
262262
path: ~/AppData/Local/ccache

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ case $host in
745745
dnl option to system-ify all /usr/local/include paths without adding it to the list
746746
dnl of search paths in case it's not already there.
747747
if test "$suppress_external_warnings" != "no"; then
748-
AX_CHECK_PREPROC_FLAG([-Xclang -internal-isystem/usr/local/include], [CORE_CPPFLAGS="$CORE_CPPFLAGS -Xclang -internal-isystem/usr/local/include"], [], [$CXXFLAG_WERROR])
748+
AX_CHECK_PREPROC_FLAG([-Xclang -internal-isystem -Xclang /usr/local/include/], [CORE_CPPFLAGS="$CORE_CPPFLAGS -Xclang -internal-isystem -Xclang /usr/local/include/"], [], [$CXXFLAG_WERROR])
749749
fi
750750

751751
if test "$use_bdb" != "no" && $BREW list --versions berkeley-db@4 >/dev/null && test "$BDB_CFLAGS" = "" && test "$BDB_LIBS" = ""; then

src/Makefile.qt.include

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ BITCOIN_QT_H = \
141141
qt/createwalletdialog.h \
142142
qt/csvmodelwriter.h \
143143
qt/editaddressdialog.h \
144+
qt/guiconstants.h \
144145
qt/guiutil.h \
145146
qt/initexecutor.h \
146147
qt/intro.h \
@@ -336,7 +337,9 @@ QML_RES_ICONS = \
336337
qml/res/icons/shutdown.png \
337338
qml/res/icons/singlesig-wallet.png \
338339
qml/res/icons/storage-dark.png \
339-
qml/res/icons/storage-light.png
340+
qml/res/icons/storage-light.png \
341+
qml/res/icons/tooltip-arrow-dark.png \
342+
qml/res/icons/tooltip-arrow-light.png
340343

341344
QML_QRC_CPP = qml/qrc_bitcoin.cpp
342345
QML_QRC = qml/bitcoin_qml.qrc
@@ -360,13 +363,15 @@ QML_RES_QML = \
360363
qml/components/StorageSettings.qml \
361364
qml/components/ThemeSettings.qml \
362365
qml/components/TotalBytesIndicator.qml \
366+
qml/components/Tooltip.qml \
363367
qml/controls/ContinueButton.qml \
364368
qml/controls/CoreText.qml \
365369
qml/controls/ExternalLink.qml \
366370
qml/controls/FocusBorder.qml \
367371
qml/controls/Header.qml \
368372
qml/controls/Icon.qml \
369373
qml/controls/InformationPage.qml \
374+
qml/controls/IPAddressValueInput.qml \
370375
qml/controls/NavButton.qml \
371376
qml/controls/PageIndicator.qml \
372377
qml/controls/NavigationBar.qml \
@@ -381,6 +386,7 @@ QML_RES_QML = \
381386
qml/controls/TextButton.qml \
382387
qml/controls/Theme.qml \
383388
qml/controls/ToggleButton.qml \
389+
qml/controls/utils.js \
384390
qml/controls/ValueInput.qml \
385391
qml/pages/initerrormessage.qml \
386392
qml/pages/main.qml \

src/qml/bitcoin_qml.qrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<file>components/StorageSettings.qml</file>
2020
<file>components/ThemeSettings.qml</file>
2121
<file>components/TotalBytesIndicator.qml</file>
22+
<file>components/Tooltip.qml</file>
2223
<file>controls/ContinueButton.qml</file>
2324
<file>controls/CoreText.qml</file>
2425
<file>controls/ExternalLink.qml</file>
@@ -41,6 +42,7 @@
4142
<file>controls/TextButton.qml</file>
4243
<file>controls/Theme.qml</file>
4344
<file>controls/ToggleButton.qml</file>
45+
<file>controls/utils.js</file>
4446
<file>controls/ValueInput.qml</file>
4547
<file>pages/initerrormessage.qml</file>
4648
<file>pages/main.qml</file>
@@ -88,6 +90,8 @@
8890
<file alias="singlesig-wallet">res/icons/singlesig-wallet.png</file>
8991
<file alias="storage-dark">res/icons/storage-dark.png</file>
9092
<file alias="storage-light">res/icons/storage-light.png</file>
93+
<file alias="tooltip-arrow-dark">res/icons/tooltip-arrow-dark.png</file>
94+
<file alias="tooltip-arrow-light">res/icons/tooltip-arrow-light.png</file>
9195
</qresource>
9296
<qresource prefix="/fonts">
9397
<file alias="inter/regular">res/fonts/Inter-Regular.otf</file>

src/qml/components/BlockClock.qml

Lines changed: 2 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Qt.labs.settings 1.0
1010
import org.bitcoincore.qt 1.0
1111

1212
import "../controls"
13+
import "../controls/utils.js" as Utils
1314

1415
Item {
1516
id: root
@@ -28,7 +29,7 @@ Item {
2829
property bool synced: nodeModel.verificationProgress > 0.999
2930
property string syncProgress: formatProgressPercentage(nodeModel.verificationProgress * 100)
3031
property bool paused: false
31-
property var syncState: formatRemainingSyncTime(nodeModel.remainingSyncTime)
32+
property var syncState: Utils.formatRemainingSyncTime(nodeModel.remainingSyncTime)
3233
property string syncTime: syncState.text
3334
property bool estimating: syncState.estimating
3435

@@ -234,65 +235,4 @@ Item {
234235
return "0%"
235236
}
236237
}
237-
238-
function formatRemainingSyncTime(milliseconds) {
239-
var minutes = Math.floor(milliseconds / 60000);
240-
var seconds = Math.floor((milliseconds % 60000) / 1000);
241-
var weeks = Math.floor(minutes / 10080);
242-
minutes %= 10080;
243-
var days = Math.floor(minutes / 1440);
244-
minutes %= 1440;
245-
var hours = Math.floor(minutes / 60);
246-
minutes %= 60;
247-
var result = "";
248-
var estimatingStatus = false;
249-
250-
if (weeks > 0) {
251-
return {
252-
text: "~" + weeks + (weeks === 1 ? " week" : " weeks") + " left",
253-
estimating: false
254-
};
255-
}
256-
if (days > 0) {
257-
return {
258-
text: "~" + days + (days === 1 ? " day" : " days") + " left",
259-
estimating: false
260-
};
261-
}
262-
if (hours >= 5) {
263-
return {
264-
text: "~" + hours + (hours === 1 ? " hour" : " hours") + " left",
265-
estimating: false
266-
};
267-
}
268-
if (hours > 0) {
269-
return {
270-
text: "~" + hours + "h " + minutes + "m" + " left",
271-
estimating: false
272-
};
273-
}
274-
if (minutes >= 5) {
275-
return {
276-
text: "~" + minutes + (minutes === 1 ? " minute" : " minutes") + " left",
277-
estimating: false
278-
};
279-
}
280-
if (minutes > 0) {
281-
return {
282-
text: "~" + minutes + "m " + seconds + "s" + " left",
283-
estimating: false
284-
};
285-
}
286-
if (seconds > 0) {
287-
return {
288-
text: "~" + seconds + (seconds === 1 ? " second" : " seconds") + " left",
289-
estimating: false
290-
};
291-
} else {
292-
return {
293-
text: "Estimating",
294-
estimating: true
295-
};
296-
}
297-
}
298238
}

src/qml/components/Tooltip.qml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright (c) 2024 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+
8+
import "../controls"
9+
10+
Item {
11+
id: root
12+
13+
property alias text: tooltipText.text
14+
15+
Rectangle {
16+
id: tooltipBg
17+
color: Theme.color.neutral0
18+
border.color: Theme.color.neutral4
19+
radius: 5
20+
border.width: 1
21+
width: tooltipText.width + 30
22+
height: tooltipText.height + 20
23+
anchors.top: arrow.bottom
24+
anchors.right: arrow.right
25+
anchors.rightMargin: -10
26+
anchors.topMargin: -1
27+
}
28+
29+
Image {
30+
id: arrow
31+
source: Theme.image.tooltipArrow
32+
width: 22
33+
height: 10
34+
anchors.horizontalCenter: root.horizontalCenter
35+
anchors.top: root.top
36+
}
37+
38+
CoreText {
39+
id: tooltipText
40+
text: ""
41+
wrapMode: Text.NoWrap
42+
anchors.centerIn: tooltipBg
43+
}
44+
}

src/qml/controls/CoreText.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import QtQuick.Controls 2.15
88
Text {
99
property bool bold: false
1010
property bool wrap: true
11-
color: Theme.color.white
11+
color: Theme.color.neutral9
1212
font.family: "Inter"
1313
font.styleName: bold ? "Semi Bold" : "Regular"
1414
font.pixelSize: 13

src/qml/controls/Theme.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Control {
4444
required property url blocktime
4545
required property url network
4646
required property url storage
47+
required property url tooltipArrow
4748
}
4849

4950
ColorSet {
@@ -115,13 +116,15 @@ Control {
115116
blocktime: "image://images/blocktime-dark"
116117
network: "image://images/network-dark"
117118
storage: "image://images/storage-dark"
119+
tooltipArrow: "qrc:/icons/tooltip-arrow-dark"
118120
}
119121

120122
ImageSet {
121123
id: lightImageSet
122124
blocktime: "image://images/blocktime-light"
123125
network: "image://images/network-light"
124126
storage: "image://images/storage-light"
127+
tooltipArrow: "qrc:/icons/tooltip-arrow-light"
125128
}
126129

127130
function toggleDark() {

0 commit comments

Comments
 (0)