From 60a9ef98a6c93ae613c1b3070ed14c2273b201d8 Mon Sep 17 00:00:00 2001 From: levoncrypto Date: Sun, 27 Oct 2024 16:20:27 +0400 Subject: [PATCH] Fix build and run issues with --disable-wallet configuration --- src/qt/bitcoinaddressvalidator.h | 4 ++++ src/qt/bitcoingui.cpp | 27 ++++++++++++++------------- src/wallet/coincontrol.h | 1 + 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/qt/bitcoinaddressvalidator.h b/src/qt/bitcoinaddressvalidator.h index f1d106dee6..2a08e483e2 100644 --- a/src/qt/bitcoinaddressvalidator.h +++ b/src/qt/bitcoinaddressvalidator.h @@ -6,7 +6,11 @@ #define BITCOIN_QT_BITCOINADDRESSVALIDATOR_H #include + +#ifdef ENABLE_WALLET #include "../spark/sparkwallet.h" +#endif + #include "../spark/state.h" /** Base58 entry widget validator, checks for valid characters and diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 6e14a99593..47babf2ab7 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -1481,19 +1481,20 @@ void BitcoinGUI::resizeEvent(QResizeEvent* event) { // Retrieve new dimensions from the resize event int newWidth = event->size().width(); - int newHeight = event->size().height(); int actionWidth = newWidth / 6; - // Set widths for each action dynamically - QWidget* overviewWidget = toolbar->widgetForAction(overviewAction); - QWidget* receiveWidget = toolbar->widgetForAction(receiveCoinsAction); - QWidget* historyWidget = toolbar->widgetForAction(historyAction); - QWidget* sendCoinsWidget = toolbar->widgetForAction(sendCoinsAction); - QWidget* masternodeWidget = toolbar->widgetForAction(masternodeAction); - - overviewWidget->setMinimumWidth(actionWidth); - receiveWidget->setMinimumWidth(actionWidth); - historyWidget->setMinimumWidth(actionWidth); - sendCoinsWidget->setMinimumWidth(actionWidth); - masternodeWidget->setMinimumWidth(actionWidth); + if (toolbar) { + // Set widths for each action dynamically + QWidget* overviewWidget = overviewAction ? toolbar->widgetForAction(overviewAction) : nullptr; + QWidget* receiveWidget = receiveCoinsAction ? toolbar->widgetForAction(receiveCoinsAction) : nullptr; + QWidget* historyWidget = historyAction ? toolbar->widgetForAction(historyAction) : nullptr; + QWidget* sendCoinsWidget = sendCoinsAction ? toolbar->widgetForAction(sendCoinsAction) : nullptr; + QWidget* masternodeWidget = masternodeAction ? toolbar->widgetForAction(masternodeAction) : nullptr; + + if (overviewWidget) overviewWidget->setMinimumWidth(actionWidth); + if (receiveWidget) receiveWidget->setMinimumWidth(actionWidth); + if (historyWidget) historyWidget->setMinimumWidth(actionWidth); + if (sendCoinsWidget) sendCoinsWidget->setMinimumWidth(actionWidth); + if (masternodeWidget) masternodeWidget->setMinimumWidth(actionWidth); + } } \ No newline at end of file diff --git a/src/wallet/coincontrol.h b/src/wallet/coincontrol.h index feed073c26..5dcf5e8363 100644 --- a/src/wallet/coincontrol.h +++ b/src/wallet/coincontrol.h @@ -6,6 +6,7 @@ #define BITCOIN_WALLET_COINCONTROL_H #include "primitives/transaction.h" +#include "base58.h" enum class CoinType {