aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--ci/test/00_setup_env_native_multiprocess.sh1
-rw-r--r--ci/test/00_setup_env_native_qt5.sh1
-rw-r--r--contrib/debian/copyright15
-rwxr-xr-xcontrib/devtools/test-symbol-check.py19
-rw-r--r--contrib/guix/README.md8
-rwxr-xr-xcontrib/guix/guix-build.sh21
-rw-r--r--contrib/guix/libexec/build.sh18
-rw-r--r--contrib/guix/manifest.scm5
-rw-r--r--doc/developer-notes.md5
-rw-r--r--src/Makefile.qt.include7
-rw-r--r--src/net_processing.cpp3
-rw-r--r--src/qt/bitcoin.cpp2
-rw-r--r--src/qt/bitcoin.qrc3
-rw-r--r--src/qt/forms/debugwindow.ui110
-rw-r--r--src/qt/forms/optionsdialog.ui100
-rw-r--r--src/qt/forms/overviewpage.ui56
-rw-r--r--src/qt/guiutil.cpp137
-rw-r--r--src/qt/guiutil.h43
-rw-r--r--src/qt/optionsdialog.cpp15
-rw-r--r--src/qt/optionsmodel.cpp13
-rw-r--r--src/qt/optionsmodel.h4
-rw-r--r--src/qt/overviewpage.cpp17
-rw-r--r--src/qt/overviewpage.h1
-rw-r--r--src/qt/peertablemodel.cpp5
-rw-r--r--src/qt/peertablemodel.h15
-rw-r--r--src/qt/receivecoinsdialog.cpp40
-rw-r--r--src/qt/receivecoinsdialog.h2
-rw-r--r--src/qt/res/fonts/RobotoMono-Bold.ttfbin0 -> 87008 bytes
-rw-r--r--src/qt/rpcconsole.cpp17
-rw-r--r--src/qt/transactionview.cpp122
-rw-r--r--src/qt/transactionview.h6
-rw-r--r--src/test/txvalidationcache_tests.cpp5
-rw-r--r--src/validation.cpp11
34 files changed, 421 insertions, 408 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 2e11474382..ae2379fbd5 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -197,7 +197,7 @@ Note: Code review is a burdensome but important part of the development process,
If your pull request contains fixup commits (commits that change the same line of code repeatedly) or too fine-grained
commits, you may be asked to [squash](https://git-scm.com/docs/git-rebase#_interactive_mode) your commits
-before it will be merged. The basic squashing workflow is shown below.
+before it will be reviewed. The basic squashing workflow is shown below.
git checkout your_branch_name
git rebase -i HEAD~n
diff --git a/ci/test/00_setup_env_native_multiprocess.sh b/ci/test/00_setup_env_native_multiprocess.sh
index 522a5d9fc2..c5692d786a 100644
--- a/ci/test/00_setup_env_native_multiprocess.sh
+++ b/ci/test/00_setup_env_native_multiprocess.sh
@@ -13,3 +13,4 @@ export DEP_OPTS="MULTIPROCESS=1"
export GOAL="install"
export BITCOIN_CONFIG="--with-boost-process"
export TEST_RUNNER_ENV="BITCOIND=bitcoin-node"
+export RUN_SECURITY_TESTS="true"
diff --git a/ci/test/00_setup_env_native_qt5.sh b/ci/test/00_setup_env_native_qt5.sh
index bbc43cfabd..4c42605e9a 100644
--- a/ci/test/00_setup_env_native_qt5.sh
+++ b/ci/test/00_setup_env_native_qt5.sh
@@ -11,7 +11,6 @@ export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic gcc-7 can compile our c
export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev"
export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1"
export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash
-export RUN_SECURITY_TESTS="true"
export RUN_UNIT_TESTS_SEQUENTIAL="true"
export RUN_UNIT_TESTS="false"
export GOAL="install"
diff --git a/contrib/debian/copyright b/contrib/debian/copyright
index a18c5bccc5..7ee7f056d9 100644
--- a/contrib/debian/copyright
+++ b/contrib/debian/copyright
@@ -87,6 +87,10 @@ Files: src/qt/res/icons/proxy.png
Copyright: Cristian Mircea Messel
License: public-domain
+Files: src/qt/fonts/RobotoMono-Bold.ttf
+License: Apache-2.0
+Comment: Site: https://fonts.google.com/specimen/Roboto+Mono
+
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a
@@ -144,3 +148,14 @@ Comment:
License: public-domain
This work is in the public domain.
+
+License: Apache-2.0
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/contrib/devtools/test-symbol-check.py b/contrib/devtools/test-symbol-check.py
index 18ed7d61e0..ee7bfc9805 100755
--- a/contrib/devtools/test-symbol-check.py
+++ b/contrib/devtools/test-symbol-check.py
@@ -23,29 +23,26 @@ class TestSymbolChecks(unittest.TestCase):
executable = 'test1'
cc = 'gcc'
- # there's no way to do this test for RISC-V at the moment; bionic's libc is 2.27
- # and we allow all symbols from 2.27.
- if 'riscv' in get_machine(cc):
- self.skipTest("test not available for RISC-V")
-
- # memfd_create was introduced in GLIBC 2.27, so is newer than the upper limit of
- # all but RISC-V but still available on bionic
+ # renameat2 was introduced in GLIBC 2.28, so is newer than the upper limit
+ # of glibc for all platforms
with open(source, 'w', encoding="utf8") as f:
f.write('''
#define _GNU_SOURCE
- #include <sys/mman.h>
+ #include <stdio.h>
+ #include <linux/fs.h>
- int memfd_create(const char *name, unsigned int flags);
+ int renameat2(int olddirfd, const char *oldpath,
+ int newdirfd, const char *newpath, unsigned int flags);
int main()
{
- memfd_create("test", 0);
+ renameat2(0, "test", 0, "test_", RENAME_EXCHANGE);
return 0;
}
''')
self.assertEqual(call_symbol_check(cc, source, executable, []),
- (1, executable + ': symbol memfd_create from unsupported version GLIBC_2.27\n' +
+ (1, executable + ': symbol renameat2 from unsupported version GLIBC_2.28\n' +
executable + ': failed IMPORTED_SYMBOLS'))
# -lutil is part of the libc6 package so a safe bet that it's installed
diff --git a/contrib/guix/README.md b/contrib/guix/README.md
index e83f53dac3..e218ba89a0 100644
--- a/contrib/guix/README.md
+++ b/contrib/guix/README.md
@@ -13,11 +13,9 @@ We achieve bootstrappability by using Guix as a functional package manager.
Conservatively, a x86_64 machine with:
-- 4GB of free disk space on the partition that /gnu/store will reside in
-- 24GB of free disk space on the partition that the Bitcoin Core git repository
- resides in
-
-> Note: these requirements are slightly less onerous than those of Gitian builds
+- 16GB of free disk space on the partition that /gnu/store will reside in
+- 8GB of free disk space per platform triple you're planning on building (see
+ the `HOSTS` environment variable description)
## Setup
diff --git a/contrib/guix/guix-build.sh b/contrib/guix/guix-build.sh
index f29ea9b910..7af132b240 100755
--- a/contrib/guix/guix-build.sh
+++ b/contrib/guix/guix-build.sh
@@ -69,7 +69,7 @@ fi
################
# Default to building for all supported HOSTs (overridable by environment)
-export HOSTS="${HOSTS:-x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu
+export HOSTS="${HOSTS:-x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu powerpc64-linux-gnu powerpc64le-linux-gnu
x86_64-w64-mingw32
x86_64-apple-darwin18}"
@@ -136,9 +136,24 @@ done
# environment)
MAX_JOBS="${MAX_JOBS:-$(nproc)}"
+# Usage: host_to_commonname HOST
+#
+# HOST: The current platform triple we're building for
+#
+host_to_commonname() {
+ case "$1" in
+ *darwin*) echo osx ;;
+ *mingw*) echo win ;;
+ *linux*) echo linux ;;
+ *) exit 1 ;;
+ esac
+}
+
# Download the depends sources now as we won't have internet access in the build
# container
-make -C "${PWD}/depends" -j"$MAX_JOBS" download ${V:+V=1} ${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"}
+for host in $HOSTS; do
+ make -C "${PWD}/depends" -j"$MAX_JOBS" download-"$(host_to_commonname "$host")" ${V:+V=1} ${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"}
+done
# Determine the reference time used for determinism (overridable by environment)
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git log --format=%at -1)}"
@@ -148,7 +163,7 @@ SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git log --format=%at -1)}"
time-machine() {
# shellcheck disable=SC2086
guix time-machine --url=https://github.com/dongcarl/guix.git \
- --commit=7d6bd44da57926e0d4af25eba723a61c82beef98 \
+ --commit=6c9d16db962a6f7155571b36eced681fd2889e23 \
--max-jobs="$MAX_JOBS" \
--keep-failed \
${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \
diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh
index 24bc30e330..72588c54a7 100644
--- a/contrib/guix/libexec/build.sh
+++ b/contrib/guix/libexec/build.sh
@@ -136,12 +136,14 @@ case "$HOST" in
*linux*)
glibc_dynamic_linker=$(
case "$HOST" in
- i686-linux-gnu) echo /lib/ld-linux.so.2 ;;
- x86_64-linux-gnu) echo /lib64/ld-linux-x86-64.so.2 ;;
- arm-linux-gnueabihf) echo /lib/ld-linux-armhf.so.3 ;;
- aarch64-linux-gnu) echo /lib/ld-linux-aarch64.so.1 ;;
- riscv64-linux-gnu) echo /lib/ld-linux-riscv64-lp64d.so.1 ;;
- *) exit 1 ;;
+ i686-linux-gnu) echo /lib/ld-linux.so.2 ;;
+ x86_64-linux-gnu) echo /lib64/ld-linux-x86-64.so.2 ;;
+ arm-linux-gnueabihf) echo /lib/ld-linux-armhf.so.3 ;;
+ aarch64-linux-gnu) echo /lib/ld-linux-aarch64.so.1 ;;
+ riscv64-linux-gnu) echo /lib/ld-linux-riscv64-lp64d.so.1 ;;
+ powerpc64-linux-gnu) echo /lib/ld64.so.1;;
+ powerpc64le-linux-gnu) echo /lib/ld64.so.2;;
+ *) exit 1 ;;
esac
)
;;
@@ -231,6 +233,10 @@ case "$HOST" in
*mingw*) HOST_LDFLAGS="-Wl,--no-insert-timestamp" ;;
esac
+case "$HOST" in
+ powerpc64-linux-*) HOST_LDFLAGS="${HOST_LDFLAGS} -Wl,-z,noexecstack" ;;
+esac
+
# Make $HOST-specific native binaries from depends available in $PATH
export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
mkdir -p "$DISTSRC"
diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm
index bf02fbfd1d..fb585b7f25 100644
--- a/contrib/guix/manifest.scm
+++ b/contrib/guix/manifest.scm
@@ -233,7 +233,10 @@ chain for " target " development."))
(make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32")
(make-nsis-with-sde-support nsis-x86_64)))
((string-contains target "riscv64-linux-")
- (list (make-bitcoin-cross-toolchain "riscv64-linux-gnu"
+ (list (make-bitcoin-cross-toolchain target
+ #:base-gcc-for-libc gcc-7)))
+ ((string-contains target "powerpc64le-linux-")
+ (list (make-bitcoin-cross-toolchain target
#:base-gcc-for-libc gcc-7)))
((string-contains target "-linux-")
(list (make-bitcoin-cross-toolchain target)))
diff --git a/doc/developer-notes.md b/doc/developer-notes.md
index 011c38321c..8f2d7af089 100644
--- a/doc/developer-notes.md
+++ b/doc/developer-notes.md
@@ -785,6 +785,11 @@ Threads and synchronization
get compile-time warnings about potential race conditions in code. Combine annotations in function declarations with
run-time asserts in function definitions:
+ - In functions that are declared separately from where they are defined, the
+ thread safety annotations should be added exclusively to the function
+ declaration. Annotations on the definition could lead to false positives
+ (lack of compile failure) at call sites between the two.
+
```C++
// txmempool.h
class CTxMemPool
diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index 969f0ca411..59cfdb9839 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -164,6 +164,9 @@ BITCOIN_QT_H = \
qt/walletview.h \
qt/winshutdownmonitor.h
+RES_FONTS = \
+ qt/res/fonts/RobotoMono-Bold.ttf
+
RES_ICONS = \
qt/res/icons/add.png \
qt/res/icons/address-book.png \
@@ -290,7 +293,7 @@ qt_libbitcoinqt_a_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
qt_libbitcoinqt_a_OBJCXXFLAGS = $(AM_OBJCXXFLAGS) $(QT_PIE_FLAGS)
qt_libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \
- $(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(RES_ICONS) $(RES_ANIMATION)
+ $(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(RES_FONTS) $(RES_ICONS) $(RES_ANIMATION)
if TARGET_DARWIN
qt_libbitcoinqt_a_SOURCES += $(BITCOIN_MM)
endif
@@ -361,7 +364,7 @@ $(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)
$(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@
@rm $(@D)/temp_$(<F)
-$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(RES_ICONS) $(RES_ANIMATION)
+$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(RES_FONTS) $(RES_ICONS) $(RES_ANIMATION)
@test -f $(RCC)
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< | \
$(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 198228de26..c97f7ced46 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -4052,7 +4052,8 @@ bool PeerManagerImpl::MaybeDiscourageAndDisconnect(CNode& pnode, Peer& peer)
if (pnode.addr.IsLocal()) {
// We disconnect local peers for bad behavior but don't discourage (since that would discourage
// all peers on the same local address)
- LogPrintf("Warning: disconnecting but not discouraging local peer %d!\n", peer.m_id);
+ LogPrint(BCLog::NET, "Warning: disconnecting but not discouraging %s peer %d!\n",
+ pnode.m_inbound_onion ? "inbound onion" : "local", peer.m_id);
pnode.fDisconnect = true;
return true;
}
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index d6d5ba6968..bad74fcbcc 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -44,6 +44,7 @@
#include <QApplication>
#include <QDebug>
+#include <QFontDatabase>
#include <QLibraryInfo>
#include <QLocale>
#include <QMessageBox>
@@ -475,6 +476,7 @@ int GuiMain(int argc, char* argv[])
#endif
BitcoinApplication app;
+ QFontDatabase::addApplicationFont(":/fonts/monospace");
/// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these
// Command-line options take precedence:
diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc
index 7115459808..fed373e551 100644
--- a/src/qt/bitcoin.qrc
+++ b/src/qt/bitcoin.qrc
@@ -83,4 +83,7 @@
<file alias="spinner-034">res/animation/spinner-034.png</file>
<file alias="spinner-035">res/animation/spinner-035.png</file>
</qresource>
+ <qresource prefix="/fonts">
+ <file alias="monospace">res/fonts/RobotoMono-Bold.ttf</file>
+ </qresource>
</RCC>
diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui
index 3831852185..9e828ce0a6 100644
--- a/src/qt/forms/debugwindow.ui
+++ b/src/qt/forms/debugwindow.ui
@@ -988,7 +988,7 @@
</item>
</layout>
</widget>
- <widget class="QWidget" name="widget_2" native="true">
+ <widget class="QWidget" name="peersTabRightPanel" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -1079,10 +1079,10 @@
<item row="1" column="0">
<widget class="QLabel" name="peerConnectionTypeLabel">
<property name="toolTip">
- <string>The type of peer connection: %1</string>
+ <string>The direction and type of peer connection: %1</string>
</property>
<property name="text">
- <string>Connection Type</string>
+ <string>Direction/Type</string>
</property>
</widget>
</item>
@@ -1198,13 +1198,65 @@
</widget>
</item>
<item row="6" column="0">
+ <widget class="QLabel" name="peerRelayTxesLabel">
+ <property name="toolTip">
+ <string>Whether the peer requested us to relay transactions.</string>
+ </property>
+ <property name="text">
+ <string>Wants Tx Relay</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
+ <widget class="QLabel" name="peerRelayTxes">
+ <property name="cursor">
+ <cursorShape>IBeamCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>N/A</string>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
+ <property name="textInteractionFlags">
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0">
+ <widget class="QLabel" name="peerHighBandwidthLabel">
+ <property name="toolTip">
+ <string>High bandwidth BIP152 compact block relay: %1</string>
+ </property>
+ <property name="text">
+ <string>High Bandwidth</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="1">
+ <widget class="QLabel" name="peerHighBandwidth">
+ <property name="cursor">
+ <cursorShape>IBeamCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>N/A</string>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
+ <property name="textInteractionFlags">
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="0">
<widget class="QLabel" name="label_29">
<property name="text">
<string>Starting Block</string>
</property>
</widget>
</item>
- <item row="6" column="1">
+ <item row="8" column="1">
<widget class="QLabel" name="peerHeight">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1220,14 +1272,14 @@
</property>
</widget>
</item>
- <item row="7" column="0">
+ <item row="9" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Synced Headers</string>
</property>
</widget>
</item>
- <item row="7" column="1">
+ <item row="9" column="1">
<widget class="QLabel" name="peerSyncHeight">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1243,14 +1295,14 @@
</property>
</widget>
</item>
- <item row="8" column="0">
+ <item row="10" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Synced Blocks</string>
</property>
</widget>
</item>
- <item row="8" column="1">
+ <item row="10" column="1">
<widget class="QLabel" name="peerCommonHeight">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1266,14 +1318,14 @@
</property>
</widget>
</item>
- <item row="9" column="0">
+ <item row="11" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Connection Time</string>
</property>
</widget>
</item>
- <item row="9" column="1">
+ <item row="11" column="1">
<widget class="QLabel" name="peerConnTime">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1289,14 +1341,14 @@
</property>
</widget>
</item>
- <item row="10" column="0">
+ <item row="12" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Last Send</string>
</property>
</widget>
</item>
- <item row="10" column="1">
+ <item row="12" column="1">
<widget class="QLabel" name="peerLastSend">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1312,14 +1364,14 @@
</property>
</widget>
</item>
- <item row="11" column="0">
+ <item row="13" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Last Receive</string>
</property>
</widget>
</item>
- <item row="11" column="1">
+ <item row="13" column="1">
<widget class="QLabel" name="peerLastRecv">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1335,14 +1387,14 @@
</property>
</widget>
</item>
- <item row="12" column="0">
+ <item row="14" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Sent</string>
</property>
</widget>
</item>
- <item row="12" column="1">
+ <item row="14" column="1">
<widget class="QLabel" name="peerBytesSent">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1358,14 +1410,14 @@
</property>
</widget>
</item>
- <item row="13" column="0">
+ <item row="15" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>Received</string>
</property>
</widget>
</item>
- <item row="13" column="1">
+ <item row="15" column="1">
<widget class="QLabel" name="peerBytesRecv">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1381,14 +1433,14 @@
</property>
</widget>
</item>
- <item row="14" column="0">
+ <item row="16" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Ping Time</string>
</property>
</widget>
</item>
- <item row="14" column="1">
+ <item row="16" column="1">
<widget class="QLabel" name="peerPingTime">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1404,7 +1456,7 @@
</property>
</widget>
</item>
- <item row="15" column="0">
+ <item row="17" column="0">
<widget class="QLabel" name="peerPingWaitLabel">
<property name="toolTip">
<string>The duration of a currently outstanding ping.</string>
@@ -1414,7 +1466,7 @@
</property>
</widget>
</item>
- <item row="15" column="1">
+ <item row="17" column="1">
<widget class="QLabel" name="peerPingWait">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1430,14 +1482,14 @@
</property>
</widget>
</item>
- <item row="16" column="0">
+ <item row="18" column="0">
<widget class="QLabel" name="peerMinPingLabel">
<property name="text">
<string>Min Ping</string>
</property>
</widget>
</item>
- <item row="16" column="1">
+ <item row="18" column="1">
<widget class="QLabel" name="peerMinPing">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1453,14 +1505,14 @@
</property>
</widget>
</item>
- <item row="17" column="0">
+ <item row="19" column="0">
<widget class="QLabel" name="label_timeoffset">
<property name="text">
<string>Time Offset</string>
</property>
</widget>
</item>
- <item row="17" column="1">
+ <item row="19" column="1">
<widget class="QLabel" name="timeoffset">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1476,7 +1528,7 @@
</property>
</widget>
</item>
- <item row="18" column="0">
+ <item row="20" column="0">
<widget class="QLabel" name="peerMappedASLabel">
<property name="toolTip">
<string>The mapped Autonomous System used for diversifying peer selection.</string>
@@ -1486,7 +1538,7 @@
</property>
</widget>
</item>
- <item row="18" column="1">
+ <item row="20" column="1">
<widget class="QLabel" name="peerMappedAS">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -1502,7 +1554,7 @@
</property>
</widget>
</item>
- <item row="19" column="0">
+ <item row="21" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui
index 8181cc47e2..6d279540e9 100644
--- a/src/qt/forms/optionsdialog.ui
+++ b/src/qt/forms/optionsdialog.ui
@@ -706,6 +706,106 @@
</layout>
</item>
<item>
+ <widget class="QGroupBox" name="font_groupBox">
+ <property name="title">
+ <string>Monospaced font in the Overview tab:</string>
+ </property>
+ <layout class="QVBoxLayout" name="font_verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="embeddedFont_horizontalLayout">
+ <item>
+ <widget class="QRadioButton" name="embeddedFont_radioButton">
+ <property name="text">
+ <string>embedded &quot;%1&quot;</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="embeddedFont_horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="embeddedFont_verticalLayout">
+ <item>
+ <widget class="QLabel" name="embeddedFont_label_1">
+ <property name="text">
+ <string>111.11111111 BTC</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="embeddedFont_label_9">
+ <property name="text">
+ <string>909.09090909 BTC</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="font_line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="systemFont_horizontalLayout">
+ <item>
+ <widget class="QRadioButton" name="systemFont_radioButton">
+ <property name="text">
+ <string>closest matching &quot;%1&quot;</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="systemFont_horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="systemFont_verticalLayout">
+ <item>
+ <widget class="QLabel" name="systemFont_label_1">
+ <property name="text">
+ <string>111.11111111 BTC</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="systemFont_label_9">
+ <property name="text">
+ <string>909.09090909 BTC</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer_Display">
<property name="orientation">
<enum>Qt::Vertical</enum>
diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui
index ee9d4a113c..b82143e1ba 100644
--- a/src/qt/forms/overviewpage.ui
+++ b/src/qt/forms/overviewpage.ui
@@ -116,13 +116,6 @@
</property>
<item row="2" column="2">
<widget class="QLabel" name="labelWatchPending">
- <property name="font">
- <font>
- <family>Monospace</family>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
@@ -142,13 +135,6 @@
</item>
<item row="2" column="1">
<widget class="QLabel" name="labelUnconfirmed">
- <property name="font">
- <font>
- <family>Monospace</family>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
@@ -168,13 +154,6 @@
</item>
<item row="3" column="2">
<widget class="QLabel" name="labelWatchImmature">
- <property name="font">
- <font>
- <family>Monospace</family>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
@@ -227,13 +206,6 @@
</item>
<item row="3" column="1">
<widget class="QLabel" name="labelImmature">
- <property name="font">
- <font>
- <family>Monospace</family>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
@@ -273,13 +245,6 @@
</item>
<item row="5" column="1">
<widget class="QLabel" name="labelTotal">
- <property name="font">
- <font>
- <family>Monospace</family>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
@@ -299,13 +264,6 @@
</item>
<item row="5" column="2">
<widget class="QLabel" name="labelWatchTotal">
- <property name="font">
- <font>
- <family>Monospace</family>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
@@ -342,13 +300,6 @@
</item>
<item row="1" column="1">
<widget class="QLabel" name="labelBalance">
- <property name="font">
- <font>
- <family>Monospace</family>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
@@ -368,13 +319,6 @@
</item>
<item row="1" column="2">
<widget class="QLabel" name="labelWatchAvailable">
- <property name="font">
- <font>
- <family>Monospace</family>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 0c2bbe9516..c70bd9f418 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -78,8 +78,11 @@ QString dateTimeStr(qint64 nTime)
return dateTimeStr(QDateTime::fromTime_t((qint32)nTime));
}
-QFont fixedPitchFont()
+QFont fixedPitchFont(bool use_embedded_font)
{
+ if (use_embedded_font) {
+ return {"Roboto Mono"};
+ }
return QFontDatabase::systemFont(QFontDatabase::FixedFont);
}
@@ -470,120 +473,6 @@ bool LabelOutOfFocusEventFilter::eventFilter(QObject* watched, QEvent* event)
return QObject::eventFilter(watched, event);
}
-void TableViewLastColumnResizingFixer::connectViewHeadersSignals()
-{
- connect(tableView->horizontalHeader(), &QHeaderView::sectionResized, this, &TableViewLastColumnResizingFixer::on_sectionResized);
- connect(tableView->horizontalHeader(), &QHeaderView::geometriesChanged, this, &TableViewLastColumnResizingFixer::on_geometriesChanged);
-}
-
-// We need to disconnect these while handling the resize events, otherwise we can enter infinite loops.
-void TableViewLastColumnResizingFixer::disconnectViewHeadersSignals()
-{
- disconnect(tableView->horizontalHeader(), &QHeaderView::sectionResized, this, &TableViewLastColumnResizingFixer::on_sectionResized);
- disconnect(tableView->horizontalHeader(), &QHeaderView::geometriesChanged, this, &TableViewLastColumnResizingFixer::on_geometriesChanged);
-}
-
-// Setup the resize mode, handles compatibility for Qt5 and below as the method signatures changed.
-// Refactored here for readability.
-void TableViewLastColumnResizingFixer::setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode)
-{
- tableView->horizontalHeader()->setSectionResizeMode(logicalIndex, resizeMode);
-}
-
-void TableViewLastColumnResizingFixer::resizeColumn(int nColumnIndex, int width)
-{
- tableView->setColumnWidth(nColumnIndex, width);
- tableView->horizontalHeader()->resizeSection(nColumnIndex, width);
-}
-
-int TableViewLastColumnResizingFixer::getColumnsWidth()
-{
- int nColumnsWidthSum = 0;
- for (int i = 0; i < columnCount; i++)
- {
- nColumnsWidthSum += tableView->horizontalHeader()->sectionSize(i);
- }
- return nColumnsWidthSum;
-}
-
-int TableViewLastColumnResizingFixer::getAvailableWidthForColumn(int column)
-{
- int nResult = lastColumnMinimumWidth;
- int nTableWidth = tableView->horizontalHeader()->width();
-
- if (nTableWidth > 0)
- {
- int nOtherColsWidth = getColumnsWidth() - tableView->horizontalHeader()->sectionSize(column);
- nResult = std::max(nResult, nTableWidth - nOtherColsWidth);
- }
-
- return nResult;
-}
-
-// Make sure we don't make the columns wider than the table's viewport width.
-void TableViewLastColumnResizingFixer::adjustTableColumnsWidth()
-{
- disconnectViewHeadersSignals();
- resizeColumn(lastColumnIndex, getAvailableWidthForColumn(lastColumnIndex));
- connectViewHeadersSignals();
-
- int nTableWidth = tableView->horizontalHeader()->width();
- int nColsWidth = getColumnsWidth();
- if (nColsWidth > nTableWidth)
- {
- resizeColumn(secondToLastColumnIndex,getAvailableWidthForColumn(secondToLastColumnIndex));
- }
-}
-
-// Make column use all the space available, useful during window resizing.
-void TableViewLastColumnResizingFixer::stretchColumnWidth(int column)
-{
- disconnectViewHeadersSignals();
- resizeColumn(column, getAvailableWidthForColumn(column));
- connectViewHeadersSignals();
-}
-
-// When a section is resized this is a slot-proxy for ajustAmountColumnWidth().
-void TableViewLastColumnResizingFixer::on_sectionResized(int logicalIndex, int oldSize, int newSize)
-{
- adjustTableColumnsWidth();
- int remainingWidth = getAvailableWidthForColumn(logicalIndex);
- if (newSize > remainingWidth)
- {
- resizeColumn(logicalIndex, remainingWidth);
- }
-}
-
-// When the table's geometry is ready, we manually perform the stretch of the "Message" column,
-// as the "Stretch" resize mode does not allow for interactive resizing.
-void TableViewLastColumnResizingFixer::on_geometriesChanged()
-{
- if ((getColumnsWidth() - this->tableView->horizontalHeader()->width()) != 0)
- {
- disconnectViewHeadersSignals();
- resizeColumn(secondToLastColumnIndex, getAvailableWidthForColumn(secondToLastColumnIndex));
- connectViewHeadersSignals();
- }
-}
-
-/**
- * Initializes all internal variables and prepares the
- * the resize modes of the last 2 columns of the table and
- */
-TableViewLastColumnResizingFixer::TableViewLastColumnResizingFixer(QTableView* table, int lastColMinimumWidth, int allColsMinimumWidth, QObject *parent) :
- QObject(parent),
- tableView(table),
- lastColumnMinimumWidth(lastColMinimumWidth),
- allColumnsMinimumWidth(allColsMinimumWidth)
-{
- columnCount = tableView->horizontalHeader()->count();
- lastColumnIndex = columnCount - 1;
- secondToLastColumnIndex = columnCount - 2;
- tableView->horizontalHeader()->setMinimumSectionSize(allColumnsMinimumWidth);
- setViewHeaderResizeMode(secondToLastColumnIndex, QHeaderView::Interactive);
- setViewHeaderResizeMode(lastColumnIndex, QHeaderView::Interactive);
-}
-
#ifdef WIN32
fs::path static StartupShortcutPath()
{
@@ -766,15 +655,19 @@ QString NetworkToQString(Network net)
assert(false);
}
-QString ConnectionTypeToQString(ConnectionType conn_type)
+QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction)
{
+ QString prefix;
+ if (prepend_direction) {
+ prefix = (conn_type == ConnectionType::INBOUND) ? QObject::tr("Inbound") : QObject::tr("Outbound") + " ";
+ }
switch (conn_type) {
- case ConnectionType::INBOUND: return QObject::tr("Inbound");
- case ConnectionType::OUTBOUND_FULL_RELAY: return QObject::tr("Outbound Full Relay");
- case ConnectionType::BLOCK_RELAY: return QObject::tr("Outbound Block Relay");
- case ConnectionType::MANUAL: return QObject::tr("Outbound Manual");
- case ConnectionType::FEELER: return QObject::tr("Outbound Feeler");
- case ConnectionType::ADDR_FETCH: return QObject::tr("Outbound Address Fetch");
+ case ConnectionType::INBOUND: return prefix;
+ case ConnectionType::OUTBOUND_FULL_RELAY: return prefix + QObject::tr("Full Relay");
+ case ConnectionType::BLOCK_RELAY: return prefix + QObject::tr("Block Relay");
+ case ConnectionType::MANUAL: return prefix + QObject::tr("Manual");
+ case ConnectionType::FEELER: return prefix + QObject::tr("Feeler");
+ case ConnectionType::ADDR_FETCH: return prefix + QObject::tr("Address Fetch");
} // no default case, so the compiler can warn about missing cases
assert(false);
}
diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h
index 9fb108dff9..7984aa1141 100644
--- a/src/qt/guiutil.h
+++ b/src/qt/guiutil.h
@@ -53,7 +53,7 @@ namespace GUIUtil
QString dateTimeStr(qint64 nTime);
// Return a monospace font
- QFont fixedPitchFont();
+ QFont fixedPitchFont(bool use_embedded_font = false);
// Set up widget for address
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent);
@@ -181,45 +181,6 @@ namespace GUIUtil
bool eventFilter(QObject* watched, QEvent* event) override;
};
- /**
- * Makes a QTableView last column feel as if it was being resized from its left border.
- * Also makes sure the column widths are never larger than the table's viewport.
- * In Qt, all columns are resizable from the right, but it's not intuitive resizing the last column from the right.
- * Usually our second to last columns behave as if stretched, and when on stretch mode, columns aren't resizable
- * interactively or programmatically.
- *
- * This helper object takes care of this issue.
- *
- */
- class TableViewLastColumnResizingFixer: public QObject
- {
- Q_OBJECT
-
- public:
- TableViewLastColumnResizingFixer(QTableView* table, int lastColMinimumWidth, int allColsMinimumWidth, QObject *parent);
- void stretchColumnWidth(int column);
-
- private:
- QTableView* tableView;
- int lastColumnMinimumWidth;
- int allColumnsMinimumWidth;
- int lastColumnIndex;
- int columnCount;
- int secondToLastColumnIndex;
-
- void adjustTableColumnsWidth();
- int getAvailableWidthForColumn(int column);
- int getColumnsWidth();
- void connectViewHeadersSignals();
- void disconnectViewHeadersSignals();
- void setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode);
- void resizeColumn(int nColumnIndex, int width);
-
- private Q_SLOTS:
- void on_sectionResized(int logicalIndex, int oldSize, int newSize);
- void on_geometriesChanged();
- };
-
bool GetStartOnSystemStartup();
bool SetStartOnSystemStartup(bool fAutoStart);
@@ -233,7 +194,7 @@ namespace GUIUtil
QString NetworkToQString(Network net);
/** Convert enum ConnectionType to QString */
- QString ConnectionTypeToQString(ConnectionType conn_type);
+ QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction);
/** Convert seconds into a QString with days, hours, mins, secs */
QString formatDurationStr(int secs);
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index 7b8d7871ec..e6b9488344 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -144,6 +144,20 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
ui->minimizeToTray->setEnabled(false);
}
+ QFont embedded_font{GUIUtil::fixedPitchFont(true)};
+ ui->embeddedFont_radioButton->setText(ui->embeddedFont_radioButton->text().arg(QFontInfo(embedded_font).family()));
+ embedded_font.setWeight(QFont::Bold);
+ ui->embeddedFont_label_1->setFont(embedded_font);
+ ui->embeddedFont_label_9->setFont(embedded_font);
+
+ QFont system_font{GUIUtil::fixedPitchFont(false)};
+ ui->systemFont_radioButton->setText(ui->systemFont_radioButton->text().arg(QFontInfo(system_font).family()));
+ system_font.setWeight(QFont::Bold);
+ ui->systemFont_label_1->setFont(system_font);
+ ui->systemFont_label_9->setFont(system_font);
+ // Checking the embeddedFont_radioButton automatically unchecks the systemFont_radioButton.
+ ui->systemFont_radioButton->setChecked(true);
+
GUIUtil::handleCloseWindowShortcut(this);
}
@@ -246,6 +260,7 @@ void OptionsDialog::setMapper()
mapper->addMapping(ui->lang, OptionsModel::Language);
mapper->addMapping(ui->unit, OptionsModel::DisplayUnit);
mapper->addMapping(ui->thirdPartyTxUrls, OptionsModel::ThirdPartyTxUrls);
+ mapper->addMapping(ui->embeddedFont_radioButton, OptionsModel::UseEmbeddedMonospacedFont);
}
void OptionsDialog::setOkButtonState(bool fState)
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 1e0391a35c..d51a5b06ff 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -163,6 +163,12 @@ void OptionsModel::Init(bool resetSettings)
addOverriddenOption("-lang");
language = settings.value("language").toString();
+
+ if (!settings.contains("UseEmbeddedMonospacedFont")) {
+ settings.setValue("UseEmbeddedMonospacedFont", "true");
+ }
+ m_use_embedded_monospaced_font = settings.value("UseEmbeddedMonospacedFont").toBool();
+ Q_EMIT useEmbeddedMonospacedFontChanged(m_use_embedded_monospaced_font);
}
/** Helper function to copy contents from one QSettings to another.
@@ -326,6 +332,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
return strThirdPartyTxUrls;
case Language:
return settings.value("language");
+ case UseEmbeddedMonospacedFont:
+ return m_use_embedded_monospaced_font;
case CoinControlFeatures:
return fCoinControlFeatures;
case Prune:
@@ -453,6 +461,11 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
setRestartRequired(true);
}
break;
+ case UseEmbeddedMonospacedFont:
+ m_use_embedded_monospaced_font = value.toBool();
+ settings.setValue("UseEmbeddedMonospacedFont", m_use_embedded_monospaced_font);
+ Q_EMIT useEmbeddedMonospacedFontChanged(m_use_embedded_monospaced_font);
+ break;
case CoinControlFeatures:
fCoinControlFeatures = value.toBool();
settings.setValue("fCoinControlFeatures", fCoinControlFeatures);
diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h
index f7171951a1..4d012a9b8f 100644
--- a/src/qt/optionsmodel.h
+++ b/src/qt/optionsmodel.h
@@ -59,6 +59,7 @@ public:
DisplayUnit, // BitcoinUnits::Unit
ThirdPartyTxUrls, // QString
Language, // QString
+ UseEmbeddedMonospacedFont, // bool
CoinControlFeatures, // bool
ThreadsScriptVerif, // int
Prune, // bool
@@ -84,6 +85,7 @@ public:
bool getMinimizeOnClose() const { return fMinimizeOnClose; }
int getDisplayUnit() const { return nDisplayUnit; }
QString getThirdPartyTxUrls() const { return strThirdPartyTxUrls; }
+ bool getUseEmbeddedMonospacedFont() const { return m_use_embedded_monospaced_font; }
bool getCoinControlFeatures() const { return fCoinControlFeatures; }
const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; }
@@ -107,6 +109,7 @@ private:
QString language;
int nDisplayUnit;
QString strThirdPartyTxUrls;
+ bool m_use_embedded_monospaced_font;
bool fCoinControlFeatures;
/* settings that were overridden by command-line */
QString strOverriddenByCommandLine;
@@ -120,6 +123,7 @@ Q_SIGNALS:
void displayUnitChanged(int unit);
void coinControlFeaturesChanged(bool);
void showTrayIconChanged(bool);
+ void useEmbeddedMonospacedFontChanged(bool);
};
#endif // BITCOIN_QT_OPTIONSMODEL_H
diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp
index bc542a0833..7f12b1d2b5 100644
--- a/src/qt/overviewpage.cpp
+++ b/src/qt/overviewpage.cpp
@@ -257,6 +257,9 @@ void OverviewPage::setClientModel(ClientModel *model)
// Show warning, for example if this is a prerelease version
connect(model, &ClientModel::alertsChanged, this, &OverviewPage::updateAlerts);
updateAlerts(model->getStatusBarWarnings());
+
+ connect(model->getOptionsModel(), &OptionsModel::useEmbeddedMonospacedFontChanged, this, &OverviewPage::setMonospacedFont);
+ setMonospacedFont(model->getOptionsModel()->getUseEmbeddedMonospacedFont());
}
}
@@ -321,3 +324,17 @@ void OverviewPage::showOutOfSyncWarning(bool fShow)
ui->labelWalletStatus->setVisible(fShow);
ui->labelTransactionsStatus->setVisible(fShow);
}
+
+void OverviewPage::setMonospacedFont(bool use_embedded_font)
+{
+ QFont f = GUIUtil::fixedPitchFont(use_embedded_font);
+ f.setWeight(QFont::Bold);
+ ui->labelBalance->setFont(f);
+ ui->labelUnconfirmed->setFont(f);
+ ui->labelImmature->setFont(f);
+ ui->labelTotal->setFont(f);
+ ui->labelWatchAvailable->setFont(f);
+ ui->labelWatchPending->setFont(f);
+ ui->labelWatchImmature->setFont(f);
+ ui->labelWatchTotal->setFont(f);
+}
diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h
index 578ef601fb..5158c81678 100644
--- a/src/qt/overviewpage.h
+++ b/src/qt/overviewpage.h
@@ -61,6 +61,7 @@ private Q_SLOTS:
void updateAlerts(const QString &warnings);
void updateWatchOnlyLabels(bool showWatchOnly);
void handleOutOfSyncWarningClicks();
+ void setMonospacedFont(bool use_embedded_font);
};
#endif // BITCOIN_QT_OVERVIEWPAGE_H
diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp
index bad81d894c..5f518a67cd 100644
--- a/src/qt/peertablemodel.cpp
+++ b/src/qt/peertablemodel.cpp
@@ -29,6 +29,8 @@ bool NodeLessThan::operator()(const CNodeCombinedStats &left, const CNodeCombine
return pLeft->nodeid < pRight->nodeid;
case PeerTableModel::Address:
return pLeft->addrName.compare(pRight->addrName) < 0;
+ case PeerTableModel::ConnectionType:
+ return pLeft->m_conn_type < pRight->m_conn_type;
case PeerTableModel::Network:
return pLeft->m_network < pRight->m_network;
case PeerTableModel::Ping:
@@ -163,6 +165,8 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const
case Address:
// prepend to peer address down-arrow symbol for inbound connection and up-arrow for outbound connection
return QString(rec->nodeStats.fInbound ? "↓ " : "↑ ") + QString::fromStdString(rec->nodeStats.addrName);
+ case ConnectionType:
+ return GUIUtil::ConnectionTypeToQString(rec->nodeStats.m_conn_type, /* prepend_direction */ false);
case Network:
return GUIUtil::NetworkToQString(rec->nodeStats.m_network);
case Ping:
@@ -176,6 +180,7 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const
}
} else if (role == Qt::TextAlignmentRole) {
switch (index.column()) {
+ case ConnectionType:
case Network:
return QVariant(Qt::AlignCenter);
case Ping:
diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h
index 7bff239507..0823235ec0 100644
--- a/src/qt/peertablemodel.h
+++ b/src/qt/peertablemodel.h
@@ -59,12 +59,13 @@ public:
enum ColumnIndex {
NetNodeId = 0,
- Address = 1,
- Network = 2,
- Ping = 3,
- Sent = 4,
- Received = 5,
- Subversion = 6
+ Address,
+ ConnectionType,
+ Network,
+ Ping,
+ Sent,
+ Received,
+ Subversion
};
enum {
@@ -87,7 +88,7 @@ public Q_SLOTS:
private:
interfaces::Node& m_node;
- const QStringList columns{tr("Peer Id"), tr("Address"), tr("Network"), tr("Ping"), tr("Sent"), tr("Received"), tr("User Agent")};
+ const QStringList columns{tr("Peer Id"), tr("Address"), tr("Type"), tr("Network"), tr("Ping"), tr("Sent"), tr("Received"), tr("User Agent")};
std::unique_ptr<PeerTablePriv> priv;
QTimer *timer;
};
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp
index 3792f75c5c..62adaa4e9f 100644
--- a/src/qt/receivecoinsdialog.cpp
+++ b/src/qt/receivecoinsdialog.cpp
@@ -19,12 +19,12 @@
#include <QCursor>
#include <QMessageBox>
#include <QScrollBar>
+#include <QSettings>
#include <QTextDocument>
ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::ReceiveCoinsDialog),
- columnResizingFixer(nullptr),
model(nullptr),
platformStyle(_platformStyle)
{
@@ -66,6 +66,22 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
connect(copyAmountAction, &QAction::triggered, this, &ReceiveCoinsDialog::copyAmount);
connect(ui->clearButton, &QPushButton::clicked, this, &ReceiveCoinsDialog::clear);
+
+ QTableView* tableView = ui->recentRequestsView;
+ tableView->verticalHeader()->hide();
+ tableView->setAlternatingRowColors(true);
+ tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
+ tableView->setSelectionMode(QAbstractItemView::ContiguousSelection);
+
+ QSettings settings;
+ if (!tableView->horizontalHeader()->restoreState(settings.value("RecentRequestsViewHeaderState").toByteArray())) {
+ tableView->setColumnWidth(RecentRequestsTableModel::Date, DATE_COLUMN_WIDTH);
+ tableView->setColumnWidth(RecentRequestsTableModel::Label, LABEL_COLUMN_WIDTH);
+ tableView->setColumnWidth(RecentRequestsTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);
+ tableView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
+ tableView->horizontalHeader()->setStretchLastSection(true);
+ }
+ tableView->horizontalHeader()->setSortIndicator(RecentRequestsTableModel::Date, Qt::DescendingOrder);
}
void ReceiveCoinsDialog::setModel(WalletModel *_model)
@@ -79,22 +95,10 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
updateDisplayUnit();
QTableView* tableView = ui->recentRequestsView;
-
- tableView->verticalHeader()->hide();
- tableView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
tableView->setModel(_model->getRecentRequestsTableModel());
- tableView->setAlternatingRowColors(true);
- tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
- tableView->setSelectionMode(QAbstractItemView::ContiguousSelection);
- tableView->setColumnWidth(RecentRequestsTableModel::Date, DATE_COLUMN_WIDTH);
- tableView->setColumnWidth(RecentRequestsTableModel::Label, LABEL_COLUMN_WIDTH);
- tableView->setColumnWidth(RecentRequestsTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);
-
connect(tableView->selectionModel(),
&QItemSelectionModel::selectionChanged, this,
&ReceiveCoinsDialog::recentRequestsView_selectionChanged);
- // Last 2 columns are set by the columnResizingFixer, when the table geometry is ready.
- columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(tableView, AMOUNT_MINIMUM_COLUMN_WIDTH, DATE_COLUMN_WIDTH, this);
if (model->wallet().getDefaultAddressType() == OutputType::BECH32) {
ui->useBech32->setCheckState(Qt::Checked);
@@ -114,6 +118,8 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
ReceiveCoinsDialog::~ReceiveCoinsDialog()
{
+ QSettings settings;
+ settings.setValue("RecentRequestsViewHeaderState", ui->recentRequestsView->horizontalHeader()->saveState());
delete ui;
}
@@ -238,14 +244,6 @@ void ReceiveCoinsDialog::on_removeRequestButton_clicked()
model->getRecentRequestsTableModel()->removeRows(firstIndex.row(), selection.length(), firstIndex.parent());
}
-// We override the virtual resizeEvent of the QWidget to adjust tables column
-// sizes as the tables width is proportional to the dialogs width.
-void ReceiveCoinsDialog::resizeEvent(QResizeEvent *event)
-{
- QWidget::resizeEvent(event);
- columnResizingFixer->stretchColumnWidth(RecentRequestsTableModel::Message);
-}
-
QModelIndex ReceiveCoinsDialog::selectedRow()
{
if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel())
diff --git a/src/qt/receivecoinsdialog.h b/src/qt/receivecoinsdialog.h
index 097201c183..f12cd8ce0c 100644
--- a/src/qt/receivecoinsdialog.h
+++ b/src/qt/receivecoinsdialog.h
@@ -51,14 +51,12 @@ public Q_SLOTS:
private:
Ui::ReceiveCoinsDialog *ui;
- GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;
WalletModel *model;
QMenu *contextMenu;
const PlatformStyle *platformStyle;
QModelIndex selectedRow();
void copyColumnToClipboard(int column);
- virtual void resizeEvent(QResizeEvent *event) override;
private Q_SLOTS:
void on_receiveButton_clicked();
diff --git a/src/qt/res/fonts/RobotoMono-Bold.ttf b/src/qt/res/fonts/RobotoMono-Bold.ttf
new file mode 100644
index 0000000000..900fce6848
--- /dev/null
+++ b/src/qt/res/fonts/RobotoMono-Bold.ttf
Binary files differ
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index ea12ce1583..4a4b557acc 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -473,6 +473,11 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
tr("Outbound Address Fetch: short-lived, for soliciting addresses")};
const QString list{"<ul><li>" + Join(CONNECTION_TYPE_DOC, QString("</li><li>")) + "</li></ul>"};
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list));
+ const QString hb_list{"<ul><li>\""
+ + tr("To") + "\" – " + tr("we selected the peer for high bandwidth relay") + "</li><li>\""
+ + tr("From") + "\" – " + tr("the peer selected us for high bandwidth relay") + "</li><li>\""
+ + tr("No") + "\" – " + tr("no high bandwidth relay selected") + "</li></ul>"};
+ ui->peerHighBandwidthLabel->setToolTip(ui->peerHighBandwidthLabel->toolTip().arg(hb_list));
ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir"));
ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir"));
ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(PACKAGE_NAME));
@@ -1097,7 +1102,7 @@ void RPCConsole::updateDetailWidget()
{
const QList<QModelIndex> selected_peers = GUIUtil::getEntryData(ui->peerWidget, PeerTableModel::NetNodeId);
if (!clientModel || !clientModel->getPeerTableModel() || selected_peers.size() != 1) {
- ui->detailWidget->hide();
+ ui->peersTabRightPanel->hide();
ui->peerHeading->setText(tr("Select a peer to view detailed information."));
return;
}
@@ -1109,6 +1114,12 @@ void RPCConsole::updateDetailWidget()
peerAddrDetails += "<br />" + tr("via %1").arg(QString::fromStdString(stats->nodeStats.addrLocal));
ui->peerHeading->setText(peerAddrDetails);
ui->peerServices->setText(GUIUtil::formatServicesStr(stats->nodeStats.nServices));
+ ui->peerRelayTxes->setText(stats->nodeStats.fRelayTxes ? "Yes" : "No");
+ QString bip152_hb_settings;
+ if (stats->nodeStats.m_bip152_highbandwidth_to) bip152_hb_settings += "To";
+ if (stats->nodeStats.m_bip152_highbandwidth_from) bip152_hb_settings += (bip152_hb_settings == "" ? "From" : "/From");
+ if (bip152_hb_settings == "") bip152_hb_settings = "No";
+ ui->peerHighBandwidth->setText(bip152_hb_settings);
ui->peerLastSend->setText(stats->nodeStats.nLastSend ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nLastSend) : tr("never"));
ui->peerLastRecv->setText(stats->nodeStats.nLastRecv ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nLastRecv) : tr("never"));
ui->peerBytesSent->setText(GUIUtil::formatBytes(stats->nodeStats.nSendBytes));
@@ -1119,7 +1130,7 @@ void RPCConsole::updateDetailWidget()
ui->timeoffset->setText(GUIUtil::formatTimeOffset(stats->nodeStats.nTimeOffset));
ui->peerVersion->setText(QString::number(stats->nodeStats.nVersion));
ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer));
- ui->peerConnectionType->setText(GUIUtil::ConnectionTypeToQString(stats->nodeStats.m_conn_type));
+ ui->peerConnectionType->setText(GUIUtil::ConnectionTypeToQString(stats->nodeStats.m_conn_type, /* prepend_direction */ true));
ui->peerNetwork->setText(GUIUtil::NetworkToQString(stats->nodeStats.m_network));
if (stats->nodeStats.m_permissionFlags == PF_NONE) {
ui->peerPermissions->setText(tr("N/A"));
@@ -1151,7 +1162,7 @@ void RPCConsole::updateDetailWidget()
ui->peerPingWait->setText(GUIUtil::formatPingTime(stats->nodeStateStats.m_ping_wait_usec));
}
- ui->detailWidget->show();
+ ui->peersTabRightPanel->show();
}
void RPCConsole::resizeEvent(QResizeEvent *event)
diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp
index 0cf6480b82..b568f41158 100644
--- a/src/qt/transactionview.cpp
+++ b/src/qt/transactionview.cpp
@@ -31,6 +31,7 @@
#include <QMenu>
#include <QPoint>
#include <QScrollBar>
+#include <QSettings>
#include <QTableView>
#include <QTimer>
#include <QUrl>
@@ -126,27 +127,40 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
vlayout->setContentsMargins(0,0,0,0);
vlayout->setSpacing(0);
- QTableView *view = new QTableView(this);
+ transactionView = new QTableView(this);
+ transactionView->setObjectName("transactionView");
vlayout->addLayout(hlayout);
vlayout->addWidget(createDateRangeWidget());
- vlayout->addWidget(view);
+ vlayout->addWidget(transactionView);
vlayout->setSpacing(0);
- int width = view->verticalScrollBar()->sizeHint().width();
+ int width = transactionView->verticalScrollBar()->sizeHint().width();
// Cover scroll bar width with spacing
if (platformStyle->getUseExtraSpacing()) {
hlayout->addSpacing(width+2);
} else {
hlayout->addSpacing(width);
}
- // Always show scroll bar
- view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
- view->setTabKeyNavigation(false);
- view->setContextMenuPolicy(Qt::CustomContextMenu);
-
- view->installEventFilter(this);
-
- transactionView = view;
- transactionView->setObjectName("transactionView");
+ transactionView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
+ transactionView->setTabKeyNavigation(false);
+ transactionView->setContextMenuPolicy(Qt::CustomContextMenu);
+ transactionView->installEventFilter(this);
+ transactionView->setAlternatingRowColors(true);
+ transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);
+ transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
+ transactionView->setSortingEnabled(true);
+ transactionView->verticalHeader()->hide();
+
+ QSettings settings;
+ if (!transactionView->horizontalHeader()->restoreState(settings.value("TransactionViewHeaderState").toByteArray())) {
+ transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH);
+ transactionView->setColumnWidth(TransactionTableModel::Watchonly, WATCHONLY_COLUMN_WIDTH);
+ transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH);
+ transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH);
+ transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);
+ transactionView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
+ transactionView->horizontalHeader()->setStretchLastSection(true);
+ }
+ transactionView->horizontalHeader()->setSortIndicator(TransactionTableModel::Date, Qt::DescendingOrder);
// Actions
abandonAction = new QAction(tr("Abandon transaction"), this);
@@ -158,7 +172,6 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
QAction *copyTxHexAction = new QAction(tr("Copy raw transaction"), this);
QAction *copyTxPlainText = new QAction(tr("Copy full transaction details"), this);
- QAction *editLabelAction = new QAction(tr("Edit label"), this);
QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
contextMenu = new QMenu(this);
@@ -173,7 +186,6 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
contextMenu->addSeparator();
contextMenu->addAction(bumpFeeAction);
contextMenu->addAction(abandonAction);
- contextMenu->addAction(editLabelAction);
connect(dateWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseDate);
connect(typeWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseType);
@@ -183,8 +195,8 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
connect(search_widget, &QLineEdit::textChanged, prefix_typing_delay, static_cast<void (QTimer::*)()>(&QTimer::start));
connect(prefix_typing_delay, &QTimer::timeout, this, &TransactionView::changedSearch);
- connect(view, &QTableView::doubleClicked, this, &TransactionView::doubleClicked);
- connect(view, &QTableView::customContextMenuRequested, this, &TransactionView::contextualMenu);
+ connect(transactionView, &QTableView::doubleClicked, this, &TransactionView::doubleClicked);
+ connect(transactionView, &QTableView::customContextMenuRequested, this, &TransactionView::contextualMenu);
connect(bumpFeeAction, &QAction::triggered, this, &TransactionView::bumpFee);
connect(abandonAction, &QAction::triggered, this, &TransactionView::abandonTx);
@@ -194,7 +206,6 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
connect(copyTxIDAction, &QAction::triggered, this, &TransactionView::copyTxID);
connect(copyTxHexAction, &QAction::triggered, this, &TransactionView::copyTxHex);
connect(copyTxPlainText, &QAction::triggered, this, &TransactionView::copyTxPlainText);
- connect(editLabelAction, &QAction::triggered, this, &TransactionView::editLabel);
connect(showDetailsAction, &QAction::triggered, this, &TransactionView::showDetails);
// Double-clicking on a transaction on the transaction history page shows details
connect(this, &TransactionView::doubleClicked, this, &TransactionView::showDetails);
@@ -204,6 +215,12 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
});
}
+TransactionView::~TransactionView()
+{
+ QSettings settings;
+ settings.setValue("TransactionViewHeaderState", transactionView->horizontalHeader()->saveState());
+}
+
void TransactionView::setModel(WalletModel *_model)
{
this->model = _model;
@@ -214,25 +231,8 @@ void TransactionView::setModel(WalletModel *_model)
transactionProxyModel->setDynamicSortFilter(true);
transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
-
transactionProxyModel->setSortRole(Qt::EditRole);
-
- transactionView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
transactionView->setModel(transactionProxyModel);
- transactionView->setAlternatingRowColors(true);
- transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);
- transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
- transactionView->horizontalHeader()->setSortIndicator(TransactionTableModel::Date, Qt::DescendingOrder);
- transactionView->setSortingEnabled(true);
- transactionView->verticalHeader()->hide();
-
- transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH);
- transactionView->setColumnWidth(TransactionTableModel::Watchonly, WATCHONLY_COLUMN_WIDTH);
- transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH);
- transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH);
- transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);
-
- columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(transactionView, AMOUNT_MINIMUM_COLUMN_WIDTH, MINIMUM_COLUMN_WIDTH, this);
if (_model->getOptionsModel())
{
@@ -474,52 +474,6 @@ void TransactionView::copyTxPlainText()
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxPlainTextRole);
}
-void TransactionView::editLabel()
-{
- if(!transactionView->selectionModel() ||!model)
- return;
- QModelIndexList selection = transactionView->selectionModel()->selectedRows();
- if(!selection.isEmpty())
- {
- AddressTableModel *addressBook = model->getAddressTableModel();
- if(!addressBook)
- return;
- QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString();
- if(address.isEmpty())
- {
- // If this transaction has no associated address, exit
- return;
- }
- // Is address in address book? Address book can miss address when a transaction is
- // sent from outside the UI.
- int idx = addressBook->lookupAddress(address);
- if(idx != -1)
- {
- // Edit sending / receiving address
- QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());
- // Determine type of address, launch appropriate editor dialog type
- QString type = modelIdx.data(AddressTableModel::TypeRole).toString();
-
- EditAddressDialog dlg(
- type == AddressTableModel::Receive
- ? EditAddressDialog::EditReceivingAddress
- : EditAddressDialog::EditSendingAddress, this);
- dlg.setModel(addressBook);
- dlg.loadRow(idx);
- dlg.exec();
- }
- else
- {
- // Add sending address
- EditAddressDialog dlg(EditAddressDialog::NewSendingAddress,
- this);
- dlg.setModel(addressBook);
- dlg.setAddress(address);
- dlg.exec();
- }
- }
-}
-
void TransactionView::showDetails()
{
if(!transactionView->selectionModel())
@@ -623,14 +577,6 @@ void TransactionView::focusTransaction(const uint256& txid)
}
}
-// We override the virtual resizeEvent of the QWidget to adjust tables column
-// sizes as the tables width is proportional to the dialogs width.
-void TransactionView::resizeEvent(QResizeEvent* event)
-{
- QWidget::resizeEvent(event);
- columnResizingFixer->stretchColumnWidth(TransactionTableModel::ToAddress);
-}
-
// Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text
bool TransactionView::eventFilter(QObject *obj, QEvent *event)
{
diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h
index b268823066..cd40813461 100644
--- a/src/qt/transactionview.h
+++ b/src/qt/transactionview.h
@@ -35,6 +35,7 @@ class TransactionView : public QWidget
public:
explicit TransactionView(const PlatformStyle *platformStyle, QWidget *parent = nullptr);
+ ~TransactionView();
void setModel(WalletModel *model);
@@ -82,10 +83,6 @@ private:
QWidget *createDateRangeWidget();
- GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer{nullptr};
-
- virtual void resizeEvent(QResizeEvent* event) override;
-
bool eventFilter(QObject *obj, QEvent *event) override;
private Q_SLOTS:
@@ -93,7 +90,6 @@ private Q_SLOTS:
void dateRangeChanged();
void showDetails();
void copyAddress();
- void editLabel();
void copyLabel();
void copyAmount();
void copyTxID();
diff --git a/src/test/txvalidationcache_tests.cpp b/src/test/txvalidationcache_tests.cpp
index 288f807abd..3244b58082 100644
--- a/src/test/txvalidationcache_tests.cpp
+++ b/src/test/txvalidationcache_tests.cpp
@@ -13,7 +13,10 @@
#include <boost/test/unit_test.hpp>
-bool CheckInputScripts(const CTransaction& tx, TxValidationState &state, const CCoinsViewCache &inputs, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData& txdata, std::vector<CScriptCheck> *pvChecks);
+bool CheckInputScripts(const CTransaction& tx, TxValidationState& state,
+ const CCoinsViewCache& inputs, unsigned int flags, bool cacheSigStore,
+ bool cacheFullScriptStore, PrecomputedTransactionData& txdata,
+ std::vector<CScriptCheck>* pvChecks) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
BOOST_AUTO_TEST_SUITE(txvalidationcache_tests)
diff --git a/src/validation.cpp b/src/validation.cpp
index 1b8fb1fd45..0b2ca4b422 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -199,7 +199,11 @@ CBlockIndex* BlockManager::FindForkInGlobalIndex(const CChain& chain, const CBlo
std::unique_ptr<CBlockTreeDB> pblocktree;
-bool CheckInputScripts(const CTransaction& tx, TxValidationState &state, const CCoinsViewCache &inputs, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData& txdata, std::vector<CScriptCheck> *pvChecks = nullptr);
+bool CheckInputScripts(const CTransaction& tx, TxValidationState& state,
+ const CCoinsViewCache& inputs, unsigned int flags, bool cacheSigStore,
+ bool cacheFullScriptStore, PrecomputedTransactionData& txdata,
+ std::vector<CScriptCheck>* pvChecks = nullptr)
+ EXCLUSIVE_LOCKS_REQUIRED(cs_main);
static FILE* OpenUndoFile(const FlatFilePos &pos, bool fReadOnly = false);
static FlatFileSeq BlockFileSeq();
static FlatFileSeq UndoFileSeq();
@@ -1481,7 +1485,10 @@ void InitScriptExecutionCache() {
*
* Non-static (and re-declared) in src/test/txvalidationcache_tests.cpp
*/
-bool CheckInputScripts(const CTransaction& tx, TxValidationState &state, const CCoinsViewCache &inputs, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData& txdata, std::vector<CScriptCheck> *pvChecks) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
+bool CheckInputScripts(const CTransaction& tx, TxValidationState& state,
+ const CCoinsViewCache& inputs, unsigned int flags, bool cacheSigStore,
+ bool cacheFullScriptStore, PrecomputedTransactionData& txdata,
+ std::vector<CScriptCheck>* pvChecks)
{
if (tx.IsCoinBase()) return true;