diff options
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/bitcoin.cpp | 2 | ||||
-rw-r--r-- | src/qt/bitcoinamountfield.cpp | 2 | ||||
-rw-r--r-- | src/qt/bitcoingui.cpp | 40 | ||||
-rw-r--r-- | src/qt/forms/debugwindow.ui | 9 | ||||
-rw-r--r-- | src/qt/forms/modaloverlay.ui | 8 | ||||
-rw-r--r-- | src/qt/forms/psbtoperationsdialog.ui | 2 | ||||
-rw-r--r-- | src/qt/forms/receiverequestdialog.ui | 8 | ||||
-rw-r--r-- | src/qt/forms/sendcoinsdialog.ui | 6 | ||||
-rw-r--r-- | src/qt/guiutil.cpp | 2 | ||||
-rw-r--r-- | src/qt/intro.cpp | 8 | ||||
-rw-r--r-- | src/qt/modaloverlay.cpp | 4 | ||||
-rw-r--r-- | src/qt/optionsdialog.cpp | 8 | ||||
-rw-r--r-- | src/qt/paymentserver.cpp | 7 | ||||
-rw-r--r-- | src/qt/qrimagewidget.cpp | 2 | ||||
-rw-r--r-- | src/qt/qvaluecombobox.cpp | 2 | ||||
-rw-r--r-- | src/qt/rpcconsole.cpp | 47 | ||||
-rw-r--r-- | src/qt/rpcconsole.h | 2 | ||||
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 10 | ||||
-rw-r--r-- | src/qt/test/rpcnestedtests.cpp | 6 | ||||
-rw-r--r-- | src/qt/transactionview.cpp | 12 | ||||
-rw-r--r-- | src/qt/utilitydialog.cpp | 2 | ||||
-rw-r--r-- | src/qt/walletcontroller.cpp | 4 | ||||
-rw-r--r-- | src/qt/walletmodel.cpp | 2 | ||||
-rw-r--r-- | src/qt/walletview.cpp | 4 |
24 files changed, 113 insertions, 86 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index a30cac3504..686772e6bb 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -633,7 +633,7 @@ int GuiMain(int argc, char* argv[]) if (app.baseInitialize()) { app.requestInitialize(); #if defined(Q_OS_WIN) - WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("%1 didn't yet exit safely...").arg(PACKAGE_NAME), (HWND)app.getMainWinId()); + WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("%1 didn't yet exit safely…").arg(PACKAGE_NAME), (HWND)app.getMainWinId()); #endif app.exec(); app.requestShutdown(); diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index 2af3502be3..ba59bcc660 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -239,7 +239,7 @@ BitcoinAmountField::BitcoinAmountField(QWidget *parent) : // If one if the widgets changes, the combined content changes as well connect(amount, &AmountSpinBox::valueChanged, this, &BitcoinAmountField::valueChanged); - connect(unit, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &BitcoinAmountField::unitChanged); + connect(unit, qOverload<int>(&QComboBox::currentIndexChanged), this, &BitcoinAmountField::unitChanged); // Set default based on configuration unitChanged(unit->currentIndex()); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 3e29d8e132..17fffe2087 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -308,27 +308,27 @@ void BitcoinGUI::createActions() aboutQtAction = new QAction(tr("About &Qt"), this); aboutQtAction->setStatusTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); - optionsAction = new QAction(tr("&Options..."), this); + optionsAction = new QAction(tr("&Options…"), this); optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(PACKAGE_NAME)); optionsAction->setMenuRole(QAction::PreferencesRole); optionsAction->setEnabled(false); toggleHideAction = new QAction(tr("&Show / Hide"), this); toggleHideAction->setStatusTip(tr("Show or hide the main Window")); - encryptWalletAction = new QAction(tr("&Encrypt Wallet..."), this); + encryptWalletAction = new QAction(tr("&Encrypt Wallet…"), this); encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet")); encryptWalletAction->setCheckable(true); - backupWalletAction = new QAction(tr("&Backup Wallet..."), this); + backupWalletAction = new QAction(tr("&Backup Wallet…"), this); backupWalletAction->setStatusTip(tr("Backup wallet to another location")); - changePassphraseAction = new QAction(tr("&Change Passphrase..."), this); + changePassphraseAction = new QAction(tr("&Change Passphrase…"), this); changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption")); - signMessageAction = new QAction(tr("Sign &message..."), this); + signMessageAction = new QAction(tr("Sign &message…"), this); signMessageAction->setStatusTip(tr("Sign messages with your Bitcoin addresses to prove you own them")); - verifyMessageAction = new QAction(tr("&Verify message..."), this); + verifyMessageAction = new QAction(tr("&Verify message…"), this); verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Bitcoin addresses")); - m_load_psbt_action = new QAction(tr("&Load PSBT from file..."), this); + m_load_psbt_action = new QAction(tr("&Load PSBT from file…"), this); m_load_psbt_action->setStatusTip(tr("Load Partially Signed Bitcoin Transaction")); - m_load_psbt_clipboard_action = new QAction(tr("Load PSBT from clipboard..."), this); + m_load_psbt_clipboard_action = new QAction(tr("Load PSBT from clipboard…"), this); m_load_psbt_clipboard_action->setStatusTip(tr("Load Partially Signed Bitcoin Transaction from clipboard")); openRPCConsoleAction = new QAction(tr("Node window"), this); @@ -342,7 +342,7 @@ void BitcoinGUI::createActions() usedReceivingAddressesAction = new QAction(tr("&Receiving addresses"), this); usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels")); - openAction = new QAction(tr("Open &URI..."), this); + openAction = new QAction(tr("Open &URI…"), this); openAction->setStatusTip(tr("Open a bitcoin: URI")); m_open_wallet_action = new QAction(tr("Open Wallet"), this); @@ -350,14 +350,14 @@ void BitcoinGUI::createActions() m_open_wallet_action->setStatusTip(tr("Open a wallet")); m_open_wallet_menu = new QMenu(this); - m_close_wallet_action = new QAction(tr("Close Wallet..."), this); + m_close_wallet_action = new QAction(tr("Close Wallet…"), this); m_close_wallet_action->setStatusTip(tr("Close wallet")); - m_create_wallet_action = new QAction(tr("Create Wallet..."), this); + m_create_wallet_action = new QAction(tr("Create Wallet…"), this); m_create_wallet_action->setEnabled(false); m_create_wallet_action->setStatusTip(tr("Create a new wallet")); - m_close_all_wallets_action = new QAction(tr("Close All Wallets..."), this); + m_close_all_wallets_action = new QAction(tr("Close All Wallets…"), this); m_close_all_wallets_action->setStatusTip(tr("Close all wallets")); showHelpMessageAction = new QAction(tr("&Command-line options"), this); @@ -561,7 +561,7 @@ void BitcoinGUI::createToolBars() m_wallet_selector = new QComboBox(); m_wallet_selector->setSizeAdjustPolicy(QComboBox::AdjustToContents); - connect(m_wallet_selector, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &BitcoinGUI::setCurrentWalletBySelectorIndex); + connect(m_wallet_selector, qOverload<int>(&QComboBox::currentIndexChanged), this, &BitcoinGUI::setCurrentWalletBySelectorIndex); m_wallet_selector_label = new QLabel(); m_wallet_selector_label->setText(tr("Wallet:") + " "); @@ -944,7 +944,7 @@ void BitcoinGUI::updateHeadersSyncProgressLabel() int headersTipHeight = clientModel->getHeaderTipHeight(); int estHeadersLeft = (GetTime() - headersTipTime) / Params().GetConsensus().nPowTargetSpacing; if (estHeadersLeft > HEADER_HEIGHT_DELTA_SYNC) - progressBarLabel->setText(tr("Syncing Headers (%1%)...").arg(QString::number(100.0 / (headersTipHeight+estHeadersLeft)*headersTipHeight, 'f', 1))); + progressBarLabel->setText(tr("Syncing Headers (%1%)…").arg(QString::number(100.0 / (headersTipHeight+estHeadersLeft)*headersTipHeight, 'f', 1))); } void BitcoinGUI::openOptionsDialogWithTab(OptionsDialog::Tab tab) @@ -990,24 +990,24 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer updateHeadersSyncProgressLabel(); return; } - progressBarLabel->setText(tr("Synchronizing with network...")); + progressBarLabel->setText(tr("Synchronizing with network…")); updateHeadersSyncProgressLabel(); break; case BlockSource::DISK: if (header) { - progressBarLabel->setText(tr("Indexing blocks on disk...")); + progressBarLabel->setText(tr("Indexing blocks on disk…")); } else { - progressBarLabel->setText(tr("Processing blocks on disk...")); + progressBarLabel->setText(tr("Processing blocks on disk…")); } break; case BlockSource::REINDEX: - progressBarLabel->setText(tr("Reindexing blocks on disk...")); + progressBarLabel->setText(tr("Reindexing blocks on disk…")); break; case BlockSource::NONE: if (header) { return; } - progressBarLabel->setText(tr("Connecting to peers...")); + progressBarLabel->setText(tr("Connecting to peers…")); break; } @@ -1044,7 +1044,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer progressBar->setValue(nVerificationProgress * 1000000000.0 + 0.5); progressBar->setVisible(true); - tooltip = tr("Catching up...") + QString("<br>") + tooltip; + tooltip = tr("Catching up…") + QString("<br>") + tooltip; if(count != prevBlocks) { labelBlocksIcon->setPixmap(platformStyle->SingleColorIcon(QString( diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index 13687a6510..7a25ba907e 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -923,6 +923,9 @@ <property name="tabKeyNavigation"> <bool>false</bool> </property> + <property name="alternatingRowColors"> + <bool>true</bool> + </property> <property name="textElideMode"> <enum>Qt::ElideMiddle</enum> </property> @@ -984,6 +987,9 @@ <property name="tabKeyNavigation"> <bool>false</bool> </property> + <property name="alternatingRowColors"> + <bool>true</bool> + </property> <property name="sortingEnabled"> <bool>true</bool> </property> @@ -1198,6 +1204,9 @@ <property name="textFormat"> <enum>Qt::PlainText</enum> </property> + <property name="wordWrap"> + <bool>true</bool> + </property> <property name="textInteractionFlags"> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> </property> diff --git a/src/qt/forms/modaloverlay.ui b/src/qt/forms/modaloverlay.ui index 83b6a59aa0..dbdeadfc00 100644 --- a/src/qt/forms/modaloverlay.ui +++ b/src/qt/forms/modaloverlay.ui @@ -219,7 +219,7 @@ QLabel { color: rgb(40,40,40); }</string> <item row="0" column="1"> <widget class="QLabel" name="numberOfBlocksLeft"> <property name="text"> - <string>Unknown...</string> + <string>Unknown…</string> </property> </widget> </item> @@ -245,7 +245,7 @@ QLabel { color: rgb(40,40,40); }</string> </sizepolicy> </property> <property name="text"> - <string>Unknown...</string> + <string>Unknown…</string> </property> </widget> </item> @@ -289,7 +289,7 @@ QLabel { color: rgb(40,40,40); }</string> <item row="4" column="1"> <widget class="QLabel" name="progressIncreasePerH"> <property name="text"> - <string>calculating...</string> + <string>calculating…</string> </property> </widget> </item> @@ -309,7 +309,7 @@ QLabel { color: rgb(40,40,40); }</string> <item row="5" column="1"> <widget class="QLabel" name="expectedTimeLeft"> <property name="text"> - <string>calculating...</string> + <string>calculating…</string> </property> </widget> </item> diff --git a/src/qt/forms/psbtoperationsdialog.ui b/src/qt/forms/psbtoperationsdialog.ui index c2e2f5035b..caae0dab2a 100644 --- a/src/qt/forms/psbtoperationsdialog.ui +++ b/src/qt/forms/psbtoperationsdialog.ui @@ -126,7 +126,7 @@ <item> <widget class="QPushButton" name="saveButton"> <property name="text"> - <string>Save...</string> + <string>Save…</string> </property> </widget> </item> diff --git a/src/qt/forms/receiverequestdialog.ui b/src/qt/forms/receiverequestdialog.ui index f6d4723465..7d95a8bc90 100644 --- a/src/qt/forms/receiverequestdialog.ui +++ b/src/qt/forms/receiverequestdialog.ui @@ -11,7 +11,7 @@ </rect> </property> <property name="windowTitle"> - <string>Request payment to ...</string> + <string>Request payment to …</string> </property> <layout class="QGridLayout" name="gridLayout" columnstretch="0,1"> <property name="sizeConstraint"> @@ -65,7 +65,7 @@ <item row="2" column="1" alignment="Qt::AlignTop"> <widget class="QLabel" name="uri_content"> <property name="text"> - <string notr="true">bitcoin:BC1...</string> + <string notr="true">bitcoin:BC1…</string> </property> <property name="textFormat"> <enum>Qt::RichText</enum> @@ -97,7 +97,7 @@ <item row="3" column="1" alignment="Qt::AlignTop"> <widget class="QLabel" name="address_content"> <property name="text"> - <string notr="true">bc1...</string> + <string notr="true">bc1…</string> </property> <property name="textFormat"> <enum>Qt::PlainText</enum> @@ -257,7 +257,7 @@ <item> <widget class="QPushButton" name="btnSaveAs"> <property name="text"> - <string>&Save Image...</string> + <string>&Save Image…</string> </property> <property name="autoDefault"> <bool>false</bool> diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index aeb5b61926..37da6fedda 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -107,7 +107,7 @@ <string notr="true"/> </property> <property name="text"> - <string>Inputs...</string> + <string>Inputs…</string> </property> <property name="autoDefault"> <bool>false</bool> @@ -738,7 +738,7 @@ <item> <widget class="QPushButton" name="buttonChooseFee"> <property name="text"> - <string>Choose...</string> + <string>Choose…</string> </property> </widget> </item> @@ -991,7 +991,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee rate of "100 satos <item> <widget class="QLabel" name="labelSmartFee2"> <property name="text"> - <string>(Smart fee not initialized yet. This usually takes a few blocks...)</string> + <string>(Smart fee not initialized yet. This usually takes a few blocks…)</string> </property> </widget> </item> diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index d10bf9f9ae..998d38e10d 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -708,7 +708,7 @@ QString formatServicesStr(quint64 mask) } if (strList.size()) - return strList.join(" & "); + return strList.join(", "); else return QObject::tr("None"); } diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index ed39307fd7..15b14c35ec 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -155,7 +155,7 @@ Intro::Intro(QWidget *parent, int64_t blockchain_size_gb, int64_t chain_state_si UpdatePruneLabels(prune_checked); UpdateFreeSpaceLabel(); }); - connect(ui->pruneGB, QOverload<int>::of(&QSpinBox::valueChanged), [this](int prune_GB) { + connect(ui->pruneGB, qOverload<int>(&QSpinBox::valueChanged), [this](int prune_GB) { m_prune_target_gb = prune_GB; UpdatePruneLabels(ui->prune->isChecked()); UpdateFreeSpaceLabel(); @@ -298,12 +298,12 @@ void Intro::setStatus(int status, const QString &message, quint64 bytesAvailable void Intro::UpdateFreeSpaceLabel() { - QString freeString = tr("%n GB of free space available", "", m_bytes_available / GB_BYTES); + QString freeString = tr("%1 GB of free space available").arg(m_bytes_available / GB_BYTES); if (m_bytes_available < m_required_space_gb * GB_BYTES) { - freeString += " " + tr("(of %n GB needed)", "", m_required_space_gb); + freeString += " " + tr("(of %1 GB needed)").arg(m_required_space_gb); ui->freeSpace->setStyleSheet("QLabel { color: #800000 }"); } else if (m_bytes_available / GB_BYTES - m_required_space_gb < 10) { - freeString += " " + tr("(%n GB needed for full chain)", "", m_required_space_gb); + freeString += " " + tr("(%1 GB needed for full chain)").arg(m_required_space_gb); ui->freeSpace->setStyleSheet("QLabel { color: #999900 }"); } else { ui->freeSpace->setStyleSheet(""); diff --git a/src/qt/modaloverlay.cpp b/src/qt/modaloverlay.cpp index 6363fe2edf..ae27cad477 100644 --- a/src/qt/modaloverlay.cpp +++ b/src/qt/modaloverlay.cpp @@ -149,13 +149,13 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri ui->numberOfBlocksLeft->setText(QString::number(bestHeaderHeight - count)); } else { UpdateHeaderSyncLabel(); - ui->expectedTimeLeft->setText(tr("Unknown...")); + ui->expectedTimeLeft->setText(tr("Unknown…")); } } void ModalOverlay::UpdateHeaderSyncLabel() { int est_headers_left = bestHeaderDate.secsTo(QDateTime::currentDateTime()) / Params().GetConsensus().nPowTargetSpacing; - ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1, %2%)...").arg(bestHeaderHeight).arg(QString::number(100.0 / (bestHeaderHeight + est_headers_left) * bestHeaderHeight, 'f', 1))); + ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1, %2%)…").arg(bestHeaderHeight).arg(QString::number(100.0 / (bestHeaderHeight + est_headers_left) * bestHeaderHeight, 'f', 1))); } void ModalOverlay::toggleVisibility() diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index e6b9488344..8a32994e3f 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -197,9 +197,9 @@ void OptionsDialog::setModel(OptionsModel *_model) /* Main */ connect(ui->prune, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning); connect(ui->prune, &QCheckBox::clicked, this, &OptionsDialog::togglePruneWarning); - connect(ui->pruneSize, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning); - connect(ui->databaseCache, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning); - connect(ui->threadsScriptVerif, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning); + connect(ui->pruneSize, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning); + connect(ui->databaseCache, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning); + connect(ui->threadsScriptVerif, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning); /* Wallet */ connect(ui->spendZeroConfChange, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning); /* Network */ @@ -207,7 +207,7 @@ void OptionsDialog::setModel(OptionsModel *_model) connect(ui->connectSocks, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning); connect(ui->connectSocksTor, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning); /* Display */ - connect(ui->lang, static_cast<void (QValueComboBox::*)()>(&QValueComboBox::valueChanged), [this]{ showRestartWarning(); }); + connect(ui->lang, qOverload<>(&QValueComboBox::valueChanged), [this]{ showRestartWarning(); }); connect(ui->thirdPartyTxUrls, &QLineEdit::textChanged, [this]{ showRestartWarning(); }); } diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 58f6c14e7a..d58d13f722 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -232,7 +232,10 @@ void PaymentServer::handleURIOrFile(const QString& s) SendCoinsRecipient recipient; if (GUIUtil::parseBitcoinURI(s, &recipient)) { - if (!IsValidDestinationString(recipient.address.toStdString())) { + std::string error_msg; + const CTxDestination dest = DecodeDestination(recipient.address.toStdString(), error_msg); + + if (!IsValidDestination(dest)) { if (uri.hasQueryItem("r")) { // payment request Q_EMIT message(tr("URI handling"), tr("Cannot process payment request because BIP70 is not supported.\n" @@ -240,7 +243,7 @@ void PaymentServer::handleURIOrFile(const QString& s) "If you are receiving this error you should request the merchant provide a BIP21 compatible URI."), CClientUIInterface::ICON_WARNING); } - Q_EMIT message(tr("URI handling"), tr("Invalid payment address %1").arg(recipient.address), + Q_EMIT message(tr("URI handling"), QString::fromStdString(error_msg), CClientUIInterface::MSG_ERROR); } else diff --git a/src/qt/qrimagewidget.cpp b/src/qt/qrimagewidget.cpp index df6757ffd6..3e1964915d 100644 --- a/src/qt/qrimagewidget.cpp +++ b/src/qt/qrimagewidget.cpp @@ -27,7 +27,7 @@ QRImageWidget::QRImageWidget(QWidget *parent): QLabel(parent), contextMenu(nullptr) { contextMenu = new QMenu(this); - contextMenu->addAction(tr("Save Image..."), this, &QRImageWidget::saveImage); + contextMenu->addAction(tr("Save Image…"), this, &QRImageWidget::saveImage); contextMenu->addAction(tr("Copy Image"), this, &QRImageWidget::copyImage); } diff --git a/src/qt/qvaluecombobox.cpp b/src/qt/qvaluecombobox.cpp index 76f94ecf85..5672396819 100644 --- a/src/qt/qvaluecombobox.cpp +++ b/src/qt/qvaluecombobox.cpp @@ -7,7 +7,7 @@ QValueComboBox::QValueComboBox(QWidget *parent) : QComboBox(parent), role(Qt::UserRole) { - connect(this, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &QValueComboBox::handleSelectionChanged); + connect(this, qOverload<int>(&QComboBox::currentIndexChanged), this, &QValueComboBox::handleSelectionChanged); } QVariant QValueComboBox::value() const diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 006f60e7a1..731d6a4eef 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -454,13 +454,21 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty { ui->setupUi(this); QSettings settings; - if (!restoreGeometry(settings.value("RPCConsoleWindowGeometry").toByteArray())) { - // Restore failed (perhaps missing setting), center the window - move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center()); +#ifdef ENABLE_WALLET + if (WalletModel::isWalletEnabled()) { + // RPCConsole widget is a window. + if (!restoreGeometry(settings.value("RPCConsoleWindowGeometry").toByteArray())) { + // Restore failed (perhaps missing setting), center the window + move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center()); + } + ui->splitter->restoreState(settings.value("RPCConsoleWindowPeersTabSplitterSizes").toByteArray()); + } else +#endif // ENABLE_WALLET + { + // RPCConsole is a child widget. + ui->splitter->restoreState(settings.value("RPCConsoleWidgetPeersTabSplitterSizes").toByteArray()); } - ui->splitter->restoreState(settings.value("PeersTabSplitterSizes").toByteArray()); - constexpr QChar nonbreaking_hyphen(8209); const std::vector<QString> CONNECTION_TYPE_DOC{ tr("Inbound: initiated by peer"), @@ -495,7 +503,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty ui->lineEdit->setMaxLength(16 * 1024 * 1024); ui->messagesWidget->installEventFilter(this); - connect(ui->clearButton, &QPushButton::clicked, this, &RPCConsole::clear); + connect(ui->clearButton, &QPushButton::clicked, [this] { clear(); }); connect(ui->fontBiggerButton, &QPushButton::clicked, this, &RPCConsole::fontBigger); connect(ui->fontSmallerButton, &QPushButton::clicked, this, &RPCConsole::fontSmaller); connect(ui->btnClearTrafficGraph, &QPushButton::clicked, ui->trafficGraph, &TrafficGraphWidget::clear); @@ -522,8 +530,18 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty RPCConsole::~RPCConsole() { QSettings settings; - settings.setValue("RPCConsoleWindowGeometry", saveGeometry()); - settings.setValue("PeersTabSplitterSizes", ui->splitter->saveState()); +#ifdef ENABLE_WALLET + if (WalletModel::isWalletEnabled()) { + // RPCConsole widget is a window. + settings.setValue("RPCConsoleWindowGeometry", saveGeometry()); + settings.setValue("RPCConsoleWindowPeersTabSplitterSizes", ui->splitter->saveState()); + } else +#endif // ENABLE_WALLET + { + // RPCConsole is a child widget. + settings.setValue("RPCConsoleWidgetPeersTabSplitterSizes", ui->splitter->saveState()); + } + m_node.rpcUnsetTimerInterface(rpcTimerInterface); delete rpcTimerInterface; delete ui; @@ -753,20 +771,15 @@ void RPCConsole::setFontSize(int newSize) // clear console (reset icon sizes, default stylesheet) and re-add the content float oldPosFactor = 1.0 / ui->messagesWidget->verticalScrollBar()->maximum() * ui->messagesWidget->verticalScrollBar()->value(); - clear(false); + clear(/* keep_prompt */ true); ui->messagesWidget->setHtml(str); ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor * ui->messagesWidget->verticalScrollBar()->maximum()); } -void RPCConsole::clear(bool clearHistory) +void RPCConsole::clear(bool keep_prompt) { ui->messagesWidget->clear(); - if(clearHistory) - { - history.clear(); - historyPtr = 0; - } - ui->lineEdit->clear(); + if (!keep_prompt) ui->lineEdit->clear(); ui->lineEdit->setFocus(); // Add smoothly scaled icon images. @@ -959,7 +972,7 @@ void RPCConsole::startExecutor() executor->moveToThread(&thread); // Replies from executor object must go to this object - connect(executor, &RPCExecutor::reply, this, static_cast<void (RPCConsole::*)(int, const QString&)>(&RPCConsole::message)); + connect(executor, &RPCExecutor::reply, this, qOverload<int, const QString&>(&RPCConsole::message)); // Requests from this object must go to executor connect(this, &RPCConsole::cmdRequest, executor, &RPCExecutor::request); diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 5182d60a0d..14d8900716 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -99,7 +99,7 @@ private Q_SLOTS: void updateDetailWidget(); public Q_SLOTS: - void clear(bool clearHistory = true); + void clear(bool keep_prompt = false); void fontBigger(); void fontSmaller(); void setFontSize(int newSize); diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 9b1df54ad5..e3ea6e9015 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -173,15 +173,15 @@ void SendCoinsDialog::setModel(WalletModel *_model) for (const int n : confTargets) { ui->confTargetSelector->addItem(tr("%1 (%2 blocks)").arg(GUIUtil::formatNiceTimeOffset(n*Params().GetConsensus().nPowTargetSpacing)).arg(n)); } - connect(ui->confTargetSelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &SendCoinsDialog::updateSmartFeeLabel); - connect(ui->confTargetSelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &SendCoinsDialog::coinControlUpdateLabels); + connect(ui->confTargetSelector, qOverload<int>(&QComboBox::currentIndexChanged), this, &SendCoinsDialog::updateSmartFeeLabel); + connect(ui->confTargetSelector, qOverload<int>(&QComboBox::currentIndexChanged), this, &SendCoinsDialog::coinControlUpdateLabels); #if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) connect(ui->groupFee, &QButtonGroup::idClicked, this, &SendCoinsDialog::updateFeeSectionControls); connect(ui->groupFee, &QButtonGroup::idClicked, this, &SendCoinsDialog::coinControlUpdateLabels); #else - connect(ui->groupFee, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &SendCoinsDialog::updateFeeSectionControls); - connect(ui->groupFee, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &SendCoinsDialog::coinControlUpdateLabels); + connect(ui->groupFee, qOverload<int>(&QButtonGroup::buttonClicked), this, &SendCoinsDialog::updateFeeSectionControls); + connect(ui->groupFee, qOverload<int>(&QButtonGroup::buttonClicked), this, &SendCoinsDialog::coinControlUpdateLabels); #endif connect(ui->customFee, &BitcoinAmountField::valueChanged, this, &SendCoinsDialog::coinControlUpdateLabels); @@ -368,7 +368,7 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa if (formatted.size() > 1) { question_string = question_string.arg(""); - informative_text = tr("To review recipient list click \"Show Details...\""); + informative_text = tr("To review recipient list click \"Show Details…\""); detailed_text = formatted.join("\n\n"); } else { question_string = question_string.arg("<br /><br />" + formatted.at(0)); diff --git a/src/qt/test/rpcnestedtests.cpp b/src/qt/test/rpcnestedtests.cpp index 9e6e98b274..df3b85ea71 100644 --- a/src/qt/test/rpcnestedtests.cpp +++ b/src/qt/test/rpcnestedtests.cpp @@ -35,14 +35,16 @@ static RPCHelpMan rpcNestedTest_rpc() } static const CRPCCommand vRPCCommands[] = { - {"test", &rpcNestedTest_rpc}, + {"rpcNestedTest", &rpcNestedTest_rpc}, }; void RPCNestedTests::rpcNestedTests() { // do some test setup // could be moved to a more generic place when we add more tests on QT level - tableRPC.appendCommand("rpcNestedTest", &vRPCCommands[0]); + for (const auto& c : vRPCCommands) { + tableRPC.appendCommand(c.name, &c); + } TestingSetup test; m_node.setContext(&test.m_node); diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 890d1a1740..7a975dadae 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -73,7 +73,7 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa dateWidget->addItem(tr("This month"), ThisMonth); dateWidget->addItem(tr("Last month"), LastMonth); dateWidget->addItem(tr("This year"), ThisYear); - dateWidget->addItem(tr("Range..."), Range); + dateWidget->addItem(tr("Range…"), Range); hlayout->addWidget(dateWidget); typeWidget = new QComboBox(this); @@ -177,12 +177,12 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa abandonAction = contextMenu->addAction(tr("Abandon transaction"), this, &TransactionView::abandonTx); contextMenu->addAction(tr("Edit address label"), this, &TransactionView::editLabel); - connect(dateWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseDate); - connect(typeWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseType); - connect(watchOnlyWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseWatchonly); - connect(amountWidget, &QLineEdit::textChanged, amount_typing_delay, static_cast<void (QTimer::*)()>(&QTimer::start)); + connect(dateWidget, qOverload<int>(&QComboBox::activated), this, &TransactionView::chooseDate); + connect(typeWidget, qOverload<int>(&QComboBox::activated), this, &TransactionView::chooseType); + connect(watchOnlyWidget, qOverload<int>(&QComboBox::activated), this, &TransactionView::chooseWatchonly); + connect(amountWidget, &QLineEdit::textChanged, amount_typing_delay, qOverload<>(&QTimer::start)); connect(amount_typing_delay, &QTimer::timeout, this, &TransactionView::changedAmount); - connect(search_widget, &QLineEdit::textChanged, prefix_typing_delay, static_cast<void (QTimer::*)()>(&QTimer::start)); + connect(search_widget, &QLineEdit::textChanged, prefix_typing_delay, qOverload<>(&QTimer::start)); connect(prefix_typing_delay, &QTimer::timeout, this, &TransactionView::changedSearch); connect(transactionView, &QTableView::doubleClicked, this, &TransactionView::doubleClicked); diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 05499b2a41..4d246bc8dc 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -142,7 +142,7 @@ ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f): { QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(new QLabel( - tr("%1 is shutting down...").arg(PACKAGE_NAME) + "<br /><br />" + + tr("%1 is shutting down…").arg(PACKAGE_NAME) + "<br /><br />" + tr("Do not shut down the computer until this window disappears."))); setLayout(layout); diff --git a/src/qt/walletcontroller.cpp b/src/qt/walletcontroller.cpp index 7a89325ddf..c152689f0b 100644 --- a/src/qt/walletcontroller.cpp +++ b/src/qt/walletcontroller.cpp @@ -247,7 +247,7 @@ void CreateWalletActivity::askPassphrase() void CreateWalletActivity::createWallet() { - showProgressDialog(tr("Creating Wallet <b>%1</b>...").arg(m_create_wallet_dialog->walletName().toHtmlEscaped())); + showProgressDialog(tr("Creating Wallet <b>%1</b>…").arg(m_create_wallet_dialog->walletName().toHtmlEscaped())); std::string name = m_create_wallet_dialog->walletName().toStdString(); uint64_t flags = 0; @@ -330,7 +330,7 @@ void OpenWalletActivity::open(const std::string& path) { QString name = path.empty() ? QString("["+tr("default wallet")+"]") : QString::fromStdString(path); - showProgressDialog(tr("Opening Wallet <b>%1</b>...").arg(name.toHtmlEscaped())); + showProgressDialog(tr("Opening Wallet <b>%1</b>…").arg(name.toHtmlEscaped())); QTimer::singleShot(0, worker(), [this, path] { std::unique_ptr<interfaces::Wallet> wallet = node().walletClient().loadWallet(path, m_error_message, m_warning_message); diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index c6dd0c2ad6..cc6db8d33e 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -248,7 +248,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); ssTx << *newTx; - transaction_array.append((const char*)&(ssTx[0]), ssTx.size()); + transaction_array.append((const char*)ssTx.data(), ssTx.size()); } // Add addresses / update labels that we've sent to the address book, diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 8612893683..67cc42725b 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -71,13 +71,13 @@ WalletView::WalletView(const PlatformStyle *_platformStyle, QWidget *parent): connect(overviewPage, &OverviewPage::transactionClicked, this, &WalletView::transactionClicked); // Clicking on a transaction on the overview pre-selects the transaction on the transaction history page - connect(overviewPage, &OverviewPage::transactionClicked, transactionView, static_cast<void (TransactionView::*)(const QModelIndex&)>(&TransactionView::focusTransaction)); + connect(overviewPage, &OverviewPage::transactionClicked, transactionView, qOverload<const QModelIndex&>(&TransactionView::focusTransaction)); connect(overviewPage, &OverviewPage::outOfSyncWarningClicked, this, &WalletView::requestedSyncWarningInfo); connect(sendCoinsPage, &SendCoinsDialog::coinsSent, this, &WalletView::coinsSent); // Highlight transaction after send - connect(sendCoinsPage, &SendCoinsDialog::coinsSent, transactionView, static_cast<void (TransactionView::*)(const uint256&)>(&TransactionView::focusTransaction)); + connect(sendCoinsPage, &SendCoinsDialog::coinsSent, transactionView, qOverload<const uint256&>(&TransactionView::focusTransaction)); // Clicking on "Export" allows to export the transaction list connect(exportButton, &QPushButton::clicked, transactionView, &TransactionView::exportClicked); |