diff options
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/bitcoin.cpp | 4 | ||||
-rw-r--r-- | src/qt/bitcoingui.cpp | 5 | ||||
-rw-r--r-- | src/qt/bitcoingui.h | 1 | ||||
-rw-r--r-- | src/qt/clientmodel.cpp | 4 | ||||
-rw-r--r-- | src/qt/guiconstants.h | 1 | ||||
-rw-r--r-- | src/qt/networkstyle.cpp | 3 | ||||
-rw-r--r-- | src/qt/rpcconsole.cpp | 4 | ||||
-rw-r--r-- | src/qt/walletcontroller.cpp | 4 | ||||
-rw-r--r-- | src/qt/walletframe.cpp | 25 |
9 files changed, 46 insertions, 5 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index eaaaaeb904..3055cd7da6 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -166,8 +166,8 @@ void BitcoinCore::initialize() { try { - qDebug() << __func__ << ": Running initialization in thread"; util::ThreadRename("qt-init"); + qDebug() << __func__ << ": Running initialization in thread"; interfaces::BlockAndHeaderTipInfo tip_info; bool rv = m_node.appInitMain(&tip_info); Q_EMIT initializeResult(rv, tip_info); @@ -533,7 +533,7 @@ int GuiMain(int argc, char* argv[]) // - QSettings() will use the new application name after this, resulting in network-specific settings // - Needs to be done before createOptionsModel - // Check for -chain, -testnet or -regtest parameter (Params() calls are only valid after this clause) + // Check for chain settings (Params() calls are only valid after this clause) try { SelectParams(gArgs.GetChainName()); } catch(std::exception &e) { diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index aa58c0b10e..0c2dcc3584 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -660,6 +660,11 @@ void BitcoinGUI::setWalletController(WalletController* wallet_controller) } } +WalletController* BitcoinGUI::getWalletController() +{ + return m_wallet_controller; +} + void BitcoinGUI::addWallet(WalletModel* walletModel) { if (!walletFrame) return; diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 4c55f28693..912297a74e 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -79,6 +79,7 @@ public: void setClientModel(ClientModel *clientModel = nullptr, interfaces::BlockAndHeaderTipInfo* tip_info = nullptr); #ifdef ENABLE_WALLET void setWalletController(WalletController* wallet_controller); + WalletController* getWalletController(); #endif #ifdef ENABLE_WALLET diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 7822d4c5f3..a2f46c339b 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -15,6 +15,7 @@ #include <net.h> #include <netbase.h> #include <util/system.h> +#include <util/threadnames.h> #include <validation.h> #include <stdint.h> @@ -52,6 +53,9 @@ ClientModel::ClientModel(interfaces::Node& node, OptionsModel *_optionsModel, QO // move timer to thread so that polling doesn't disturb main event loop timer->moveToThread(m_thread); m_thread->start(); + QTimer::singleShot(0, timer, []() { + util::ThreadRename("qt-clientmodl"); + }); subscribeToCoreSignals(); } diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 9457ea37d6..882d2c8f52 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -46,6 +46,7 @@ static const int TOOLTIP_WRAP_THRESHOLD = 80; #define QAPP_ORG_DOMAIN "bitcoin.org" #define QAPP_APP_NAME_DEFAULT "Bitcoin-Qt" #define QAPP_APP_NAME_TESTNET "Bitcoin-Qt-testnet" +#define QAPP_APP_NAME_SIGNET "Bitcoin-Qt-signet" #define QAPP_APP_NAME_REGTEST "Bitcoin-Qt-regtest" /* One gigabyte (GB) in bytes */ diff --git a/src/qt/networkstyle.cpp b/src/qt/networkstyle.cpp index 3a251e0573..b1081f6aee 100644 --- a/src/qt/networkstyle.cpp +++ b/src/qt/networkstyle.cpp @@ -19,7 +19,8 @@ static const struct { } network_styles[] = { {"main", QAPP_APP_NAME_DEFAULT, 0, 0}, {"test", QAPP_APP_NAME_TESTNET, 70, 30}, - {"regtest", QAPP_APP_NAME_REGTEST, 160, 30} + {"signet", QAPP_APP_NAME_SIGNET, 35, 15}, + {"regtest", QAPP_APP_NAME_REGTEST, 160, 30}, }; static const unsigned network_styles_count = sizeof(network_styles)/sizeof(*network_styles); diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index a14fae6460..4c5601242e 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -20,6 +20,7 @@ #include <rpc/client.h> #include <util/strencodings.h> #include <util/system.h> +#include <util/threadnames.h> #include <univalue.h> @@ -978,6 +979,9 @@ void RPCConsole::startExecutor() // Default implementation of QThread::run() simply spins up an event loop in the thread, // which is what we want. thread.start(); + QTimer::singleShot(0, executor, []() { + util::ThreadRename("qt-rpcconsole"); + }); } void RPCConsole::on_tabWidget_currentChanged(int index) diff --git a/src/qt/walletcontroller.cpp b/src/qt/walletcontroller.cpp index bee17abf11..d9e0274d01 100644 --- a/src/qt/walletcontroller.cpp +++ b/src/qt/walletcontroller.cpp @@ -14,6 +14,7 @@ #include <interfaces/handler.h> #include <interfaces/node.h> #include <util/string.h> +#include <util/threadnames.h> #include <util/translation.h> #include <wallet/wallet.h> @@ -45,6 +46,9 @@ WalletController::WalletController(ClientModel& client_model, const PlatformStyl m_activity_worker->moveToThread(m_activity_thread); m_activity_thread->start(); + QTimer::singleShot(0, m_activity_worker, []() { + util::ThreadRename("qt-walletctrl"); + }); } // Not using the default destructor because not all member types definitions are diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp index ec56f2755f..f16761d6b2 100644 --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -2,6 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include <qt/createwalletdialog.h> +#include <qt/walletcontroller.h> #include <qt/walletframe.h> #include <qt/walletmodel.h> @@ -10,8 +12,11 @@ #include <cassert> +#include <QGroupBox> #include <QHBoxLayout> #include <QLabel> +#include <QPushButton> +#include <QVBoxLayout> WalletFrame::WalletFrame(const PlatformStyle *_platformStyle, BitcoinGUI *_gui) : QFrame(_gui), @@ -25,9 +30,25 @@ WalletFrame::WalletFrame(const PlatformStyle *_platformStyle, BitcoinGUI *_gui) walletFrameLayout->setContentsMargins(0,0,0,0); walletFrameLayout->addWidget(walletStack); - QLabel *noWallet = new QLabel(tr("No wallet has been loaded.")); + // hbox for no wallet + QGroupBox* no_wallet_group = new QGroupBox(walletStack); + QVBoxLayout* no_wallet_layout = new QVBoxLayout(no_wallet_group); + + QLabel *noWallet = new QLabel(tr("No wallet has been loaded.\nGo to File > Open Wallet to load a wallet.\n- OR -")); noWallet->setAlignment(Qt::AlignCenter); - walletStack->addWidget(noWallet); + no_wallet_layout->addWidget(noWallet, 0, Qt::AlignHCenter | Qt::AlignBottom); + + // A button for create wallet dialog + QPushButton* create_wallet_button = new QPushButton(tr("Create a new wallet"), walletStack); + connect(create_wallet_button, &QPushButton::clicked, [this] { + auto activity = new CreateWalletActivity(gui->getWalletController(), this); + connect(activity, &CreateWalletActivity::finished, activity, &QObject::deleteLater); + activity->create(); + }); + no_wallet_layout->addWidget(create_wallet_button, 0, Qt::AlignHCenter | Qt::AlignTop); + no_wallet_group->setLayout(no_wallet_layout); + + walletStack->addWidget(no_wallet_group); } WalletFrame::~WalletFrame() |