Skip to content

Commit

Permalink
Merge branch 'bitcoin-core:main' into qml-custom-datadir-display
Browse files Browse the repository at this point in the history
  • Loading branch information
D33r-Gee authored May 27, 2024
2 parents 7341bdf + a7ccfc3 commit 2a56d6b
Show file tree
Hide file tree
Showing 16 changed files with 189 additions and 79 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Depends cache
id: depends_cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
depends/built
Expand All @@ -93,7 +93,7 @@ jobs:
make -j$(nproc) HOST=${{ matrix.host.triplet }} LOG=1
- name: Restore Ccache cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: ccache-cache
with:
path: ${{ env.CCACHE_DIR }}
Expand All @@ -112,13 +112,13 @@ jobs:
ccache --version | head -n 1 && ccache --show-stats
- name: Save Ccache cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ matrix.host.triplet }}-ccache-${{ github.run_id }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.host.artifact }}
path: src/qt/${{ matrix.host.gui_exe }}
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
run: |
make -j$(nproc) -C src/qt apk
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.host.artifact }}
path: src/qt/android/build/outputs/apk/debug/android-debug.apk
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"

- name: Restore Ccache cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ github.job }}-ccache-${{ github.run_id }}
Expand All @@ -76,7 +76,7 @@ jobs:
run: ./ci/test_run_all.sh

- name: Save Ccache cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: github.event_name != 'pull_request'
with:
path: ${{ env.CCACHE_DIR }}
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- name: Restore static Qt cache
id: static-qt-cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: C:\Qt_static
key: ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }}
Expand Down Expand Up @@ -194,14 +194,14 @@ jobs:

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

- name: Ccache installation cache
id: ccache-installation-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
C:\ProgramData\chocolatey\lib\ccache
Expand All @@ -217,7 +217,7 @@ jobs:
Copy-Item -Path "$env:ChocolateyInstall\lib\ccache\tools\ccache-$env:CI_CCACHE_VERSION-windows-x86_64\ccache.exe" -Destination "C:\ccache\cl.exe"
- name: Restore Ccache cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: ~/AppData/Local/ccache
key: ${{ github.job }}-ccache-${{ github.run_id }}
Expand All @@ -232,13 +232,13 @@ jobs:
Get-Content -Path "$env:GITHUB_WORKSPACE\vcpkg_commit"
- name: vcpkg tools cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: C:/vcpkg/downloads/tools
key: ${{ github.job }}-vcpkg-tools

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

- name: Save Ccache cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: github.event_name != 'pull_request'
with:
path: ~/AppData/Local/ccache
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ case $host in
dnl option to system-ify all /usr/local/include paths without adding it to the list
dnl of search paths in case it's not already there.
if test "$suppress_external_warnings" != "no"; then
AX_CHECK_PREPROC_FLAG([-Xclang -internal-isystem/usr/local/include], [CORE_CPPFLAGS="$CORE_CPPFLAGS -Xclang -internal-isystem/usr/local/include"], [], [$CXXFLAG_WERROR])
AX_CHECK_PREPROC_FLAG([-Xclang -internal-isystem -Xclang /usr/local/include/], [CORE_CPPFLAGS="$CORE_CPPFLAGS -Xclang -internal-isystem -Xclang /usr/local/include/"], [], [$CXXFLAG_WERROR])
fi

if test "$use_bdb" != "no" && $BREW list --versions berkeley-db@4 >/dev/null && test "$BDB_CFLAGS" = "" && test "$BDB_LIBS" = ""; then
Expand Down
8 changes: 7 additions & 1 deletion src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ BITCOIN_QT_H = \
qt/createwalletdialog.h \
qt/csvmodelwriter.h \
qt/editaddressdialog.h \
qt/guiconstants.h \
qt/guiutil.h \
qt/initexecutor.h \
qt/intro.h \
Expand Down Expand Up @@ -336,7 +337,9 @@ QML_RES_ICONS = \
qml/res/icons/shutdown.png \
qml/res/icons/singlesig-wallet.png \
qml/res/icons/storage-dark.png \
qml/res/icons/storage-light.png
qml/res/icons/storage-light.png \
qml/res/icons/tooltip-arrow-dark.png \
qml/res/icons/tooltip-arrow-light.png

