Skip to content

Commit

Permalink
Fix qt wallet build
Browse files Browse the repository at this point in the history
  • Loading branch information
timemarkovqtum committed Apr 12, 2024
1 parent 645ddd4 commit 59cfe17
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/qt/addressfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <key_io.h>
#include <qt/qvalidatedlineedit.h>
#include <qt/bitcoinaddressvalidator.h>
#include <script/standard.h>
#include <addresstype.h>
#include <QLineEdit>
#include <QCompleter>

Expand Down
21 changes: 11 additions & 10 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <chain.h>
#include <chainparams.h>
#include <common/system.h>
#include <common/args.h>
#include <interfaces/handler.h>
#include <interfaces/node.h>
#include <node/interface_ui.h>
Expand Down Expand Up @@ -322,7 +323,7 @@ void BitcoinGUI::createActions()
sendCoinsAction->setCheckable(true);
tabGroup->addAction(sendCoinsAction);

receiveCoinsAction = new QAction(platformStyle->MultiStatesIcon(":/icons/receive_from"), tr("&Receive"), this);
receiveCoinsAction = new QAction(platformStyle->MultiStatesIcon(":/icons/receive_from"), tr("&Receive"), this);
receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and qtum: URIs)"));
receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip());
receiveCoinsAction->setCheckable(true);
Expand Down Expand Up @@ -420,7 +421,7 @@ void BitcoinGUI::createActions()
unlockWalletAction->setObjectName("unlockWalletAction");
lockWalletAction = new QAction(tr("&Lock Wallet"), this);
lockWalletAction->setToolTip(tr("Lock wallet"));
signMessageAction = new QAction(tr("Sign &message…"), this);
signMessageAction = new QAction(tr("Sign &message…"), this);
signMessageAction->setStatusTip(tr("Sign messages with your Qtum addresses to prove you own them"));
verifyMessageAction = new QAction(tr("&Verify message…"), this);
verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Qtum addresses"));
Expand Down Expand Up @@ -599,7 +600,7 @@ void BitcoinGUI::createMenuBar()
file->addAction(m_migrate_wallet_action);
file->addSeparator();
file->addAction(backupWalletAction);
file->addAction(restoreWalletAction);
file->addAction(restoreWalletAction);
file->addAction(m_restore_wallet_action);
file->addSeparator();
file->addAction(openAction);
Expand Down Expand Up @@ -795,9 +796,9 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
// initialize the disable state of the tray icon with the current value in the model.
trayIcon->setVisible(optionsModel->getShowTrayIcon());
}

m_mask_values_action->setChecked(_clientModel->getOptionsModel()->getOption(OptionsModel::OptionID::MaskValues).toBool());
#ifdef ENABLE_WALLET

#ifdef ENABLE_WALLET
if (optionsModel && appTitleBar) {
connect(optionsModel, &OptionsModel::displayUnitChanged, appTitleBar, &TitleBar::updateDisplayUnit);
}
Expand Down Expand Up @@ -920,7 +921,7 @@ void BitcoinGUI::removeWallet(WalletModel* walletModel)
m_wallet_selector->setVisible(false);
}
rpcConsole->removeWallet(walletModel);
appTitleBar->removeWallet(walletModel);
appTitleBar->removeWallet(walletModel);
walletFrame->removeWallet(walletModel);
updateWindowTitle();
}
Expand Down Expand Up @@ -1367,7 +1368,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer

progressBarLabel->setVisible(false);
progressBar->setVisible(false);
}

// notify tip changed when the sync is finished
if(clientModel->fBatchProcessingMode)
{
Expand Down Expand Up @@ -1753,7 +1754,7 @@ void BitcoinGUI::toggleHidden()
#ifdef ENABLE_WALLET
void BitcoinGUI::updateLedgerIcon()
{
if(m_node.shutdownRequested() || !clientModel || clientModel->fBatchProcessingMode)
if(!clientModel || clientModel->fBatchProcessingMode || m_node.shutdownRequested())
return;

WalletView * const walletView = walletFrame ? walletFrame->currentWalletView() : 0;
Expand Down Expand Up @@ -1797,7 +1798,7 @@ void BitcoinGUI::updateLedgerIcon()

void BitcoinGUI::updateStakingIcon()
{
if(m_node.shutdownRequested() || !clientModel || clientModel->fBatchProcessingMode)
if(!clientModel || clientModel->fBatchProcessingMode || m_node.shutdownRequested())
return;

WalletView * const walletView = walletFrame ? walletFrame->currentWalletView() : 0;
Expand Down Expand Up @@ -2062,4 +2063,4 @@ void BitcoinGUI::join()
}
}
#endif // ENABLE_WALLET
}
}
6 changes: 0 additions & 6 deletions src/qt/createwalletdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,6 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
// enable and uncheck it if isHardwareWalletChecked is false
ui->blank_wallet_checkbox->setEnabled(!checked);
ui->blank_wallet_checkbox->setChecked(checked);

