diff options
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/addresstablemodel.cpp | 16 | ||||
-rw-r--r-- | src/qt/bitcoin.cpp | 15 | ||||
-rw-r--r-- | src/qt/bitcoingui.cpp | 26 | ||||
-rw-r--r-- | src/qt/bitcoinstrings.cpp | 17 | ||||
-rw-r--r-- | src/qt/clientmodel.cpp | 18 | ||||
-rw-r--r-- | src/qt/coincontroldialog.cpp | 6 | ||||
-rw-r--r-- | src/qt/intro.cpp | 12 | ||||
-rw-r--r-- | src/qt/locale/bitcoin_en.ts | 455 | ||||
-rw-r--r-- | src/qt/optionsdialog.cpp | 8 | ||||
-rw-r--r-- | src/qt/paymentserver.cpp | 8 | ||||
-rwxr-xr-x | src/qt/res/movies/makespinner.sh | 2 | ||||
-rw-r--r-- | src/qt/rpcconsole.cpp | 4 | ||||
-rw-r--r-- | src/qt/splashscreen.cpp | 5 | ||||
-rw-r--r-- | src/qt/test/apptests.cpp | 5 | ||||
-rw-r--r-- | src/qt/test/paymentservertests.cpp | 4 | ||||
-rw-r--r-- | src/qt/test/rpcnestedtests.cpp | 3 | ||||
-rw-r--r-- | src/qt/test/test_main.cpp | 12 | ||||
-rw-r--r-- | src/qt/test/wallettests.cpp | 3 | ||||
-rw-r--r-- | src/qt/trafficgraphwidget.cpp | 1 | ||||
-rw-r--r-- | src/qt/transactiontablemodel.cpp | 15 | ||||
-rw-r--r-- | src/qt/utilitydialog.cpp | 6 | ||||
-rw-r--r-- | src/qt/walletcontroller.cpp | 16 | ||||
-rw-r--r-- | src/qt/walletcontroller.h | 10 | ||||
-rw-r--r-- | src/qt/walletmodel.cpp | 21 |
24 files changed, 388 insertions, 300 deletions
diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp index fa6c9c9f7a..29423db3d0 100644 --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -358,12 +358,15 @@ QString AddressTableModel::addRow(const QString &type, const QString &label, con return QString(); } } + + // Add entry + walletModel->wallet().setAddressBook(DecodeDestination(strAddress), strLabel, "send"); } else if(type == Receive) { // Generate a new address to associate with given label - CPubKey newKey; - if(!walletModel->wallet().getKeyFromPool(false /* internal */, newKey)) + CTxDestination dest; + if(!walletModel->wallet().getNewDestination(address_type, strLabel, dest)) { WalletModel::UnlockContext ctx(walletModel->requestUnlock()); if(!ctx.isValid()) @@ -372,23 +375,18 @@ QString AddressTableModel::addRow(const QString &type, const QString &label, con editStatus = WALLET_UNLOCK_FAILURE; return QString(); } - if(!walletModel->wallet().getKeyFromPool(false /* internal */, newKey)) + if(!walletModel->wallet().getNewDestination(address_type, strLabel, dest)) { editStatus = KEY_GENERATION_FAILURE; return QString(); } } - walletModel->wallet().learnRelatedScripts(newKey, address_type); - strAddress = EncodeDestination(GetDestinationForKey(newKey, address_type)); + strAddress = EncodeDestination(dest); } else { return QString(); } - - // Add entry - walletModel->wallet().setAddressBook(DecodeDestination(strAddress), strLabel, - (type == Send ? "send" : "receive")); return QString::fromStdString(strAddress); } diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 2fdbcca043..4a9742f7b7 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -413,7 +413,6 @@ static void SetupUIArgs() gArgs.AddArg("-uiplatform", strprintf("Select platform to customize UI for (one of windows, macosx, other; default: %s)", BitcoinGUI::DEFAULT_UIPLATFORM), true, OptionsCategory::GUI); } -#ifndef BITCOIN_QT_TEST int GuiMain(int argc, char* argv[]) { #ifdef WIN32 @@ -449,6 +448,9 @@ int GuiMain(int argc, char* argv[]) // Register meta types used for QMetaObject::invokeMethod qRegisterMetaType< bool* >(); +#ifdef ENABLE_WALLET + qRegisterMetaType<WalletModel*>(); +#endif // Need to pass name here as CAmount is a typedef (see http://qt-project.org/doc/qt-5/qmetatype.html#qRegisterMetaType) // IMPORTANT if it is no longer a typedef use the normal variant above qRegisterMetaType< CAmount >("CAmount"); @@ -460,7 +462,7 @@ int GuiMain(int argc, char* argv[]) SetupUIArgs(); std::string error; if (!node->parseParameters(argc, argv, error)) { - QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME), + QMessageBox::critical(nullptr, PACKAGE_NAME, QObject::tr("Error parsing command line arguments: %1.").arg(QString::fromStdString(error))); return EXIT_FAILURE; } @@ -497,12 +499,12 @@ int GuiMain(int argc, char* argv[]) /// - Do not call GetDataDir(true) before this step finishes if (!fs::is_directory(GetDataDir(false))) { - QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME), + QMessageBox::critical(nullptr, PACKAGE_NAME, QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(gArgs.GetArg("-datadir", "")))); return EXIT_FAILURE; } if (!node->readConfigFiles(error)) { - QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME), + QMessageBox::critical(nullptr, PACKAGE_NAME, QObject::tr("Error: Cannot parse configuration file: %1.").arg(QString::fromStdString(error))); return EXIT_FAILURE; } @@ -517,7 +519,7 @@ int GuiMain(int argc, char* argv[]) try { node->selectParams(gArgs.GetChainName()); } catch(std::exception &e) { - QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME), QObject::tr("Error: %1").arg(e.what())); + QMessageBox::critical(nullptr, PACKAGE_NAME, QObject::tr("Error: %1").arg(e.what())); return EXIT_FAILURE; } #ifdef ENABLE_WALLET @@ -574,7 +576,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(QObject::tr(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(); @@ -593,4 +595,3 @@ int GuiMain(int argc, char* argv[]) } return rv; } -#endif // BITCOIN_QT_TEST diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index babb2ce518..c9a09573f9 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -294,15 +294,15 @@ void BitcoinGUI::createActions() quitAction->setStatusTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); - aboutAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&About %1").arg(tr(PACKAGE_NAME)), this); - aboutAction->setStatusTip(tr("Show information about %1").arg(tr(PACKAGE_NAME))); + aboutAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&About %1").arg(PACKAGE_NAME), this); + aboutAction->setStatusTip(tr("Show information about %1").arg(PACKAGE_NAME)); aboutAction->setMenuRole(QAction::AboutRole); aboutAction->setEnabled(false); aboutQtAction = new QAction(platformStyle->TextColorIcon(":/icons/about_qt"), tr("About &Qt"), this); aboutQtAction->setStatusTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(platformStyle->TextColorIcon(":/icons/options"), tr("&Options..."), this); - optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(tr(PACKAGE_NAME))); + optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(PACKAGE_NAME)); optionsAction->setMenuRole(QAction::PreferencesRole); optionsAction->setEnabled(false); toggleHideAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&Show / Hide"), this); @@ -344,7 +344,7 @@ void BitcoinGUI::createActions() showHelpMessageAction = new QAction(platformStyle->TextColorIcon(":/icons/info"), tr("&Command-line options"), this); showHelpMessageAction->setMenuRole(QAction::NoRole); - showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Bitcoin command-line options").arg(tr(PACKAGE_NAME))); + showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Bitcoin command-line options").arg(PACKAGE_NAME)); connect(quitAction, &QAction::triggered, qApp, QApplication::quit); connect(aboutAction, &QAction::triggered, this, &BitcoinGUI::aboutClicked); @@ -371,13 +371,12 @@ void BitcoinGUI::createActions() connect(openAction, &QAction::triggered, this, &BitcoinGUI::openClicked); connect(m_open_wallet_menu, &QMenu::aboutToShow, [this] { m_open_wallet_menu->clear(); - std::vector<std::string> available_wallets = m_wallet_controller->getWalletsAvailableToOpen(); - std::vector<std::string> wallets = m_node.listWalletDir(); - for (const auto& path : wallets) { + for (const std::pair<const std::string, bool>& i : m_wallet_controller->listWalletDir()) { + const std::string& path = i.first; QString name = path.empty() ? QString("["+tr("default wallet")+"]") : QString::fromStdString(path); QAction* action = m_open_wallet_menu->addAction(name); - if (std::find(available_wallets.begin(), available_wallets.end(), path) == available_wallets.end()) { + if (i.second) { // This wallet is already loaded action->setEnabled(false); continue; @@ -410,7 +409,7 @@ void BitcoinGUI::createActions() assert(invoked); }); } - if (wallets.empty()) { + if (m_open_wallet_menu->isEmpty()) { QAction* action = m_open_wallet_menu->addAction(tr("No wallets available")); action->setEnabled(false); } @@ -640,7 +639,7 @@ void BitcoinGUI::setWalletController(WalletController* wallet_controller) connect(wallet_controller, &WalletController::walletAdded, this, &BitcoinGUI::addWallet); connect(wallet_controller, &WalletController::walletRemoved, this, &BitcoinGUI::removeWallet); - for (WalletModel* wallet_model : m_wallet_controller->getWallets()) { + for (WalletModel* wallet_model : m_wallet_controller->getOpenWallets()) { addWallet(wallet_model); } } @@ -729,7 +728,7 @@ void BitcoinGUI::createTrayIcon() #ifndef Q_OS_MAC if (QSystemTrayIcon::isSystemTrayAvailable()) { trayIcon = new QSystemTrayIcon(m_network_style->getTrayAndWindowIcon(), this); - QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + m_network_style->getTitleAddText(); + QString toolTip = tr("%1 client").arg(PACKAGE_NAME) + " " + m_network_style->getTitleAddText(); trayIcon->setToolTip(toolTip); } #endif @@ -1292,7 +1291,7 @@ void BitcoinGUI::updateProxyIcon() void BitcoinGUI::updateWindowTitle() { - QString window_title = tr(PACKAGE_NAME); + QString window_title = PACKAGE_NAME; #ifdef ENABLE_WALLET if (walletFrame) { WalletModel* const wallet_model = walletFrame->currentWalletModel(); @@ -1376,12 +1375,13 @@ static bool ThreadSafeMessageBox(BitcoinGUI* gui, const std::string& message, co style &= ~CClientUIInterface::SECURE; bool ret = false; // In case of modal message, use blocking connection to wait for user to click a button - QMetaObject::invokeMethod(gui, "message", + bool invoked = QMetaObject::invokeMethod(gui, "message", modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection, Q_ARG(QString, QString::fromStdString(caption)), Q_ARG(QString, QString::fromStdString(message)), Q_ARG(unsigned int, style), Q_ARG(bool*, &ret)); + assert(invoked); return ret; } diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index dc997e96cc..87736cd185 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -9,14 +9,13 @@ #define UNUSED #endif static const char UNUSED *bitcoin_strings[] = { -QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin Core"), QT_TRANSLATE_NOOP("bitcoin-core", "The %s developers"), QT_TRANSLATE_NOOP("bitcoin-core", "" "-maxtxfee is set very high! Fees this large could be paid on a single " "transaction."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Can't generate a change-address key. Private keys are disabled for this " -"wallet."), +"Can't generate a change-address key. No keys in the internal keypool and " +"can't generate any keys."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Cannot obtain a lock on data directory %s. %s is probably already running."), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -88,9 +87,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: The network does not appear to fully agree! Some miners appear to " "be experiencing issues."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Warning: Unknown block versions being mined! It's possible unknown rules are " -"in effect"), -QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; " "if your balance or transactions are incorrect you should restore from a " "backup."), @@ -124,15 +120,13 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet %s. Duplicate -wallet fi QT_TRANSLATE_NOOP("bitcoin-core", "Error opening block database"), QT_TRANSLATE_NOOP("bitcoin-core", "Error reading from database, shutting down."), QT_TRANSLATE_NOOP("bitcoin-core", "Error upgrading chainstate database"), -QT_TRANSLATE_NOOP("bitcoin-core", "Error"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: A fatal internal error occurred, see debug.log for details"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low for %s"), -QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"), +QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is too low!"), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to listen on any port. Use -listen=0 if you want this."), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to rescan the wallet during initialization"), QT_TRANSLATE_NOOP("bitcoin-core", "Importing..."), QT_TRANSLATE_NOOP("bitcoin-core", "Incorrect or no genesis block found. Wrong datadir for network?"), -QT_TRANSLATE_NOOP("bitcoin-core", "Information"), QT_TRANSLATE_NOOP("bitcoin-core", "Initialization sanity check failed. %s is shutting down."), QT_TRANSLATE_NOOP("bitcoin-core", "Insufficient funds"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -onion address or hostname: '%s'"), @@ -150,6 +144,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Loading wallet..."), QT_TRANSLATE_NOOP("bitcoin-core", "Need to specify a port with -whitebind: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Not enough file descriptors available."), QT_TRANSLATE_NOOP("bitcoin-core", "Prune cannot be configured with a negative value."), +QT_TRANSLATE_NOOP("bitcoin-core", "Prune mode is incompatible with -blockfilterindex."), QT_TRANSLATE_NOOP("bitcoin-core", "Prune mode is incompatible with -txindex."), QT_TRANSLATE_NOOP("bitcoin-core", "Pruning blockstore..."), QT_TRANSLATE_NOOP("bitcoin-core", "Reducing -maxconnections from %d to %d, because of system limitations."), @@ -179,9 +174,11 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Transaction too large for fee policy"), QT_TRANSLATE_NOOP("bitcoin-core", "Transaction too large"), QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer (bind returned error %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer. %s is probably already running."), +QT_TRANSLATE_NOOP("bitcoin-core", "Unable to create the PID file '%s': %s"), QT_TRANSLATE_NOOP("bitcoin-core", "Unable to generate initial keys"), QT_TRANSLATE_NOOP("bitcoin-core", "Unable to generate keys"), QT_TRANSLATE_NOOP("bitcoin-core", "Unable to start HTTP server. See debug log for details."), +QT_TRANSLATE_NOOP("bitcoin-core", "Unknown -blockfilterindex value %s."), QT_TRANSLATE_NOOP("bitcoin-core", "Unknown network specified in -onlynet: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Unsupported logging category %s=%s."), QT_TRANSLATE_NOOP("bitcoin-core", "Upgrading UTXO database"), @@ -189,9 +186,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Upgrading txindex database"), QT_TRANSLATE_NOOP("bitcoin-core", "User Agent comment (%s) contains unsafe characters."), QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks..."), QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet(s)..."), -QT_TRANSLATE_NOOP("bitcoin-core", "Wallet %s resides outside wallet directory %s"), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart %s to complete"), -QT_TRANSLATE_NOOP("bitcoin-core", "Warning"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning: unknown new rules activated (versionbit %i)"), QT_TRANSLATE_NOOP("bitcoin-core", "Zapping all transactions from wallet..."), }; diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index ce950150df..238be08480 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -184,34 +184,39 @@ void ClientModel::updateBanlist() static void ShowProgress(ClientModel *clientmodel, const std::string &title, int nProgress) { // emits signal "showProgress" - QMetaObject::invokeMethod(clientmodel, "showProgress", Qt::QueuedConnection, + bool invoked = QMetaObject::invokeMethod(clientmodel, "showProgress", Qt::QueuedConnection, Q_ARG(QString, QString::fromStdString(title)), Q_ARG(int, nProgress)); + assert(invoked); } static void NotifyNumConnectionsChanged(ClientModel *clientmodel, int newNumConnections) { // Too noisy: qDebug() << "NotifyNumConnectionsChanged: " + QString::number(newNumConnections); - QMetaObject::invokeMethod(clientmodel, "updateNumConnections", Qt::QueuedConnection, + bool invoked = QMetaObject::invokeMethod(clientmodel, "updateNumConnections", Qt::QueuedConnection, Q_ARG(int, newNumConnections)); + assert(invoked); } static void NotifyNetworkActiveChanged(ClientModel *clientmodel, bool networkActive) { - QMetaObject::invokeMethod(clientmodel, "updateNetworkActive", Qt::QueuedConnection, + bool invoked = QMetaObject::invokeMethod(clientmodel, "updateNetworkActive", Qt::QueuedConnection, Q_ARG(bool, networkActive)); + assert(invoked); } static void NotifyAlertChanged(ClientModel *clientmodel) { qDebug() << "NotifyAlertChanged"; - QMetaObject::invokeMethod(clientmodel, "updateAlert", Qt::QueuedConnection); + bool invoked = QMetaObject::invokeMethod(clientmodel, "updateAlert", Qt::QueuedConnection); + assert(invoked); } static void BannedListChanged(ClientModel *clientmodel) { qDebug() << QString("%1: Requesting update for peer banlist").arg(__func__); - QMetaObject::invokeMethod(clientmodel, "updateBanlist", Qt::QueuedConnection); + bool invoked = QMetaObject::invokeMethod(clientmodel, "updateBanlist", Qt::QueuedConnection); + assert(invoked); } static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, int height, int64_t blockTime, double verificationProgress, bool fHeader) @@ -233,11 +238,12 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, int heig // if we are in-sync or if we notify a header update, update the UI regardless of last update time if (fHeader || !initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) { //pass an async signal to the UI thread - QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection, + bool invoked = QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection, Q_ARG(int, height), Q_ARG(QDateTime, QDateTime::fromTime_t(blockTime)), Q_ARG(double, verificationProgress), Q_ARG(bool, fHeader)); + assert(invoked); nLastUpdateNotification = now; } } diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 6b9f79aaf8..03d18d2845 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -418,7 +418,8 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) if (amount > 0) { - CTxOut txout(amount, static_cast<CScript>(std::vector<unsigned char>(24, 0))); + // Assumes a p2pkh script size + CTxOut txout(amount, CScript() << std::vector<unsigned char>(24, 0)); txDummy.vout.push_back(txout); fDust |= IsDust(txout, model->node().getDustRelayFee()); } @@ -509,7 +510,8 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) // Never create dust outputs; if we would, just add the dust to the fee. if (nChange > 0 && nChange < MIN_CHANGE) { - CTxOut txout(nChange, static_cast<CScript>(std::vector<unsigned char>(24, 0))); + // Assumes a p2pkh script size + CTxOut txout(nChange, CScript() << std::vector<unsigned char>(24, 0)); if (IsDust(txout, model->node().getDustRelayFee())) { nPayFee += nChange; diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index c595361934..102e37e471 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -119,16 +119,16 @@ Intro::Intro(QWidget *parent, uint64_t blockchain_size, uint64_t chain_state_siz m_chain_state_size(chain_state_size) { ui->setupUi(this); - ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(tr(PACKAGE_NAME))); - ui->storageLabel->setText(ui->storageLabel->text().arg(tr(PACKAGE_NAME))); + ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(PACKAGE_NAME)); + ui->storageLabel->setText(ui->storageLabel->text().arg(PACKAGE_NAME)); ui->lblExplanation1->setText(ui->lblExplanation1->text() - .arg(tr(PACKAGE_NAME)) + .arg(PACKAGE_NAME) .arg(m_blockchain_size) .arg(2009) .arg(tr("Bitcoin")) ); - ui->lblExplanation2->setText(ui->lblExplanation2->text().arg(tr(PACKAGE_NAME))); + ui->lblExplanation2->setText(ui->lblExplanation2->text().arg(PACKAGE_NAME)); uint64_t pruneTarget = std::max<int64_t>(0, gArgs.GetArg("-prune", 0)); requiredSpace = m_blockchain_size; @@ -145,7 +145,7 @@ Intro::Intro(QWidget *parent, uint64_t blockchain_size, uint64_t chain_state_siz } requiredSpace += m_chain_state_size; ui->sizeWarningLabel->setText( - tr("%1 will download and store a copy of the Bitcoin block chain.").arg(tr(PACKAGE_NAME)) + " " + + tr("%1 will download and store a copy of the Bitcoin block chain.").arg(PACKAGE_NAME) + " " + storageRequiresMsg.arg(requiredSpace) + " " + tr("The wallet will also be stored in this directory.") ); @@ -221,7 +221,7 @@ bool Intro::pickDataDirectory(interfaces::Node& node) } break; } catch (const fs::filesystem_error&) { - QMessageBox::critical(nullptr, tr(PACKAGE_NAME), + QMessageBox::critical(nullptr, PACKAGE_NAME, tr("Error: Specified data directory \"%1\" cannot be created.").arg(dataDir)); /* fall through, back to choosing screen */ } diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index c6ecbc3f87..bff7469071 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -59,7 +59,7 @@ <translation>&Delete</translation> </message> <message> - <location filename="../addressbookpage.cpp" line="+85"/> + <location filename="../addressbookpage.cpp" line="+84"/> <source>Choose the address to send coins to</source> <translation type="unfinished"></translation> </message> @@ -90,7 +90,7 @@ </message> <message> <location line="+5"/> - <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source> + <source>These are your Bitcoin addresses for receiving payments. Use the 'Create new receiving address' button in the receive tab to create new addresses.</source> <translation type="unfinished"></translation> </message> <message> @@ -132,7 +132,7 @@ <context> <name>AddressTableModel</name> <message> - <location filename="../addresstablemodel.cpp" line="+164"/> + <location filename="../addresstablemodel.cpp" line="+163"/> <source>Label</source> <translation type="unfinished"></translation> </message> @@ -297,7 +297,7 @@ <context> <name>BanTableModel</name> <message> - <location filename="../bantablemodel.cpp" line="+88"/> + <location filename="../bantablemodel.cpp" line="+86"/> <source>IP/Netmask</source> <translation type="unfinished"></translation> </message> @@ -315,12 +315,12 @@ <translation>Sign &message...</translation> </message> <message> - <location line="+574"/> + <location line="+638"/> <source>Synchronizing with network...</source> <translation>Synchronizing with network...</translation> </message> <message> - <location line="-652"/> + <location line="-716"/> <source>&Overview</source> <translation>&Overview</translation> </message> @@ -400,12 +400,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+157"/> + <location line="+217"/> <source>Wallet:</source> <translation type="unfinished"></translation> </message> <message> - <location line="+330"/> + <location line="+334"/> <source>Click to disable network activity.</source> <translation type="unfinished"></translation> </message> @@ -430,12 +430,12 @@ <translation>Reindexing blocks on disk...</translation> </message> <message> - <location line="+315"/> + <location line="+317"/> <source>Proxy is <b>enabled</b>: %1</source> <translation type="unfinished"></translation> </message> <message> - <location line="-970"/> + <location line="-1036"/> <source>Send coins to a Bitcoin address</source> <translation>Send coins to a Bitcoin address</translation> </message> @@ -465,12 +465,7 @@ <translation>&Verify message...</translation> </message> <message> - <location line="+660"/> - <source>Bitcoin</source> - <translation>Bitcoin</translation> - </message> - <message> - <location line="-733"/> + <location line="-73"/> <source>&Send</source> <translation>&Send</translation> </message> @@ -505,12 +500,12 @@ <translation>Verify messages to ensure they were signed with specified Bitcoin addresses</translation> </message> <message> - <location line="+61"/> + <location line="+118"/> <source>&File</source> <translation>&File</translation> </message> <message> - <location line="+11"/> + <location line="+14"/> <source>&Settings</source> <translation>&Settings</translation> </message> @@ -525,7 +520,7 @@ <translation>Tabs toolbar</translation> </message> <message> - <location line="-211"/> + <location line="-271"/> <source>Request payments (generates QR codes and bitcoin: URIs)</source> <translation type="unfinished"></translation> </message> @@ -545,12 +540,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+2"/> + <location line="+10"/> <source>&Command-line options</source> <translation type="unfinished"></translation> </message> <message numerus="yes"> - <location line="+484"/> + <location line="+540"/> <source>%n active connection(s) to Bitcoin network</source> <translation> <numerusform>%n active connection to Bitcoin network</numerusform> @@ -591,27 +586,27 @@ <translation>Transactions after this will not yet be visible.</translation> </message> <message> - <location line="+27"/> + <location line="+28"/> <source>Error</source> <translation>Error</translation> </message> <message> - <location line="+3"/> + <location line="+4"/> <source>Warning</source> <translation>Warning</translation> </message> <message> - <location line="+3"/> + <location line="+4"/> <source>Information</source> <translation>Information</translation> </message> <message> - <location line="-78"/> + <location line="-81"/> <source>Up to date</source> <translation>Up to date</translation> </message> <message> - <location line="-593"/> + <location line="-657"/> <source>&Sending addresses</source> <translation type="unfinished"></translation> </message> @@ -621,12 +616,52 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+8"/> + <location line="+6"/> + <source>Open Wallet</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>Open a wallet</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Close Wallet...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Close wallet</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+4"/> <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source> <translation type="unfinished"></translation> </message> <message> - <location line="+63"/> + <location line="+30"/> + <source>default wallet</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Opening Wallet <b>%1</b>...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+9"/> + <source>Open Wallet Failed</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+15"/> + <source>No wallets available</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+48"/> <source>&Window</source> <translation type="unfinished">&Window</translation> </message> @@ -651,7 +686,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+228"/> + <location line="+232"/> <source>%1 client</source> <translation type="unfinished"></translation> </message> @@ -666,7 +701,17 @@ <translation>Catching up...</translation> </message> <message> - <location line="+151"/> + <location line="+50"/> + <source>Error: %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+4"/> + <source>Warning: %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+99"/> <source>Date: %1 </source> <translation type="unfinished"></translation> @@ -737,7 +782,7 @@ <translation>Wallet is <b>encrypted</b> and currently <b>locked</b></translation> </message> <message> - <location filename="../bitcoin.cpp" line="+395"/> + <location filename="../bitcoin.cpp" line="+390"/> <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> <translation type="unfinished"></translation> </message> @@ -830,7 +875,7 @@ <translation type="unfinished">Confirmed</translation> </message> <message> - <location filename="../coincontroldialog.cpp" line="+58"/> + <location filename="../coincontroldialog.cpp" line="+54"/> <source>Copy address</source> <translation type="unfinished"></translation> </message> @@ -1031,7 +1076,7 @@ <context> <name>HelpMessageDialog</name> <message> - <location filename="../utilitydialog.cpp" line="+44"/> + <location filename="../utilitydialog.cpp" line="+39"/> <source>version</source> <translation type="unfinished">version</translation> </message> @@ -1120,7 +1165,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+80"/> + <location line="+75"/> <source>Error: Specified data directory "%1" cannot be created.</source> <translation type="unfinished"></translation> </message> @@ -1171,7 +1216,7 @@ <message> <location line="+7"/> <location line="+26"/> - <location filename="../modaloverlay.cpp" line="+140"/> + <location filename="../modaloverlay.cpp" line="+141"/> <source>Unknown...</source> <translation type="unfinished"></translation> </message> @@ -1207,8 +1252,8 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../modaloverlay.cpp" line="-1"/> - <source>Unknown. Syncing Headers (%1)...</source> + <location filename="../modaloverlay.cpp" line="+6"/> + <source>Unknown. Syncing Headers (%1, %2%)...</source> <translation type="unfinished"></translation> </message> </context> @@ -1540,12 +1585,12 @@ <translation>default</translation> </message> <message> - <location line="+63"/> + <location line="+67"/> <source>none</source> <translation type="unfinished"></translation> </message> <message> - <location line="+93"/> + <location line="+89"/> <source>Confirm options reset</source> <translation>Confirm options reset</translation> </message> @@ -1689,7 +1734,7 @@ <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+226"/> - <location line="+338"/> + <location line="+346"/> <location line="+42"/> <location line="+110"/> <location line="+14"/> @@ -1698,7 +1743,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-521"/> + <location line="-529"/> <source>Cannot start bitcoin: click-to-pay handler</source> <translation type="unfinished"></translation> </message> @@ -1706,14 +1751,14 @@ <location line="+62"/> <location line="+9"/> <location line="+16"/> + <location line="+16"/> <location line="+5"/> - <location line="+12"/> <location line="+7"/> <source>URI handling</source> <translation type="unfinished"></translation> </message> <message> - <location line="-49"/> + <location line="-53"/> <source>'bitcoin://' is not a valid URI. Use 'bitcoin:' instead.</source> <translation type="unfinished"></translation> </message> @@ -1728,12 +1773,13 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+5"/> + <location line="+16"/> + <location line="+36"/> <source>Cannot process payment request because BIP70 support was not compiled in.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+11"/> + <location line="-32"/> <source>Invalid payment address %1</source> <translation type="unfinished"></translation> </message> @@ -1744,16 +1790,17 @@ </message> <message> <location line="+14"/> + <location line="+9"/> <source>Payment request file handling</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> + <location line="-8"/> <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+195"/> + <location line="+199"/> <location line="+9"/> <location line="+31"/> <location line="+10"/> @@ -1832,7 +1879,7 @@ <context> <name>PeerTableModel</name> <message> - <location filename="../peertablemodel.cpp" line="+109"/> + <location filename="../peertablemodel.cpp" line="+108"/> <source>User Agent</source> <translation type="unfinished"></translation> </message> @@ -1865,17 +1912,17 @@ <context> <name>QObject</name> <message> - <location filename="../bitcoinunits.cpp" line="+197"/> + <location filename="../bitcoinunits.cpp" line="+195"/> <source>Amount</source> <translation type="unfinished">Amount</translation> </message> <message> - <location filename="../guiutil.cpp" line="+111"/> + <location filename="../guiutil.cpp" line="+108"/> <source>Enter a Bitcoin address (e.g. %1)</source> <translation type="unfinished"></translation> </message> <message> - <location line="+687"/> + <location line="+702"/> <source>%1 d</source> <translation type="unfinished"></translation> </message> @@ -1985,20 +2032,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../bitcoin.cpp" line="+185"/> - <source>%1 didn't yet exit safely...</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../modaloverlay.cpp" line="-29"/> - <source>unknown</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>QObject::QObject</name> - <message> - <location filename="../bitcoin.cpp" line="-113"/> + <location filename="../bitcoin.cpp" line="+74"/> <source>Error parsing command line arguments: %1.</source> <translation type="unfinished"></translation> </message> @@ -2017,11 +2051,21 @@ <source>Error: %1</source> <translation type="unfinished"></translation> </message> + <message> + <location line="+57"/> + <source>%1 didn't yet exit safely...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../modaloverlay.cpp" line="-36"/> + <source>unknown</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>QRImageWidget</name> <message> - <location filename="../receiverequestdialog.cpp" line="+32"/> + <location filename="../qrimagewidget.cpp" line="+29"/> <source>&Save Image...</source> <translation type="unfinished"></translation> </message> @@ -2031,6 +2075,21 @@ <translation type="unfinished"></translation> </message> <message> + <location line="+13"/> + <source>Resulting URI too long, try to reduce the text for label / message.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Error encoding URI into QR Code.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+38"/> + <source>QR code support not available.</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+32"/> <source>Save QR Code</source> <translation type="unfinished"></translation> @@ -2056,7 +2115,7 @@ <location line="+23"/> <location line="+36"/> <location line="+23"/> - <location line="+713"/> + <location line="+716"/> <location line="+23"/> <location line="+23"/> <location line="+23"/> @@ -2078,7 +2137,7 @@ <translation>N/A</translation> </message> <message> - <location line="-1427"/> + <location line="-1430"/> <source>Client version</source> <translation>Client version</translation> </message> @@ -2178,7 +2237,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+238"/> + <location line="+241"/> <source>&Reset</source> <translation type="unfinished"></translation> </message> @@ -2206,8 +2265,8 @@ </message> <message> <location line="+65"/> - <location filename="../rpcconsole.cpp" line="+501"/> - <location line="+754"/> + <location filename="../rpcconsole.cpp" line="+498"/> + <location line="+757"/> <source>Select a peer to view detailed information.</source> <translation type="unfinished"></translation> </message> @@ -2242,13 +2301,13 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-1161"/> - <location line="+1069"/> + <location line="-1164"/> + <location line="+1072"/> <source>User Agent</source> <translation type="unfinished"></translation> </message> <message> - <location line="-734"/> + <location line="-737"/> <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"></translation> </message> @@ -2263,7 +2322,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+641"/> + <location line="+644"/> <source>Services</source> <translation type="unfinished"></translation> </message> @@ -2313,7 +2372,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-1166"/> + <location line="-1169"/> <source>Last block time</source> <translation>Last block time</translation> </message> @@ -2328,7 +2387,7 @@ <translation>&Console</translation> </message> <message> - <location line="+214"/> + <location line="+217"/> <source>&Network Traffic</source> <translation type="unfinished"></translation> </message> @@ -2348,7 +2407,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../forms/debugwindow.ui" line="-318"/> + <location filename="../forms/debugwindow.ui" line="-321"/> <source>Debug log file</source> <translation>Debug log file</translation> </message> @@ -2358,7 +2417,7 @@ <translation>Clear console</translation> </message> <message> - <location filename="../rpcconsole.cpp" line="-249"/> + <location filename="../rpcconsole.cpp" line="-252"/> <source>1 &hour</source> <translation type="unfinished"></translation> </message> @@ -2396,7 +2455,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+161"/> + <location line="+164"/> <source>Welcome to the %1 RPC console.</source> <translation type="unfinished"></translation> </message> @@ -2513,43 +2572,43 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-39"/> - <location line="+153"/> - <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source> + <location line="+136"/> + <source>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don't support them. When checked, an address compatible with older wallets will be created instead.</source> <translation type="unfinished"></translation> </message> <message> - <location line="-59"/> - <source>Clear all fields of the form.</source> + <location line="+3"/> + <source>Generate legacy address</source> <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Clear</source> + <location line="-178"/> + <location line="+153"/> + <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+78"/> - <source>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don't support them. When unchecked, an address compatible with older wallets will be created instead.</source> + <location line="-76"/> + <source>&Create new receiving address</source> <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Generate native segwit (Bech32) address</source> + <location line="+17"/> + <source>Clear all fields of the form.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+61"/> - <source>Requested payments history</source> + <location line="+3"/> + <source>Clear</source> <translation type="unfinished"></translation> </message> <message> - <location line="-162"/> - <source>&Request payment</source> + <location line="+142"/> + <source>Requested payments history</source> <translation type="unfinished"></translation> </message> <message> - <location line="+187"/> + <location line="+25"/> <source>Show the selected request (does the same as double clicking an entry)</source> <translation type="unfinished"></translation> </message> @@ -2569,7 +2628,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../receivecoinsdialog.cpp" line="+47"/> + <location filename="../receivecoinsdialog.cpp" line="+45"/> <source>Copy URI</source> <translation type="unfinished"></translation> </message> @@ -2612,7 +2671,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../receiverequestdialog.cpp" line="+65"/> + <location filename="../receiverequestdialog.cpp" line="+63"/> <source>Request payment to %1</source> <translation type="unfinished"></translation> </message> @@ -2651,16 +2710,6 @@ <source>Wallet</source> <translation type="unfinished">Wallet</translation> </message> - <message> - <location line="+11"/> - <source>Resulting URI too long, try to reduce the text for label / message.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+5"/> - <source>Error encoding URI into QR Code.</source> - <translation type="unfinished"></translation> - </message> </context> <context> <name>RecentRequestsTableModel</name> @@ -2704,7 +2753,7 @@ <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> - <location filename="../sendcoinsdialog.cpp" line="+593"/> + <location filename="../sendcoinsdialog.cpp" line="+600"/> <source>Send Coins</source> <translation>Send Coins</translation> </message> @@ -2891,7 +2940,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation>S&end</translation> </message> <message> - <location filename="../sendcoinsdialog.cpp" line="-505"/> + <location filename="../sendcoinsdialog.cpp" line="-512"/> <source>Copy quantity</source> <translation type="unfinished"></translation> </message> @@ -2931,10 +2980,19 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+133"/> - <location line="+5"/> - <location line="+6"/> - <location line="+4"/> + <location line="+117"/> + <source> from wallet '%1'</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+14"/> + <location line="+11"/> + <source>%1 to '%2'</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-6"/> + <location line="+10"/> <source>%1 to %2</source> <translation type="unfinished"></translation> </message> @@ -2954,12 +3012,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="-61"/> - <source>from wallet %1</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+40"/> + <location line="-21"/> <source>Please, review your transaction.</source> <translation type="unfinished"></translation> </message> @@ -2979,12 +3032,17 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+5"/> + <location line="+9"/> + <source>To review recipient list click "Show Details..."</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+6"/> <source>Confirm send coins</source> <translation type="unfinished"></translation> </message> <message> - <location line="+191"/> + <location line="+190"/> <source>The recipient address is not valid. Please recheck.</source> <translation type="unfinished"></translation> </message> @@ -3179,7 +3237,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <context> <name>SendConfirmationDialog</name> <message> - <location filename="../sendcoinsdialog.cpp" line="+83"/> + <location filename="../sendcoinsdialog.cpp" line="+88"/> <location line="+5"/> <source>Yes</source> <translation type="unfinished"></translation> @@ -3399,7 +3457,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <context> <name>TransactionDesc</name> <message numerus="yes"> - <location filename="../transactiondesc.cpp" line="+35"/> + <location filename="../transactiondesc.cpp" line="+34"/> <source>Open for %n more block(s)</source> <translation> <numerusform>Open for %n more block</numerusform> @@ -3640,7 +3698,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <context> <name>TransactionTableModel</name> <message> - <location filename="../transactiontablemodel.cpp" line="+227"/> + <location filename="../transactiontablemodel.cpp" line="+223"/> <source>Date</source> <translation type="unfinished">Date</translation> </message> @@ -3776,7 +3834,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <context> <name>TransactionView</name> <message> - <location filename="../transactionview.cpp" line="+71"/> + <location filename="../transactionview.cpp" line="+70"/> <location line="+16"/> <source>All</source> <translation type="unfinished"></translation> @@ -3975,12 +4033,30 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <context> <name>UnitDisplayStatusBarControl</name> <message> - <location filename="../bitcoingui.cpp" line="+154"/> + <location filename="../bitcoingui.cpp" line="+155"/> <source>Unit to show amounts in. Click to select another unit.</source> <translation type="unfinished"></translation> </message> </context> <context> + <name>WalletController</name> + <message> + <location filename="../walletcontroller.cpp" line="+70"/> + <source>Close wallet</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Are you sure you wish to close wallet <i>%1</i>?</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Closing the wallet for too long can result in having to resync the entire chain if pruning is enabled.</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>WalletFrame</name> <message> <location filename="../walletframe.cpp" line="+29"/> @@ -4043,7 +4119,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+35"/> + <location line="+30"/> <source>default wallet</source> <translation type="unfinished"></translation> </message> @@ -4099,7 +4175,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <context> <name>bitcoin-core</name> <message> - <location filename="../bitcoinstrings.cpp" line="+29"/> + <location filename="../bitcoinstrings.cpp" line="+28"/> <source>Distributed under the MIT software license, see the accompanying file %s or %s</source> <translation type="unfinished"></translation> </message> @@ -4119,7 +4195,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+74"/> + <location line="+70"/> <source>Error: A fatal internal error occurred, see debug.log for details</source> <translation type="unfinished"></translation> </message> @@ -4129,22 +4205,22 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+30"/> + <location line="+31"/> <source>Unable to start HTTP server. See debug log for details.</source> <translation type="unfinished"></translation> </message> <message> - <location line="-172"/> - <source>Bitcoin Core</source> - <translation type="unfinished">Bitcoin Core</translation> + <location line="-168"/> + <source>The %s developers</source> + <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>The %s developers</source> + <location line="+4"/> + <source>Can't generate a change-address key. No keys in the internal keypool and can't generate any keys.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+7"/> + <location line="+3"/> <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source> <translation type="unfinished"></translation> </message> @@ -4199,7 +4275,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+10"/> + <location line="+7"/> <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source> <translation type="unfinished"></translation> </message> @@ -4290,11 +4366,6 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos </message> <message> <location line="+6"/> - <source>Error: Disk space is low!</source> - <translation>Error: Disk space is low!</translation> - </message> - <message> - <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Failed to listen on any port. Use -listen=0 if you want this.</translation> </message> @@ -4314,7 +4385,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation>Incorrect or no genesis block found. Wrong datadir for network?</translation> </message> <message> - <location line="+2"/> + <location line="+1"/> <source>Initialization sanity check failed. %s is shutting down.</source> <translation type="unfinished"></translation> </message> @@ -4334,22 +4405,27 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+22"/> + <location line="+23"/> <source>Specified blocks directory "%s" does not exist.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+24"/> + <location line="+26"/> <source>Upgrading txindex database</source> <translation type="unfinished"></translation> </message> <message> - <location line="-42"/> + <location line="-45"/> <source>Loading P2P addresses...</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> + <location line="-15"/> + <source>Error: Disk space is too low!</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+16"/> <source>Loading banlist...</source> <translation type="unfinished"></translation> </message> @@ -4364,7 +4440,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> + <location line="+2"/> <source>Prune mode is incompatible with -txindex.</source> <translation type="unfinished"></translation> </message> @@ -4394,12 +4470,12 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+2"/> + <location line="+3"/> <source>Unable to generate keys</source> <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> + <location line="+4"/> <source>Unsupported logging category %s=%s.</source> <translation type="unfinished"></translation> </message> @@ -4419,12 +4495,12 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation>Verifying blocks...</translation> </message> <message> - <location line="+3"/> + <location line="+2"/> <source>Wallet needed to be rewritten: restart %s to complete</source> <translation type="unfinished"></translation> </message> <message> - <location line="-158"/> + <location line="-155"/> <source>Error: Listening for incoming connections failed (listen returned error %s)</source> <translation type="unfinished"></translation> </message> @@ -4439,7 +4515,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+38"/> + <location line="+35"/> <source>You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain</source> <translation type="unfinished"></translation> </message> @@ -4454,17 +4530,12 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> + <location line="+2"/> <source>Error: Disk space is low for %s</source> <translation type="unfinished"></translation> </message> <message> - <location line="+6"/> - <source>Information</source> - <translation>Information</translation> - </message> - <message> - <location line="+3"/> + <location line="+8"/> <source>Invalid -onion address or hostname: '%s'</source> <translation type="unfinished"></translation> </message> @@ -4489,7 +4560,12 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+5"/> + <location line="+3"/> + <source>Prune mode is incompatible with -blockfilterindex.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> <source>Reducing -maxconnections from %d to %d, because of system limitations.</source> <translation type="unfinished"></translation> </message> @@ -4556,26 +4632,26 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos </message> <message> <location line="+2"/> - <source>Unable to generate initial keys</source> + <source>Unable to create the PID file '%s': %s</source> <translation type="unfinished"></translation> </message> <message> - <location line="+9"/> - <source>Verifying wallet(s)...</source> + <location line="+1"/> + <source>Unable to generate initial keys</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Wallet %s resides outside wallet directory %s</source> + <location line="+3"/> + <source>Unknown -blockfilterindex value %s.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+2"/> - <source>Warning</source> - <translation>Warning</translation> + <location line="+7"/> + <source>Verifying wallet(s)...</source> + <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> + <location line="+2"/> <source>Warning: unknown new rules activated (versionbit %i)</source> <translation type="unfinished"></translation> </message> @@ -4585,7 +4661,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="-182"/> + <location line="-178"/> <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source> <translation type="unfinished"></translation> </message> @@ -4606,11 +4682,6 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos </message> <message> <location line="+14"/> - <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"></translation> </message> @@ -4625,12 +4696,12 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+22"/> + <location line="+20"/> <source>Keypool ran out, please call keypoolrefill first</source> <translation type="unfinished"></translation> </message> <message> - <location line="+20"/> + <location line="+21"/> <source>Starting network threads...</source> <translation type="unfinished"></translation> </message> @@ -4665,22 +4736,17 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+8"/> + <location line="+10"/> <source>Unknown network specified in -onlynet: '%s'</source> <translation>Unknown network specified in -onlynet: '%s'</translation> </message> <message> - <location line="-48"/> + <location line="-51"/> <source>Insufficient funds</source> <translation>Insufficient funds</translation> </message> <message> - <location line="-120"/> - <source>Can't generate a change-address key. Private keys are disabled for this wallet.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+8"/> + <location line="-107"/> <source>Cannot upgrade a non HD split wallet without upgrading to support pre split keypool. Please use -upgradewallet=169900 or -upgradewallet with no version specified.</source> <translation type="unfinished"></translation> </message> @@ -4695,12 +4761,12 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+24"/> + <location line="+21"/> <source>Cannot write to data directory '%s'; check permissions.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+39"/> + <location line="+37"/> <source>Loading block index...</source> <translation>Loading block index...</translation> </message> @@ -4710,24 +4776,19 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation>Loading wallet...</translation> </message> <message> - <location line="-42"/> + <location line="-40"/> <source>Cannot downgrade wallet</source> <translation>Cannot downgrade wallet</translation> </message> <message> - <location line="+50"/> + <location line="+49"/> <source>Rescanning...</source> <translation>Rescanning...</translation> </message> <message> - <location line="-42"/> + <location line="-41"/> <source>Done loading</source> <translation>Done loading</translation> </message> - <message> - <location line="+12"/> - <source>Error</source> - <translation>Error</translation> - </message> </context> </TS> diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 40dc7bf400..57cafaaac0 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -87,12 +87,12 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) : /* Display elements init */ QDir translations(":translations"); - ui->bitcoinAtStartup->setToolTip(ui->bitcoinAtStartup->toolTip().arg(tr(PACKAGE_NAME))); - ui->bitcoinAtStartup->setText(ui->bitcoinAtStartup->text().arg(tr(PACKAGE_NAME))); + ui->bitcoinAtStartup->setToolTip(ui->bitcoinAtStartup->toolTip().arg(PACKAGE_NAME)); + ui->bitcoinAtStartup->setText(ui->bitcoinAtStartup->text().arg(PACKAGE_NAME)); - ui->openBitcoinConfButton->setToolTip(ui->openBitcoinConfButton->toolTip().arg(tr(PACKAGE_NAME))); + ui->openBitcoinConfButton->setToolTip(ui->openBitcoinConfButton->toolTip().arg(PACKAGE_NAME)); - ui->lang->setToolTip(ui->lang->toolTip().arg(tr(PACKAGE_NAME))); + ui->lang->setToolTip(ui->lang->toolTip().arg(PACKAGE_NAME)); ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant("")); for (const QString &langStr : translations.entryList()) { diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index c99515fe1c..f3f5d28af9 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -666,16 +666,14 @@ void PaymentServer::fetchPaymentACK(WalletModel* walletModel, const SendCoinsRec payment.add_transactions(transaction.data(), transaction.size()); // Create a new refund address, or re-use: - CPubKey newKey; - if (walletModel->wallet().getKeyFromPool(false /* internal */, newKey)) { + CTxDestination dest; + const OutputType change_type = walletModel->wallet().getDefaultChangeType() != OutputType::CHANGE_AUTO ? walletModel->wallet().getDefaultChangeType() : walletModel->wallet().getDefaultAddressType(); + if (walletModel->wallet().getNewDestination(change_type, "", dest)) { // BIP70 requests encode the scriptPubKey directly, so we are not restricted to address // types supported by the receiver. As a result, we choose the address format we also // use for change. Despite an actual payment and not change, this is a close match: // it's the output type we use subject to privacy issues, but not restricted by what // other software supports. - const OutputType change_type = walletModel->wallet().getDefaultChangeType() != OutputType::CHANGE_AUTO ? walletModel->wallet().getDefaultChangeType() : walletModel->wallet().getDefaultAddressType(); - walletModel->wallet().learnRelatedScripts(newKey, change_type); - CTxDestination dest = GetDestinationForKey(newKey, change_type); std::string label = tr("Refund from %1").arg(recipient.authenticatedMerchant).toStdString(); walletModel->wallet().setAddressBook(dest, label, "refund"); diff --git a/src/qt/res/movies/makespinner.sh b/src/qt/res/movies/makespinner.sh index f47c66e02c..3507837da9 100755 --- a/src/qt/res/movies/makespinner.sh +++ b/src/qt/res/movies/makespinner.sh @@ -9,6 +9,6 @@ FRAMEDIR=$(dirname $0) for i in {0..35} do frame=$(printf "%03d" $i) - angle=$(($i * 10)) + angle=$((i * 10)) convert $FRAMEDIR/../src/spinner.png -background "rgba(0,0,0,0.0)" -distort SRT $angle $FRAMEDIR/spinner-$frame.png done diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 071a197c3c..84b4a2d0d8 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -457,7 +457,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty QChar nonbreaking_hyphen(8209); 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(tr(PACKAGE_NAME))); + ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(PACKAGE_NAME)); if (platformStyle->getImagesOnButtons()) { ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(":/icons/export")); @@ -804,7 +804,7 @@ void RPCConsole::clear(bool clearHistory) QString clsKey = "Ctrl-L"; #endif - message(CMD_REPLY, (tr("Welcome to the %1 RPC console.").arg(tr(PACKAGE_NAME)) + "<br>" + + message(CMD_REPLY, (tr("Welcome to the %1 RPC console.").arg(PACKAGE_NAME) + "<br>" + tr("Use up and down arrows to navigate history, and %1 to clear screen.").arg("<b>"+clsKey+"</b>") + "<br>" + tr("Type %1 for an overview of available commands.").arg("<b>help</b>") + "<br>" + tr("For more information on using this console type %1.").arg("<b>help-console</b>") + diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 0126a2920e..98eeee1a47 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -39,7 +39,7 @@ SplashScreen::SplashScreen(interfaces::Node& node, Qt::WindowFlags f, const Netw devicePixelRatio = static_cast<QGuiApplication*>(QCoreApplication::instance())->devicePixelRatio(); // define text to place - QString titleText = tr(PACKAGE_NAME); + QString titleText = PACKAGE_NAME; QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); QString copyrightText = QString::fromUtf8(CopyrightHolders(strprintf("\xc2\xA9 %u-%u ", 2009, COPYRIGHT_YEAR)).c_str()); QString titleAddText = networkStyle->getTitleAddText(); @@ -156,11 +156,12 @@ void SplashScreen::finish() static void InitMessage(SplashScreen *splash, const std::string &message) { - QMetaObject::invokeMethod(splash, "showMessage", + bool invoked = QMetaObject::invokeMethod(splash, "showMessage", Qt::QueuedConnection, Q_ARG(QString, QString::fromStdString(message)), Q_ARG(int, Qt::AlignBottom|Qt::AlignHCenter), Q_ARG(QColor, QColor(55,55,55))); + assert(invoked); } static void ShowProgress(SplashScreen *splash, const std::string &title, int nProgress, bool resume_possible) diff --git a/src/qt/test/apptests.cpp b/src/qt/test/apptests.cpp index a900ec0198..49e9e072a8 100644 --- a/src/qt/test/apptests.cpp +++ b/src/qt/test/apptests.cpp @@ -11,6 +11,8 @@ #include <qt/networkstyle.h> #include <qt/rpcconsole.h> #include <shutdown.h> +#include <test/setup_common.h> +#include <univalue.h> #include <validation.h> #if defined(HAVE_CONFIG_H) @@ -26,8 +28,6 @@ #include <QtGlobal> #include <QtTest/QtTestWidgets> #include <QtTest/QtTestGui> -#include <string> -#include <univalue.h> namespace { //! Call getblockchaininfo RPC and check first field of JSON output. @@ -62,6 +62,7 @@ void AppTests::appTests() } #endif + BasicTestingSetup test{CBaseChainParams::REGTEST}; // Create a temp data directory to backup the gui settings to ECC_Stop(); // Already started by the common test setup, so stop it to avoid interference LogInstance().DisconnectTestLogger(); diff --git a/src/qt/test/paymentservertests.cpp b/src/qt/test/paymentservertests.cpp index f0eca899fc..6cafe05461 100644 --- a/src/qt/test/paymentservertests.cpp +++ b/src/qt/test/paymentservertests.cpp @@ -13,7 +13,7 @@ #include <random.h> #include <script/script.h> #include <script/standard.h> -#include <util/system.h> +#include <test/setup_common.h> #include <util/strencodings.h> #include <openssl/x509.h> @@ -66,7 +66,7 @@ static SendCoinsRecipient handleRequest(PaymentServer* server, std::vector<unsig void PaymentServerTests::paymentServerTests() { - SelectParams(CBaseChainParams::MAIN); + BasicTestingSetup testing_setup(CBaseChainParams::MAIN); auto node = interfaces::MakeNode(); OptionsModel optionsModel(*node); PaymentServer* server = new PaymentServer(nullptr, false); diff --git a/src/qt/test/rpcnestedtests.cpp b/src/qt/test/rpcnestedtests.cpp index 3735f41f9d..3c2ffa6c00 100644 --- a/src/qt/test/rpcnestedtests.cpp +++ b/src/qt/test/rpcnestedtests.cpp @@ -34,9 +34,6 @@ void RPCNestedTests::rpcNestedTests() tableRPC.appendCommand("rpcNestedTest", &vRPCCommands[0]); //mempool.setSanityCheck(1.0); - ECC_Stop(); // Already started by the common test setup, so stop it to avoid interference - LogInstance().DisconnectTestLogger(); - TestingSetup test; if (RPCIsInWarmup(nullptr)) SetRPCWarmupFinished(); diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index 79d88ab742..6bda8dc6eb 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -42,12 +42,18 @@ Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); #endif #endif -extern void noui_connect(); - // This is all you need to run all the tests int main(int argc, char *argv[]) { - BasicTestingSetup test{CBaseChainParams::REGTEST}; + // Initialize persistent globals with the testing setup state for sanity. + // E.g. -datadir in gArgs is set to a temp directory dummy value (instead + // of defaulting to the default datadir), or globalChainParams is set to + // regtest params. + // + // All tests must use their own testing setup (if needed). + { + BasicTestingSetup dummy{CBaseChainParams::REGTEST}; + } auto node = interfaces::MakeNode(); diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp index e54915ec75..120dff95c0 100644 --- a/src/qt/test/wallettests.cpp +++ b/src/qt/test/wallettests.cpp @@ -68,7 +68,8 @@ uint256 SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CTxDe if (status == CT_NEW) txid = hash; })); ConfirmSend(); - QMetaObject::invokeMethod(&sendCoinsDialog, "on_sendButton_clicked"); + bool invoked = QMetaObject::invokeMethod(&sendCoinsDialog, "on_sendButton_clicked"); + assert(invoked); return txid; } diff --git a/src/qt/trafficgraphwidget.cpp b/src/qt/trafficgraphwidget.cpp index 1588be8da3..006007be63 100644 --- a/src/qt/trafficgraphwidget.cpp +++ b/src/qt/trafficgraphwidget.cpp @@ -104,6 +104,7 @@ void TrafficGraphWidget::paintEvent(QPaintEvent *) } } + painter.setRenderHint(QPainter::Antialiasing); if(!vSamplesIn.empty()) { QPainterPath p; paintPath(p, vSamplesIn); diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 6fe35b13cf..1064c60dfd 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -687,10 +687,11 @@ public: { QString strHash = QString::fromStdString(hash.GetHex()); qDebug() << "NotifyTransactionChanged: " + strHash + " status= " + QString::number(status); - QMetaObject::invokeMethod(ttm, "updateTransaction", Qt::QueuedConnection, + bool invoked = QMetaObject::invokeMethod(ttm, "updateTransaction", Qt::QueuedConnection, Q_ARG(QString, strHash), Q_ARG(int, status), Q_ARG(bool, showTransaction)); + assert(invoked); } private: uint256 hash; @@ -725,12 +726,16 @@ static void ShowProgress(TransactionTableModel *ttm, const std::string &title, i if (nProgress == 100) { fQueueNotifications = false; - if (vQueueNotifications.size() > 10) // prevent balloon spam, show maximum 10 balloons - QMetaObject::invokeMethod(ttm, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, true)); + if (vQueueNotifications.size() > 10) { // prevent balloon spam, show maximum 10 balloons + bool invoked = QMetaObject::invokeMethod(ttm, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, true)); + assert(invoked); + } for (unsigned int i = 0; i < vQueueNotifications.size(); ++i) { - if (vQueueNotifications.size() - i <= 10) - QMetaObject::invokeMethod(ttm, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, false)); + if (vQueueNotifications.size() - i <= 10) { + bool invoked = QMetaObject::invokeMethod(ttm, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, false)); + assert(invoked); + } vQueueNotifications[i].invoke(ttm); } diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index aa810690c9..6509a701f3 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -36,7 +36,7 @@ HelpMessageDialog::HelpMessageDialog(interfaces::Node& node, QWidget *parent, bo { ui->setupUi(this); - QString version = tr(PACKAGE_NAME) + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion()); + QString version = QString{PACKAGE_NAME} + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion()); /* On x86 add a bit specifier to the version so that users can distinguish between * 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambiguous. */ @@ -48,7 +48,7 @@ HelpMessageDialog::HelpMessageDialog(interfaces::Node& node, QWidget *parent, bo if (about) { - setWindowTitle(tr("About %1").arg(tr(PACKAGE_NAME))); + setWindowTitle(tr("About %1").arg(PACKAGE_NAME)); std::string licenseInfo = LicenseInfo(); /// HTML-format the license message from the core @@ -150,7 +150,7 @@ ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f): { QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(new QLabel( - tr("%1 is shutting down...").arg(tr(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 019bd65823..2aedb77798 100644 --- a/src/qt/walletcontroller.cpp +++ b/src/qt/walletcontroller.cpp @@ -40,19 +40,22 @@ WalletController::~WalletController() m_activity_thread.wait(); } -std::vector<WalletModel*> WalletController::getWallets() const +std::vector<WalletModel*> WalletController::getOpenWallets() const { QMutexLocker locker(&m_mutex); return m_wallets; } -std::vector<std::string> WalletController::getWalletsAvailableToOpen() const +std::map<std::string, bool> WalletController::listWalletDir() const { QMutexLocker locker(&m_mutex); - std::vector<std::string> wallets = m_node.listWalletDir(); + std::map<std::string, bool> wallets; + for (const std::string& name : m_node.listWalletDir()) { + wallets[name] = false; + } for (WalletModel* wallet_model : m_wallets) { - auto it = std::remove(wallets.begin(), wallets.end(), wallet_model->wallet().getWalletName()); - if (it != wallets.end()) wallets.erase(it); + auto it = wallets.find(wallet_model->wallet().getWalletName()); + if (it != wallets.end()) it->second = true; } return wallets; } @@ -121,7 +124,8 @@ WalletModel* WalletController::getOrCreateWallet(std::unique_ptr<interfaces::Wal } else { // Handler callback runs in a different thread so fix wallet model thread affinity. wallet_model->moveToThread(thread()); - QMetaObject::invokeMethod(this, "addWallet", Qt::QueuedConnection, Q_ARG(WalletModel*, wallet_model)); + bool invoked = QMetaObject::invokeMethod(this, "addWallet", Qt::QueuedConnection, Q_ARG(WalletModel*, wallet_model)); + assert(invoked); } return wallet_model; diff --git a/src/qt/walletcontroller.h b/src/qt/walletcontroller.h index 19b3a82253..03039dd795 100644 --- a/src/qt/walletcontroller.h +++ b/src/qt/walletcontroller.h @@ -8,7 +8,7 @@ #include <qt/walletmodel.h> #include <sync.h> -#include <list> +#include <map> #include <memory> #include <vector> @@ -40,8 +40,12 @@ public: WalletController(interfaces::Node& node, const PlatformStyle* platform_style, OptionsModel* options_model, QObject* parent); ~WalletController(); - std::vector<WalletModel*> getWallets() const; - std::vector<std::string> getWalletsAvailableToOpen() const; + //! Returns wallet models currently open. + std::vector<WalletModel*> getOpenWallets() const; + + //! Returns all wallet names in the wallet dir mapped to whether the wallet + //! is loaded. + std::map<std::string, bool> listWalletDir() const; OpenWalletActivity* openWallet(const std::string& name, QWidget* parent = nullptr); void closeWallet(WalletModel* wallet_model, QWidget* parent = nullptr); diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 6f16834109..57406179f7 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -377,13 +377,15 @@ bool WalletModel::changePassphrase(const SecureString &oldPass, const SecureStri static void NotifyUnload(WalletModel* walletModel) { qDebug() << "NotifyUnload"; - QMetaObject::invokeMethod(walletModel, "unload"); + bool invoked = QMetaObject::invokeMethod(walletModel, "unload"); + assert(invoked); } static void NotifyKeyStoreStatusChanged(WalletModel *walletmodel) { qDebug() << "NotifyKeyStoreStatusChanged"; - QMetaObject::invokeMethod(walletmodel, "updateStatus", Qt::QueuedConnection); + bool invoked = QMetaObject::invokeMethod(walletmodel, "updateStatus", Qt::QueuedConnection); + assert(invoked); } static void NotifyAddressBookChanged(WalletModel *walletmodel, @@ -395,38 +397,43 @@ static void NotifyAddressBookChanged(WalletModel *walletmodel, QString strPurpose = QString::fromStdString(purpose); qDebug() << "NotifyAddressBookChanged: " + strAddress + " " + strLabel + " isMine=" + QString::number(isMine) + " purpose=" + strPurpose + " status=" + QString::number(status); - QMetaObject::invokeMethod(walletmodel, "updateAddressBook", Qt::QueuedConnection, + bool invoked = QMetaObject::invokeMethod(walletmodel, "updateAddressBook", Qt::QueuedConnection, Q_ARG(QString, strAddress), Q_ARG(QString, strLabel), Q_ARG(bool, isMine), Q_ARG(QString, strPurpose), Q_ARG(int, status)); + assert(invoked); } static void NotifyTransactionChanged(WalletModel *walletmodel, const uint256 &hash, ChangeType status) { Q_UNUSED(hash); Q_UNUSED(status); - QMetaObject::invokeMethod(walletmodel, "updateTransaction", Qt::QueuedConnection); + bool invoked = QMetaObject::invokeMethod(walletmodel, "updateTransaction", Qt::QueuedConnection); + assert(invoked); } static void ShowProgress(WalletModel *walletmodel, const std::string &title, int nProgress) { // emits signal "showProgress" - QMetaObject::invokeMethod(walletmodel, "showProgress", Qt::QueuedConnection, + bool invoked = QMetaObject::invokeMethod(walletmodel, "showProgress", Qt::QueuedConnection, Q_ARG(QString, QString::fromStdString(title)), Q_ARG(int, nProgress)); + assert(invoked); } static void NotifyWatchonlyChanged(WalletModel *walletmodel, bool fHaveWatchonly) { - QMetaObject::invokeMethod(walletmodel, "updateWatchOnlyFlag", Qt::QueuedConnection, + bool invoked = QMetaObject::invokeMethod(walletmodel, "updateWatchOnlyFlag", Qt::QueuedConnection, Q_ARG(bool, fHaveWatchonly)); + assert(invoked); } static void NotifyCanGetAddressesChanged(WalletModel* walletmodel) { - QMetaObject::invokeMethod(walletmodel, "canGetAddressesChanged"); + bool invoked = QMetaObject::invokeMethod(walletmodel, "canGetAddressesChanged"); + assert(invoked); } void WalletModel::subscribeToCoreSignals() |