QML_QRC_CPP = qml/qrc_bitcoin.cpp
QML_QRC = qml/bitcoin_qml.qrc
Expand All @@ -360,13 +363,15 @@ QML_RES_QML = \
qml/components/StorageSettings.qml \
qml/components/ThemeSettings.qml \
qml/components/TotalBytesIndicator.qml \
qml/components/Tooltip.qml \
qml/controls/ContinueButton.qml \
qml/controls/CoreText.qml \
qml/controls/ExternalLink.qml \
qml/controls/FocusBorder.qml \
qml/controls/Header.qml \
qml/controls/Icon.qml \
qml/controls/InformationPage.qml \
qml/controls/IPAddressValueInput.qml \
qml/controls/NavButton.qml \
qml/controls/PageIndicator.qml \
qml/controls/NavigationBar.qml \
Expand All @@ -381,6 +386,7 @@ QML_RES_QML = \
qml/controls/TextButton.qml \
qml/controls/Theme.qml \
qml/controls/ToggleButton.qml \
qml/controls/utils.js \
qml/controls/ValueInput.qml \
qml/pages/initerrormessage.qml \
qml/pages/main.qml \
Expand Down
4 changes: 4 additions & 0 deletions src/qml/bitcoin_qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<file>components/StorageSettings.qml</file>
<file>components/ThemeSettings.qml</file>
<file>components/TotalBytesIndicator.qml</file>
<file>components/Tooltip.qml</file>
<file>controls/ContinueButton.qml</file>
<file>controls/CoreText.qml</file>
<file>controls/ExternalLink.qml</file>
Expand All @@ -41,6 +42,7 @@
<file>controls/TextButton.qml</file>
<file>controls/Theme.qml</file>
<file>controls/ToggleButton.qml</file>
<file>controls/utils.js</file>
<file>controls/ValueInput.qml</file>
<file>pages/initerrormessage.qml</file>
<file>pages/main.qml</file>
Expand Down Expand Up @@ -88,6 +90,8 @@
<file alias="singlesig-wallet">res/icons/singlesig-wallet.png</file>
<file alias="storage-dark">res/icons/storage-dark.png</file>
<file alias="storage-light">res/icons/storage-light.png</file>
<file alias="tooltip-arrow-dark">res/icons/tooltip-arrow-dark.png</file>
<file alias="tooltip-arrow-light">res/icons/tooltip-arrow-light.png</file>
</qresource>
<qresource prefix="/fonts">
<file alias="inter/regular">res/fonts/Inter-Regular.otf</file>
Expand Down
64 changes: 2 additions & 62 deletions src/qml/components/BlockClock.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Qt.labs.settings 1.0
import org.bitcoincore.qt 1.0

import "../controls"
import "../controls/utils.js" as Utils

Item {
id: root
Expand All @@ -28,7 +29,7 @@ Item {
property bool synced: nodeModel.verificationProgress > 0.999
property string syncProgress: formatProgressPercentage(nodeModel.verificationProgress * 100)
property bool paused: false
property var syncState: formatRemainingSyncTime(nodeModel.remainingSyncTime)
property var syncState: Utils.formatRemainingSyncTime(nodeModel.remainingSyncTime)
property string syncTime: syncState.text
property bool estimating: syncState.estimating

Expand Down Expand Up @@ -234,65 +235,4 @@ Item {
return "0%"
}
}

function formatRemainingSyncTime(milliseconds) {
var minutes = Math.floor(milliseconds / 60000);
var seconds = Math.floor((milliseconds % 60000) / 1000);
var weeks = Math.floor(minutes / 10080);
minutes %= 10080;
var days = Math.floor(minutes / 1440);
minutes %= 1440;
var hours = Math.floor(minutes / 60);
minutes %= 60;
var result = "";
var estimatingStatus = false;

if (weeks > 0) {
return {
text: "~" + weeks + (weeks === 1 ? " week" : " weeks") + " left",
estimating: false
};
}
if (days > 0) {
return {
text: "~" + days + (days === 1 ? " day" : " days") + " left",
estimating: false
};
}
if (hours >= 5) {
return {
text: "~" + hours + (hours === 1 ? " hour" : " hours") + " left",
estimating: false
};
}
if (hours > 0) {
return {
text: "~" + hours + "h " + minutes + "m" + " left",
estimating: false
};
}
if (minutes >= 5) {
return {
text: "~" + minutes + (minutes === 1 ? " minute" : " minutes") + " left",
estimating: false
};
}
if (minutes > 0) {
return {
text: "~" + minutes + "m " + seconds + "s" + " left",
estimating: false
};
}
if (seconds > 0) {
return {
text: "~" + seconds + (seconds === 1 ? " second" : " seconds") + " left",
estimating: false
};
} else {
return {
text: "Estimating",
estimating: true
};
}
}
}
44 changes: 44 additions & 0 deletions src/qml/components/Tooltip.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright (c) 2024 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

import QtQuick 2.15
import QtQuick.Controls 2.15

import "../controls"

Item {
id: root

property alias text: tooltipText.text

Rectangle {
id: tooltipBg
color: Theme.color.neutral0
border.color: Theme.color.neutral4
radius: 5
border.width: 1
width: tooltipText.width + 30
height: tooltipText.height + 20
anchors.top: arrow.bottom
anchors.right: arrow.right
anchors.rightMargin: -10
anchors.topMargin: -1
}

Image {
id: arrow
source: Theme.image.tooltipArrow
width: 22
height: 10
anchors.horizontalCenter: root.horizontalCenter
anchors.top: root.top
}

CoreText {
id: tooltipText
text: ""
wrapMode: Text.NoWrap
anchors.centerIn: tooltipBg
}
}
2 changes: 1 addition & 1 deletion src/qml/controls/CoreText.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import QtQuick.Controls 2.15
Text {
property bool bold: false
property bool wrap: true
color: Theme.color.white
color: Theme.color.neutral9
font.family: "Inter"
font.styleName: bold ? "Semi Bold" : "Regular"
font.pixelSize: 13
Expand Down
3 changes: 3 additions & 0 deletions src/qml/controls/Theme.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Control {
required property url blocktime
required property url network
required property url storage
required property url tooltipArrow
}

ColorSet {
Expand Down Expand Up @@ -115,13 +116,15 @@ Control {
blocktime: "image://images/blocktime-dark"
network: "image://images/network-dark"
storage: "image://images/storage-dark"
tooltipArrow: "qrc:/icons/tooltip-arrow-dark"
}

ImageSet {
id: lightImageSet
blocktime: "image://images/blocktime-light"
network: "image://images/network-light"
storage: "image://images/storage-light"
tooltipArrow: "qrc:/icons/tooltip-arrow-light"
}

function toggleDark() {
Expand Down
Loading

0 comments on commit 2a56d6b

Please sign in to comment.