#ifdef USE_SQLITE
// Enable and check descriptor_checkbox when isHardwareWalletChecked is true,
ui->descriptor_checkbox->setEnabled(!checked);
ui->descriptor_checkbox->setChecked(checked);
#endif
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/qt/execrpccommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ bool ExecRPCCommand::exec(interfaces::Node &node, const WalletModel* wallet_mode
{
try // Nice formatting for standard-format error
{
int code = find_value(objError, "code").getInt<int>();
std::string message = find_value(objError, "message").get_str();
int code = objError.find_value("code").getInt<int>();
std::string message = objError.find_value("message").get_str();
errorMessage = QString::fromStdString(message) + " (code " + QString::number(code) + ")";
}
catch (const std::runtime_error&) // raised when converting to invalid type, i.e. missing code or message
Expand Down
5 changes: 5 additions & 0 deletions src/qt/forms/debugwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1761,6 +1761,11 @@
<slot>clear()</slot>
</slots>
</customwidget>
<customwidget>
<class>QtumPushButton</class>
<extends>QPushButton</extends>
<header>qt/qtumpushbutton.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../bitcoin.qrc"/>
Expand Down
2 changes: 1 addition & 1 deletion src/qt/qtumhwitool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <qt/execrpccommand.h>
#include <qt/walletmodel.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <common/system.h>
#include <qtum/qtumledger.h>
#include <chainparams.h>
#include <outputtype.h>
Expand Down
2 changes: 1 addition & 1 deletion src/qt/tokentransactiondesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TokenTransactionFormater
itemNameColor = GetStringStyleValue("tokentransactiondesc/item-name-color", "#ffffff");
itemColor = GetStringStyleValue("tokentransactiondesc/item-color", "#ffffff");
itemFontBold = GetIntStyleValue("tokentransactiondesc/item-font-bold", true);
network = Params().NetworkIDString();
network = Params().GetChainTypeString();
}

static const TokenTransactionFormater& instance()
Expand Down
2 changes: 1 addition & 1 deletion src/qt/tokentransactiontablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <validation.h>
#include <sync.h>
#include <uint256.h>
#include <util/system.h>
#include <common/system.h>
#include <interfaces/wallet.h>
#include <interfaces/handler.h>
#include <interfaces/node.h>
Expand Down
2 changes: 1 addition & 1 deletion src/qt/transactiondesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class TransactionFormater
itemNameColor = GetStringStyleValue("transactiondesc/item-name-color", "#ffffff");
itemColor = GetStringStyleValue("transactiondesc/item-color", "#ffffff");
itemFontBold = GetIntStyleValue("transactiondesc/item-font-bold", true);
network = Params().NetworkIDString();
network = Params().GetChainTypeString();
}

static const TransactionFormater& instance()
Expand Down
5 changes: 3 additions & 2 deletions src/qt/transactionrecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
}
else
{
sub.type = TransactionRecord::RecvWithAddress;
sub.address = EncodeDestination(wtx.txout_address[i]);
sub.type = TransactionRecord::RecvWithAddress;
sub.address = EncodeDestination(wtx.txout_address[i]);
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/qt/walletframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <qt/titlebar.h>
#include <util/fs.h>
#include <util/fs_helpers.h>
#include <util/system.h>
#include <common/system.h>

#include <wallet/wallet.h>
#include <cassert>
Expand Down
6 changes: 3 additions & 3 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,8 @@ QList<HWDevice> WalletModel::getDevices()

void WalletModel::checkHardwareDevice()
{
int64_t time = GetTimeMillis();
if(time > (count_milliseconds(DEVICE_UPDATE_DELAY) + deviceTime))
auto time{Now<SteadyMilliseconds>()};
if(time > DEVICE_UPDATE_DELAY + deviceTime)
{
QList<HWDevice> tmpDevices;

Expand Down Expand Up @@ -1092,7 +1092,7 @@ void WalletModel::checkHardwareDevice()
}

// Set update time
deviceTime = GetTimeMillis();
deviceTime = Now<SteadyMilliseconds>();
devices = tmpDevices;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/qt/walletmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class WalletModel : public QObject
QString pathP2SH;
QString pathBech32;
QList<HWDevice> devices;
int64_t deviceTime = 0;
SteadyMilliseconds deviceTime{0ms};

QThread t;
WalletWorker *worker{nullptr};
Expand Down

0 comments on commit 59cfe17

Please sign in to comment.