diff options
Diffstat (limited to 'src/qt')
63 files changed, 958 insertions, 1712 deletions
diff --git a/src/qt/README.md b/src/qt/README.md index 7c23ccadcc..3ec538b4f4 100644 --- a/src/qt/README.md +++ b/src/qt/README.md @@ -1,10 +1,10 @@ This directory contains the BitcoinQT graphical user interface (GUI). It uses the cross-platform framework [Qt](https://www1.qt.io/developers/). -The current precise version for Qt 5 is specified in [qt.mk](/depends/packages/qt.mk). Qt 4 is also supported (see [#8263](https://github.com/bitcoin/bitcoin/issues/8263)). +The current precise version for Qt 5 is specified in [qt.mk](/depends/packages/qt.mk). ## Compile and run -See build instructions ([OSX](/doc/build-osx.md), [Windows](/doc/build-windows.md), [Unix](/doc/build-unix.md), etc). +See build instructions ([macOS](/doc/build-osx.md), [Windows](/doc/build-windows.md), [Unix](/doc/build-unix.md), etc). To run: @@ -16,7 +16,7 @@ To run: ### forms -Contains [Designer UI](http://doc.qt.io/qt-5.9/designer-using-a-ui-file.html) files. They are created with [Qt Creator](#use-qt-Creator-as IDE), but can be edited using any text editor. +Contains [Designer UI](https://doc.qt.io/qt-5.9/designer-using-a-ui-file.html) files. They are created with [Qt Creator](#using-qt-creator-as-ide), but can be edited using any text editor. ### locale @@ -36,7 +36,7 @@ Represents the main window of the Bitcoin UI. ### \*model.(h/cpp) -The model. When it has a corresponding controller, it generally inherits from [QAbstractTableModel](http://doc.qt.io/qt-5/qabstracttablemodel.html). Models that are used by controllers as helpers inherit from other Qt classes like [QValidator](http://doc.qt.io/qt-5/qvalidator.html). +The model. When it has a corresponding controller, it generally inherits from [QAbstractTableModel](https://doc.qt.io/qt-5/qabstracttablemodel.html). Models that are used by controllers as helpers inherit from other Qt classes like [QValidator](https://doc.qt.io/qt-5/qvalidator.html). ClientModel is used by the main application `bitcoingui` and several models like `peertablemodel`. @@ -46,7 +46,7 @@ A controller. `:NAMEpage.cpp` generally includes `:NAMEmodel.h` and `forms/:NAME ### \*dialog.(h/cpp) -Various dialogs, e.g. to open a URL. Inherit from [QDialog](http://doc.qt.io/qt-4.8/qdialog.html). +Various dialogs, e.g. to open a URL. Inherit from [QDialog](https://doc.qt.io/qt-5/qdialog.html). ### paymentserver.(h/cpp) @@ -65,7 +65,7 @@ Represents the view to a single wallet. * `guiconstants.h`: UI colors, app name, etc * `guiutil.h`: several helper functions * `macdockiconhandler.(h/cpp)` -* `macdockiconhandler.(h/cpp)`: display notifications in OSX +* `macdockiconhandler.(h/cpp)`: display notifications in macOS ## Contribute @@ -81,9 +81,9 @@ the UI layout. Download and install the community edition of [Qt Creator](https://www.qt.io/download/). Uncheck everything except Qt Creator during the installation process. -Instructions for OSX: +Instructions for macOS: -1. Make sure you installed everything through Homebrew mentioned in the [OSX build instructions](/doc/build-osx.md) +1. Make sure you installed everything through Homebrew mentioned in the [macOS build instructions](/doc/build-osx.md) 2. Use `./configure` with the `--enable-debug` flag 3. In Qt Creator do "New Project" -> Import Project -> Import Existing Project 4. Enter "bitcoin-qt" as project name, enter src/qt as location diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index f2ddbf259b..d51069d922 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -160,13 +160,8 @@ void AddressBookPage::setModel(AddressTableModel *_model) ui->tableView->sortByColumn(0, Qt::AscendingOrder); // Set column widths -#if QT_VERSION < 0x050000 - ui->tableView->horizontalHeader()->setResizeMode(AddressTableModel::Label, QHeaderView::Stretch); - ui->tableView->horizontalHeader()->setResizeMode(AddressTableModel::Address, QHeaderView::ResizeToContents); -#else ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Label, QHeaderView::Stretch); ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Address, QHeaderView::ResizeToContents); -#endif connect(ui->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectionChanged())); diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp index f38e864b48..25b615e6f8 100644 --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -159,7 +159,7 @@ public: }; AddressTableModel::AddressTableModel(WalletModel *parent) : - QAbstractTableModel(parent),walletModel(parent),priv(0) + QAbstractTableModel(parent), walletModel(parent) { columns << tr("Label") << tr("Address"); priv = new AddressTablePriv(this); diff --git a/src/qt/addresstablemodel.h b/src/qt/addresstablemodel.h index 979f861fea..6e1b53b049 100644 --- a/src/qt/addresstablemodel.h +++ b/src/qt/addresstablemodel.h @@ -83,10 +83,10 @@ public: OutputType GetDefaultAddressType() const; private: - WalletModel *walletModel; - AddressTablePriv *priv; + WalletModel* const walletModel; + AddressTablePriv *priv = nullptr; QStringList columns; - EditStatus editStatus; + EditStatus editStatus = OK; /** Look up address book data given an address string. */ bool getAddressData(const QString &address, std::string* name, std::string* purpose) const; diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp index 26cb03c2c7..aa0d4a31d3 100644 --- a/src/qt/bantablemodel.cpp +++ b/src/qt/bantablemodel.cpp @@ -52,9 +52,7 @@ public: node.getBanned(banMap); cachedBanlist.clear(); -#if QT_VERSION >= 0x040700 cachedBanlist.reserve(banMap.size()); -#endif for (const auto& entry : banMap) { CCombinedBan banEntry; diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 57fe4552a1..5d0e384cf8 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -26,7 +26,6 @@ #include <qt/walletmodel.h> #endif -#include <init.h> #include <interfaces/handler.h> #include <interfaces/node.h> #include <rpc/server.h> @@ -55,13 +54,6 @@ #if defined(QT_STATICPLUGIN) #include <QtPlugin> -#if QT_VERSION < 0x050000 -Q_IMPORT_PLUGIN(qcncodecs) -Q_IMPORT_PLUGIN(qjpcodecs) -Q_IMPORT_PLUGIN(qtwcodecs) -Q_IMPORT_PLUGIN(qkrcodecs) -Q_IMPORT_PLUGIN(qtaccessiblewidgets) -#else #if QT_VERSION < 0x050400 Q_IMPORT_PLUGIN(AccessibleFactory) #endif @@ -73,11 +65,6 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); #endif #endif -#endif - -#if QT_VERSION < 0x050000 -#include <QTextCodec> -#endif // Declare meta types used for QMetaObject::invokeMethod Q_DECLARE_METATYPE(bool*) @@ -151,16 +138,6 @@ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTrans } /* qDebug() message handler --> debug.log */ -#if QT_VERSION < 0x050000 -void DebugMessageHandler(QtMsgType type, const char *msg) -{ - if (type == QtDebugMsg) { - LogPrint(BCLog::QT, "GUI: %s\n", msg); - } else { - LogPrintf("GUI: %s\n", msg); - } -} -#else void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg) { Q_UNUSED(context); @@ -170,7 +147,6 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons LogPrintf("GUI: %s\n", msg.toStdString()); } } -#endif /** Class encapsulating Bitcoin Core startup and shutdown. * Allows running startup and shutdown in a different thread from the UI thread. @@ -229,11 +205,16 @@ public: /// Get window identifier of QMainWindow (BitcoinGUI) WId getMainWinId() const; + /// Setup platform style + void setupPlatformStyle(); + public Q_SLOTS: void initializeResult(bool success); void shutdownResult(); /// Handle runaway exceptions. Shows a message box with the problem and quits the program. void handleRunawayException(const QString &message); + void addWallet(WalletModel* walletModel); + void removeWallet(); Q_SIGNALS: void requestedInitialize(); @@ -251,6 +232,7 @@ private: #ifdef ENABLE_WALLET PaymentServer* paymentServer; std::vector<WalletModel*> m_wallet_models; + std::unique_ptr<interfaces::Handler> m_handler_load_wallet; #endif int returnValue; const PlatformStyle *platformStyle; @@ -313,10 +295,14 @@ BitcoinApplication::BitcoinApplication(interfaces::Node& node, int &argc, char * paymentServer(0), m_wallet_models(), #endif - returnValue(0) + returnValue(0), + platformStyle(0) { setQuitOnLastWindowClosed(false); +} +void BitcoinApplication::setupPlatformStyle() +{ // UI per-platform customization // This must be done inside the BitcoinApplication constructor, or after it, because // PlatformStyle::instantiate requires a QApplication @@ -447,6 +433,33 @@ void BitcoinApplication::requestShutdown() Q_EMIT requestedShutdown(); } +void BitcoinApplication::addWallet(WalletModel* walletModel) +{ +#ifdef ENABLE_WALLET + window->addWallet(walletModel); + + if (m_wallet_models.empty()) { + window->setCurrentWallet(walletModel->getWalletName()); + } + + connect(walletModel, SIGNAL(coinsSent(WalletModel*, SendCoinsRecipient, QByteArray)), + paymentServer, SLOT(fetchPaymentACK(WalletModel*, const SendCoinsRecipient&, QByteArray))); + connect(walletModel, SIGNAL(unload()), this, SLOT(removeWallet())); + + m_wallet_models.push_back(walletModel); +#endif +} + +void BitcoinApplication::removeWallet() +{ +#ifdef ENABLE_WALLET + WalletModel* walletModel = static_cast<WalletModel*>(sender()); + m_wallet_models.erase(std::find(m_wallet_models.begin(), m_wallet_models.end(), walletModel)); + window->removeWallet(walletModel); + walletModel->deleteLater(); +#endif +} + void BitcoinApplication::initializeResult(bool success) { qDebug() << __func__ << ": Initialization result: " << success; @@ -465,21 +478,15 @@ void BitcoinApplication::initializeResult(bool success) window->setClientModel(clientModel); #ifdef ENABLE_WALLET - bool fFirstWallet = true; - auto wallets = m_node.getWallets(); - for (auto& wallet : wallets) { - WalletModel * const walletModel = new WalletModel(std::move(wallet), m_node, platformStyle, optionsModel); - - window->addWallet(walletModel); - if (fFirstWallet) { - window->setCurrentWallet(walletModel->getWalletName()); - fFirstWallet = false; - } - - connect(walletModel, SIGNAL(coinsSent(WalletModel*,SendCoinsRecipient,QByteArray)), - paymentServer, SLOT(fetchPaymentACK(WalletModel*,const SendCoinsRecipient&,QByteArray))); - - m_wallet_models.push_back(walletModel); + m_handler_load_wallet = m_node.handleLoadWallet([this](std::unique_ptr<interfaces::Wallet> wallet) { + WalletModel* wallet_model = new WalletModel(std::move(wallet), m_node, platformStyle, optionsModel, nullptr); + // Fix wallet model thread affinity. + wallet_model->moveToThread(thread()); + QMetaObject::invokeMethod(this, "addWallet", Qt::QueuedConnection, Q_ARG(WalletModel*, wallet_model)); + }); + + for (auto& wallet : m_node.getWallets()) { + addWallet(new WalletModel(std::move(wallet), m_node, platformStyle, optionsModel)); } #endif @@ -531,6 +538,20 @@ WId BitcoinApplication::getMainWinId() const return window->winId(); } +static void SetupUIArgs() +{ +#ifdef ENABLE_WALLET + gArgs.AddArg("-allowselfsignedrootcertificates", strprintf("Allow self signed root certificates (default: %u)", DEFAULT_SELFSIGNED_ROOTCERTS), true, OptionsCategory::GUI); +#endif + gArgs.AddArg("-choosedatadir", strprintf("Choose data directory on startup (default: %u)", DEFAULT_CHOOSE_DATADIR), false, OptionsCategory::GUI); + gArgs.AddArg("-lang=<lang>", "Set language, for example \"de_DE\" (default: system locale)", false, OptionsCategory::GUI); + gArgs.AddArg("-min", "Start minimized", false, OptionsCategory::GUI); + gArgs.AddArg("-resetguisettings", "Reset all settings changed in the GUI", false, OptionsCategory::GUI); + gArgs.AddArg("-rootcertificates=<file>", "Set SSL root certificates for payment request (default: -system-)", false, OptionsCategory::GUI); + gArgs.AddArg("-splash", strprintf("Show splash screen on startup (default: %u)", DEFAULT_SPLASHSCREEN), false, OptionsCategory::GUI); + 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 main(int argc, char *argv[]) { @@ -538,19 +559,9 @@ int main(int argc, char *argv[]) std::unique_ptr<interfaces::Node> node = interfaces::MakeNode(); - /// 1. Parse command-line options. These take precedence over anything else. - // Command-line options take precedence: - node->parseParameters(argc, argv); - // Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory - /// 2. Basic Qt initialization (not dependent on parameters or configuration) -#if QT_VERSION < 0x050000 - // Internal string conversion is all UTF-8 - QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); - QTextCodec::setCodecForCStrings(QTextCodec::codecForTr()); -#endif - + /// 1. Basic Qt initialization (not dependent on parameters or configuration) Q_INIT_RESOURCE(bitcoin); Q_INIT_RESOURCE(bitcoin_locale); @@ -579,6 +590,23 @@ int main(int argc, char *argv[]) // IMPORTANT if it is no longer a typedef use the normal variant above qRegisterMetaType< CAmount >("CAmount"); qRegisterMetaType< std::function<void(void)> >("std::function<void(void)>"); +#ifdef ENABLE_WALLET + qRegisterMetaType<WalletModel*>("WalletModel*"); +#endif + + /// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these + // Command-line options take precedence: + node->setupServerArgs(); + SetupUIArgs(); + std::string error; + if (!node->parseParameters(argc, argv, error)) { + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), + QObject::tr("Error parsing command line arguments: %1.").arg(QString::fromStdString(error))); + return EXIT_FAILURE; + } + + // Now that the QApplication is setup and we have parsed our parameters, we can set the platform style + app.setupPlatformStyle(); /// 3. Application identification // must be set before OptionsModel is initialized or translations are loaded, @@ -586,7 +614,6 @@ int main(int argc, char *argv[]) QApplication::setOrganizationName(QAPP_ORG_NAME); QApplication::setOrganizationDomain(QAPP_ORG_DOMAIN); QApplication::setApplicationName(QAPP_APP_NAME_DEFAULT); - GUIUtil::SubstituteFonts(GetLangTerritory()); /// 4. Initialization of translations, so that intro dialog is in user's language // Now that QSettings are accessible, initialize translations @@ -615,11 +642,9 @@ int main(int argc, char *argv[]) QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(gArgs.GetArg("-datadir", "")))); return EXIT_FAILURE; } - try { - node->readConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME)); - } catch (const std::exception& e) { + if (!node->readConfigFiles(error)) { QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), - QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what())); + QObject::tr("Error: Cannot parse configuration file: %1.").arg(QString::fromStdString(error))); return EXIT_FAILURE; } @@ -666,17 +691,12 @@ int main(int argc, char *argv[]) /// 9. Main GUI initialization // Install global event filter that makes sure that long tooltips can be word-wrapped app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app)); -#if QT_VERSION < 0x050000 - // Install qDebug() message handler to route to debug.log - qInstallMsgHandler(DebugMessageHandler); -#else #if defined(Q_OS_WIN) // Install global event filter for processing Windows session related Windows messages (WM_QUERYENDSESSION and WM_ENDSESSION) qApp->installNativeEventFilter(new WinShutdownMonitor()); #endif // Install qDebug() message handler to route to debug.log qInstallMessageHandler(DebugMessageHandler); -#endif // Allow parameter interaction before we create the options model app.parameterSetup(); // Load GUI settings from QSettings @@ -697,7 +717,7 @@ int main(int argc, char *argv[]) // so the GUI thread won't be held up. if (node->baseInitialize()) { app.requestInitialize(); -#if defined(Q_OS_WIN) && QT_VERSION >= 0x050000 +#if defined(Q_OS_WIN) WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("%1 didn't yet exit safely...").arg(QObject::tr(PACKAGE_NAME)), (HWND)app.getMainWinId()); #endif app.exec(); diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index 451d391237..fddc2a5685 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -53,6 +53,7 @@ <file alias="hd_enabled">res/icons/hd_enabled.png</file> <file alias="hd_disabled">res/icons/hd_disabled.png</file> <file alias="network_disabled">res/icons/network_disabled.png</file> + <file alias="proxy">res/icons/proxy.png</file> </qresource> <qresource prefix="/movies"> <file alias="spinner-000">res/movies/spinner-000.png</file> diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index e8307ff125..68a9dc4c27 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -197,7 +197,7 @@ BitcoinAmountField::BitcoinAmountField(QWidget *parent) : amount = new AmountSpinBox(this); amount->setLocale(QLocale::c()); amount->installEventFilter(this); - amount->setMaximumWidth(170); + amount->setMaximumWidth(240); QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(amount); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index aed5374a7d..c8f8b9c7d3 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -29,7 +29,6 @@ #endif #include <chainparams.h> -#include <init.h> #include <interfaces/handler.h> #include <interfaces/node.h> #include <ui_interface.h> @@ -55,14 +54,8 @@ #include <QStyle> #include <QTimer> #include <QToolBar> -#include <QVBoxLayout> - -#if QT_VERSION < 0x050000 -#include <QTextDocument> -#include <QUrl> -#else #include <QUrlQuery> -#endif +#include <QVBoxLayout> const std::string BitcoinGUI::DEFAULT_UIPLATFORM = #if defined(Q_OS_MAC) @@ -76,49 +69,7 @@ const std::string BitcoinGUI::DEFAULT_UIPLATFORM = BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformStyle, const NetworkStyle *networkStyle, QWidget *parent) : QMainWindow(parent), - enableWallet(false), m_node(node), - clientModel(0), - walletFrame(0), - unitDisplayControl(0), - labelWalletEncryptionIcon(0), - labelWalletHDStatusIcon(0), - connectionsControl(0), - labelBlocksIcon(0), - progressBarLabel(0), - progressBar(0), - progressDialog(0), - appMenuBar(0), - appToolBar(0), - overviewAction(0), - historyAction(0), - quitAction(0), - sendCoinsAction(0), - sendCoinsMenuAction(0), - usedSendingAddressesAction(0), - usedReceivingAddressesAction(0), - signMessageAction(0), - verifyMessageAction(0), - aboutAction(0), - receiveCoinsAction(0), - receiveCoinsMenuAction(0), - optionsAction(0), - toggleHideAction(0), - encryptWalletAction(0), - backupWalletAction(0), - changePassphraseAction(0), - aboutQtAction(0), - openRPCConsoleAction(0), - openAction(0), - showHelpMessageAction(0), - trayIcon(0), - trayIconMenu(0), - notificator(0), - rpcConsole(0), - helpMessageDialog(0), - modalOverlay(0), - prevBlocks(0), - spinnerFrame(0), platformStyle(_platformStyle) { QSettings settings; @@ -146,12 +97,6 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty #endif setWindowTitle(windowTitle); -#if defined(Q_OS_MAC) && QT_VERSION < 0x050000 - // This property is not implemented in Qt 5. Setting it has no effect. - // A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras. - setUnifiedTitleAndToolBarOnMac(true); -#endif - rpcConsole = new RPCConsole(node, _platformStyle, 0); helpMessageDialog = new HelpMessageDialog(node, this, false); #ifdef ENABLE_WALLET @@ -201,6 +146,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty unitDisplayControl = new UnitDisplayStatusBarControl(platformStyle); labelWalletEncryptionIcon = new QLabel(); labelWalletHDStatusIcon = new QLabel(); + labelProxyIcon = new QLabel(); connectionsControl = new GUIUtil::ClickableLabel(); labelBlocksIcon = new GUIUtil::ClickableLabel(); if(enableWallet) @@ -211,6 +157,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty frameBlocksLayout->addWidget(labelWalletEncryptionIcon); frameBlocksLayout->addWidget(labelWalletHDStatusIcon); } + frameBlocksLayout->addWidget(labelProxyIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(connectionsControl); frameBlocksLayout->addStretch(); @@ -226,7 +173,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) - // See https://qt-project.org/doc/qt-4.8/gallery.html + // See https://doc.qt.io/qt-5/gallery.html QString curStyle = QApplication::style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { @@ -473,7 +420,17 @@ void BitcoinGUI::createToolBars() toolbar->addWidget(spacer); m_wallet_selector = new QComboBox(); - connect(m_wallet_selector, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(setCurrentWallet(const QString&))); + connect(m_wallet_selector, SIGNAL(currentIndexChanged(int)), this, SLOT(setCurrentWalletBySelectorIndex(int))); + + m_wallet_selector_label = new QLabel(); + m_wallet_selector_label->setText(tr("Wallet:") + " "); + m_wallet_selector_label->setBuddy(m_wallet_selector); + + m_wallet_selector_label_action = appToolBar->addWidget(m_wallet_selector_label); + m_wallet_selector_action = appToolBar->addWidget(m_wallet_selector); + + m_wallet_selector_label_action->setVisible(false); + m_wallet_selector_action->setVisible(false); #endif } } @@ -503,6 +460,9 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel) connect(_clientModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int))); rpcConsole->setClientModel(_clientModel); + + updateProxyIcon(); + #ifdef ENABLE_WALLET if(walletFrame) { @@ -510,13 +470,13 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel) } #endif // ENABLE_WALLET unitDisplayControl->setOptionsModel(_clientModel->getOptionsModel()); - + OptionsModel* optionsModel = _clientModel->getOptionsModel(); if(optionsModel) { // be aware of the tray icon disable state change reported by the OptionsModel object. connect(optionsModel,SIGNAL(hideTrayIconChanged(bool)),this,SLOT(setTrayIconVisible(bool))); - + // initialize the disable state of the tray icon with the current value in the model. setTrayIconVisible(optionsModel->getHideTrayIcon()); } @@ -546,19 +506,33 @@ bool BitcoinGUI::addWallet(WalletModel *walletModel) if(!walletFrame) return false; const QString name = walletModel->getWalletName(); + QString display_name = name.isEmpty() ? "["+tr("default wallet")+"]" : name; setWalletActionsEnabled(true); - m_wallet_selector->addItem(name); + m_wallet_selector->addItem(display_name, name); if (m_wallet_selector->count() == 2) { - m_wallet_selector_label = new QLabel(); - m_wallet_selector_label->setText(tr("Wallet:") + " "); - m_wallet_selector_label->setBuddy(m_wallet_selector); - appToolBar->addWidget(m_wallet_selector_label); - appToolBar->addWidget(m_wallet_selector); + m_wallet_selector_label_action->setVisible(true); + m_wallet_selector_action->setVisible(true); } rpcConsole->addWallet(walletModel); return walletFrame->addWallet(walletModel); } +bool BitcoinGUI::removeWallet(WalletModel* walletModel) +{ + if (!walletFrame) return false; + QString name = walletModel->getWalletName(); + int index = m_wallet_selector->findData(name); + m_wallet_selector->removeItem(index); + if (m_wallet_selector->count() == 0) { + setWalletActionsEnabled(false); + } else if (m_wallet_selector->count() == 1) { + m_wallet_selector_label_action->setVisible(false); + m_wallet_selector_action->setVisible(false); + } + rpcConsole->removeWallet(walletModel); + return walletFrame->removeWallet(name); +} + bool BitcoinGUI::setCurrentWallet(const QString& name) { if(!walletFrame) @@ -566,6 +540,12 @@ bool BitcoinGUI::setCurrentWallet(const QString& name) return walletFrame->setCurrentWallet(name); } +bool BitcoinGUI::setCurrentWalletBySelectorIndex(int index) +{ + QString internal_name = m_wallet_selector->itemData(index).toString(); + return setCurrentWallet(internal_name); +} + void BitcoinGUI::removeAllWallets() { if(!walletFrame) @@ -1077,7 +1057,7 @@ void BitcoinGUI::setHDStatus(int hdEnabled) labelWalletHDStatusIcon->setPixmap(platformStyle->SingleColorIcon(hdEnabled ? ":/icons/hd_enabled" : ":/icons/hd_disabled").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE)); labelWalletHDStatusIcon->setToolTip(hdEnabled ? tr("HD key generation is <b>enabled</b>") : tr("HD key generation is <b>disabled</b>")); - // eventually disable the QLabel to set its opacity to 50% + // eventually disable the QLabel to set its opacity to 50% labelWalletHDStatusIcon->setEnabled(hdEnabled); } @@ -1125,6 +1105,24 @@ void BitcoinGUI::updateWalletStatus() } #endif // ENABLE_WALLET +void BitcoinGUI::updateProxyIcon() +{ + std::string ip_port; + bool proxy_enabled = clientModel->getProxyInfo(ip_port); + + if (proxy_enabled) { + if (labelProxyIcon->pixmap() == 0) { + QString ip_port_q = QString::fromStdString(ip_port); + labelProxyIcon->setPixmap(platformStyle->SingleColorIcon(":/icons/proxy").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); + labelProxyIcon->setToolTip(tr("Proxy is <b>enabled</b>: %1").arg(ip_port_q)); + } else { + labelProxyIcon->show(); + } + } else { + labelProxyIcon->hide(); + } +} + void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden) { if(!clientModel) diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index e59c71cd4f..d7ca8081d1 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -70,9 +70,10 @@ public: functionality. */ bool addWallet(WalletModel *walletModel); + bool removeWallet(WalletModel* walletModel); void removeAllWallets(); #endif // ENABLE_WALLET - bool enableWallet; + bool enableWallet = false; protected: void changeEvent(QEvent *e); @@ -86,55 +87,58 @@ private: interfaces::Node& m_node; std::unique_ptr<interfaces::Handler> m_handler_message_box; std::unique_ptr<interfaces::Handler> m_handler_question; - ClientModel *clientModel; - WalletFrame *walletFrame; - - UnitDisplayStatusBarControl *unitDisplayControl; - QLabel *labelWalletEncryptionIcon; - QLabel *labelWalletHDStatusIcon; - QLabel *connectionsControl; - QLabel *labelBlocksIcon; - QLabel *progressBarLabel; - QProgressBar *progressBar; - QProgressDialog *progressDialog; - - QMenuBar *appMenuBar; - QToolBar *appToolBar; - QAction *overviewAction; - QAction *historyAction; - QAction *quitAction; - QAction *sendCoinsAction; - QAction *sendCoinsMenuAction; - QAction *usedSendingAddressesAction; - QAction *usedReceivingAddressesAction; - QAction *signMessageAction; - QAction *verifyMessageAction; - QAction *aboutAction; - QAction *receiveCoinsAction; - QAction *receiveCoinsMenuAction; - QAction *optionsAction; - QAction *toggleHideAction; - QAction *encryptWalletAction; - QAction *backupWalletAction; - QAction *changePassphraseAction; - QAction *aboutQtAction; - QAction *openRPCConsoleAction; - QAction *openAction; - QAction *showHelpMessageAction; - - QLabel *m_wallet_selector_label; - QComboBox *m_wallet_selector; - - QSystemTrayIcon *trayIcon; - QMenu *trayIconMenu; - Notificator *notificator; - RPCConsole *rpcConsole; - HelpMessageDialog *helpMessageDialog; - ModalOverlay *modalOverlay; + ClientModel* clientModel = nullptr; + WalletFrame* walletFrame = nullptr; + + UnitDisplayStatusBarControl* unitDisplayControl = nullptr; + QLabel* labelWalletEncryptionIcon = nullptr; + QLabel* labelWalletHDStatusIcon = nullptr; + QLabel* labelProxyIcon = nullptr; + QLabel* connectionsControl = nullptr; + QLabel* labelBlocksIcon = nullptr; + QLabel* progressBarLabel = nullptr; + QProgressBar* progressBar = nullptr; + QProgressDialog* progressDialog = nullptr; + + QMenuBar* appMenuBar = nullptr; + QToolBar* appToolBar = nullptr; + QAction* overviewAction = nullptr; + QAction* historyAction = nullptr; + QAction* quitAction = nullptr; + QAction* sendCoinsAction = nullptr; + QAction* sendCoinsMenuAction = nullptr; + QAction* usedSendingAddressesAction = nullptr; + QAction* usedReceivingAddressesAction = nullptr; + QAction* signMessageAction = nullptr; + QAction* verifyMessageAction = nullptr; + QAction* aboutAction = nullptr; + QAction* receiveCoinsAction = nullptr; + QAction* receiveCoinsMenuAction = nullptr; + QAction* optionsAction = nullptr; + QAction* toggleHideAction = nullptr; + QAction* encryptWalletAction = nullptr; + QAction* backupWalletAction = nullptr; + QAction* changePassphraseAction = nullptr; + QAction* aboutQtAction = nullptr; + QAction* openRPCConsoleAction = nullptr; + QAction* openAction = nullptr; + QAction* showHelpMessageAction = nullptr; + QAction* m_wallet_selector_label_action = nullptr; + QAction* m_wallet_selector_action = nullptr; + + QLabel *m_wallet_selector_label = nullptr; + QComboBox* m_wallet_selector = nullptr; + + QSystemTrayIcon* trayIcon = nullptr; + QMenu* trayIconMenu = nullptr; + Notificator* notificator = nullptr; + RPCConsole* rpcConsole = nullptr; + HelpMessageDialog* helpMessageDialog = nullptr; + ModalOverlay* modalOverlay = nullptr; /** Keep track of previous number of blocks, to detect progress */ - int prevBlocks; - int spinnerFrame; + int prevBlocks = 0; + int spinnerFrame = 0; const PlatformStyle *platformStyle; @@ -185,6 +189,7 @@ public Q_SLOTS: #ifdef ENABLE_WALLET bool setCurrentWallet(const QString& name); + bool setCurrentWalletBySelectorIndex(int index); /** Set the UI status indicators based on the currently selected wallet. */ void updateWalletStatus(); @@ -209,6 +214,10 @@ public Q_SLOTS: void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label, const QString& walletName); #endif // ENABLE_WALLET +private: + /** Set the proxy-enabled icon as shown in the UI. */ + void updateProxyIcon(); + private Q_SLOTS: #ifdef ENABLE_WALLET /** Switch to overview (home) page */ @@ -248,12 +257,12 @@ private Q_SLOTS: /** Simply calls showNormalIfMinimized(true) for use in SLOT() macro */ void toggleHidden(); - /** called by a timer to check if fRequestShutdown has been set **/ + /** called by a timer to check if ShutdownRequested() has been set **/ void detectShutdown(); /** Show progress dialog e.g. for verifychain */ void showProgress(const QString &title, int nProgress); - + /** When hideTrayIcon setting is changed in OptionsModel hide or show the icon accordingly. */ void setTrayIconVisible(bool); diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index adf001c968..ab7e56a9da 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -12,128 +12,37 @@ 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", "" -"(1 = keep tx meta data e.g. account owner and payment request information, 2 " -"= drop tx meta data)"), -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", "" -"A fee rate (in %s/kB) that will be used when fee estimation has insufficient " -"data (default: %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Accept relayed transactions received from whitelisted peers even when not " -"relaying transactions (default: %d)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Add a node to connect to and attempt to keep the connection open (see the " -"`addnode` RPC command help for more info)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Allow JSON-RPC connections from specified source. Valid for <ip> are a " -"single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or " -"a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Bind to given address and always listen on it. Use [host]:port notation for " -"IPv6"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Bind to given address and whitelist peers connecting to it. Use [host]:port " -"notation for IPv6"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Bind to given address to listen for JSON-RPC connections. This option is " -"ignored unless -rpcallowip is also passed. Port is optional and overrides -" -"rpcport. Use [host]:port notation for IPv6. This option can be specified " -"multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -" -"rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)"), +"Can't generate a change-address key. Private keys are disabled for this " +"wallet."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Cannot obtain a lock on data directory %s. %s is probably already running."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Cannot provide specific connections and have addrman find outgoing " "connections at the same."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Connect only to the specified node(s); -connect=0 disables automatic " -"connections (the rules for this peer are the same as for -addnode)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Create new files with system default permissions, instead of umask 077 (only " -"effective with disabled wallet functionality)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Delete all wallet transactions and only recover those parts of the " -"blockchain through -rescan on startup"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Discover own IP addresses (default: 1 when listening and no -externalip or -" -"proxy)"), +"Cannot upgrade a non HD split wallet without upgrading to support pre split " +"keypool. Please use -upgradewallet=169900 or -upgradewallet with no version " +"specified."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Distributed under the MIT software license, see the accompanying file %s or " "%s"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Do not keep transactions in the mempool longer than <n> hours (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Equivalent bytes per sigop in transactions for relay and mining (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" "Error loading %s: You can't enable HD on an already existing non-HD wallet"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Error loading wallet %s. -wallet parameter must only specify a filename (not " -"a path)."), -QT_TRANSLATE_NOOP("bitcoin-core", "" "Error reading %s! All keys read correctly, but transaction data or address " "book entries might be missing or incorrect."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Error: Listening for incoming connections failed (listen returned error %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Exclude debugging information for a category. Can be used in conjunction " -"with -debug=1 to output debug logs for all categories except one or more " -"specified categories."), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Execute command when a relevant alert is received or we see a really long " -"fork (%s in cmd is replaced by message)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Execute command when a wallet transaction changes (%s in cmd is replaced by " -"TxID)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Execute command when the best block changes (%s in cmd is replaced by block " -"hash)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Extra transactions to keep in memory for compact block reconstructions " -"(default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Fees (in %s/kB) smaller than this are considered zero fee for relaying, " -"mining and transaction creation (default: %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Fees (in %s/kB) smaller than this are considered zero fee for transaction " -"creation (default: %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Force relay of transactions from whitelisted peers even if they violate " -"local relay policy (default: %d)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"How thorough the block verification of -checkblocks is (0-4, default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"If <category> is not supplied or if <category> = 1, output all debugging " -"information."), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"If paytxfee is not set, include enough fee so transactions begin " -"confirmation on average within n blocks (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"If this block is in the chain assume that it and its ancestors are valid and " -"potentially skip their script verification (0 to verify all, default: %s, " -"testnet: %s)"), +"Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -" +"fallbackfee."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay " "fee of %s to prevent stuck transactions)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Maintain a full transaction index, used by the getrawtransaction rpc call " -"(default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Maximum allowed median peer time offset adjustment. Local perspective of " -"time may be influenced by peers forward or backward by this amount. " -"(default: %u seconds)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Maximum size of data in data carrier transactions we relay and mine " -"(default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Maximum total fees (in %s) to use in a single wallet transaction or raw " -"transaction; setting this too low may abort large transactions (default: %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Number of seconds to keep misbehaving peers from reconnecting (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Output debugging information (default: %u, supplying <category> is optional)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" "Please check that your computer's date and time are correct! If your clock " "is wrong, %s will not work properly."), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -145,53 +54,14 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Prune: last wallet synchronisation goes beyond pruned data. You need to -" "reindex (download the whole blockchain again in case of pruned node)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Query for peer addresses via DNS lookup, if low on addresses (default: 1 " -"unless -connect used)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Randomize credentials for every proxy connection. This enables Tor stream " -"isolation (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Reduce storage requirements by enabling pruning (deleting) of old blocks. " -"This allows the pruneblockchain RPC to be called to delete specific blocks, " -"and enables automatic pruning of old blocks if a target size in MiB is " -"provided. This mode is incompatible with -txindex and -rescan. Warning: " -"Reverting this setting requires re-downloading the entire blockchain. " -"(default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >%u " -"= automatically prune block files to stay under the specified target size in " -"MiB)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" "Rescans are not possible in pruned mode. You will need to use -reindex which " "will download the whole blockchain again."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Set lowest fee rate (in %s/kB) for transactions to be included in block " -"creation. (default: %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Set maximum BIP141 block weight to this * 4. Deprecated, use blockmaxweight"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Set the number of script verification threads (%u to %d, 0 = auto, <0 = " -"leave that many cores free, default: %d)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Sets the serialization of raw transaction or block hex returned in non-" -"verbose mode, non-segwit(0) or segwit(1) (default: %d)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Specify directory to hold wallets (default: <datadir>/wallets if it exists, " -"otherwise <datadir>)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Specify location of debug log file: this can be an absolute path or a path " -"relative to the data directory (default: %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Support filtering of blocks and transaction with bloom filters (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" "The block database contains a block which appears to be from the future. " "This may be due to your computer's date and time being set incorrectly. Only " "rebuild the block database if you are sure that your computer's date and " "time are correct"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"The fee rate (in %s/kB) that indicates your tolerance for discarding change " -"by adding it to the fee (default: %s). Note: An output is discarded if it is " -"dust at this rate, but we will always discard up to the dust relay fee and a " -"discard fee above that is limited by the fee estimate for the longest target"), -QT_TRANSLATE_NOOP("bitcoin-core", "" "The transaction amount is too small to send after the fee has been deducted"), QT_TRANSLATE_NOOP("bitcoin-core", "" "This is a pre-release test build - use at your own risk - do not use for " @@ -209,9 +79,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Total length of network version string (%i) exceeds maximum length (%i). " "Reduce the number or size of uacomments."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = " -"no limit (default: %d)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" "Unable to replay blocks. You will need to rebuild the database using -" "reindex-chainstate."), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -224,19 +91,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/" "or -whitelistforcerelay."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Use UPnP to map the listening port (default: 1 when listening and no -proxy)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: " -"%s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Username and hashed password for JSON-RPC connections. The field <userpw> " -"comes in the format: <USERNAME>:<SALT>$<HASH>. A canonical python script is " -"included in share/rpcuser. The client then connects normally using the " -"rpcuser=<USERNAME>/rpcpassword=<PASSWORD> pair of arguments. This option can " -"be specified multiple times"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Wallet will not create transactions that violate mempool chain limits " -"(default: %u)"), +"Warning: Private keys detected in wallet {%s} with disabled private keys"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: The network does not appear to fully agree! Some miners appear to " "be experiencing issues."), @@ -251,61 +106,30 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: We do not appear to fully agree with our peers! You may need to " "upgrade, or other nodes may need to upgrade."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Whether to save the mempool on shutdown and load on restart (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR " -"notated network (e.g. 1.2.3.0/24). Can be specified multiple times."), -QT_TRANSLATE_NOOP("bitcoin-core", "" -"Whitelisted peers cannot be DoS banned and their transactions are always " -"relayed, even if they are already in the mempool, useful e.g. for a gateway"), -QT_TRANSLATE_NOOP("bitcoin-core", "" "You need to rebuild the database using -reindex to go back to unpruned " "mode. This will redownload the entire blockchain"), QT_TRANSLATE_NOOP("bitcoin-core", "%d of last 100 blocks have unexpected version"), QT_TRANSLATE_NOOP("bitcoin-core", "%s corrupt, salvage failed"), QT_TRANSLATE_NOOP("bitcoin-core", "%s is set very high!"), -QT_TRANSLATE_NOOP("bitcoin-core", "(default: %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "(default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "-maxmempool must be at least %d MB"), -QT_TRANSLATE_NOOP("bitcoin-core", "<category> can be:"), -QT_TRANSLATE_NOOP("bitcoin-core", "Accept command line and JSON-RPC commands"), -QT_TRANSLATE_NOOP("bitcoin-core", "Accept connections from outside (default: 1 if no -proxy or -connect)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Accept public REST requests (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"), -QT_TRANSLATE_NOOP("bitcoin-core", "Always query for peer addresses via DNS lookup (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Append comment to the user agent string"), -QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to recover private keys from a corrupt wallet on startup"), -QT_TRANSLATE_NOOP("bitcoin-core", "Automatically create Tor hidden service (default: %d)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Block creation options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -%s address: '%s'"), -QT_TRANSLATE_NOOP("bitcoin-core", "Chain selection options:"), +QT_TRANSLATE_NOOP("bitcoin-core", "Cannot write to data directory '%s'; check permissions."), QT_TRANSLATE_NOOP("bitcoin-core", "Change index out of range"), -QT_TRANSLATE_NOOP("bitcoin-core", "Connect through SOCKS5 proxy"), -QT_TRANSLATE_NOOP("bitcoin-core", "Connect to a node to retrieve peer addresses, and disconnect"), -QT_TRANSLATE_NOOP("bitcoin-core", "Connection options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Copyright (C) %i-%i"), QT_TRANSLATE_NOOP("bitcoin-core", "Corrupted block database detected"), -QT_TRANSLATE_NOOP("bitcoin-core", "Debugging/Testing options:"), -QT_TRANSLATE_NOOP("bitcoin-core", "Do not load the wallet and disable wallet RPC calls"), QT_TRANSLATE_NOOP("bitcoin-core", "Do you want to rebuild the block database now?"), QT_TRANSLATE_NOOP("bitcoin-core", "Done loading"), -QT_TRANSLATE_NOOP("bitcoin-core", "Enable publish hash block in <address>"), -QT_TRANSLATE_NOOP("bitcoin-core", "Enable publish hash transaction in <address>"), -QT_TRANSLATE_NOOP("bitcoin-core", "Enable publish raw block in <address>"), -QT_TRANSLATE_NOOP("bitcoin-core", "Enable publish raw transaction in <address>"), -QT_TRANSLATE_NOOP("bitcoin-core", "Enable transaction replacement in the memory pool (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Error creating %s: You can't create non-HD wallets with this version."), QT_TRANSLATE_NOOP("bitcoin-core", "Error initializing block database"), QT_TRANSLATE_NOOP("bitcoin-core", "Error initializing wallet database environment %s!"), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading %s"), +QT_TRANSLATE_NOOP("bitcoin-core", "Error loading %s: Private keys can only be disabled during creation"), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading %s: Wallet corrupted"), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading %s: Wallet requires newer version of %s"), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading %s: You can't disable HD on an already existing HD wallet"), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading block database"), -QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet %s. -wallet filename must be a regular file."), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet %s. Duplicate -wallet filename specified."), -QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet %s. Invalid characters in -wallet filename."), 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"), @@ -314,11 +138,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Error: A fatal internal error occurred, see d QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is 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", "Fee (in %s/kB) to add to transactions you send (default: %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: %u, 0 = all)"), QT_TRANSLATE_NOOP("bitcoin-core", "Importing..."), -QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000??.dat file on startup"), -QT_TRANSLATE_NOOP("bitcoin-core", "Include IP addresses in debug output (default: %u)"), 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."), @@ -330,62 +150,25 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -discardfee=<amount>: '%s' QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -fallbackfee=<amount>: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid netmask specified in -whitelist: '%s'"), -QT_TRANSLATE_NOOP("bitcoin-core", "Keep at most <n> unconnectable transactions in memory (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Keep the transaction memory pool below <n> megabytes (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Keypool ran out, please call keypoolrefill first"), -QT_TRANSLATE_NOOP("bitcoin-core", "Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Listen for connections on <port> (default: %u or testnet: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Loading P2P addresses..."), QT_TRANSLATE_NOOP("bitcoin-core", "Loading banlist..."), QT_TRANSLATE_NOOP("bitcoin-core", "Loading block index..."), QT_TRANSLATE_NOOP("bitcoin-core", "Loading wallet..."), -QT_TRANSLATE_NOOP("bitcoin-core", "Location of the auth cookie (default: data dir)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Maintain at most <n> connections to peers (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Make the wallet broadcast transactions"), -QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection send buffer, <n>*1000 bytes (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Need to specify a port with -whitebind: '%s'"), -QT_TRANSLATE_NOOP("bitcoin-core", "Node relay options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Not enough file descriptors available."), -QT_TRANSLATE_NOOP("bitcoin-core", "Only connect to nodes in network <net> (ipv4, ipv6 or onion)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Options:"), -QT_TRANSLATE_NOOP("bitcoin-core", "Password for JSON-RPC connections"), -QT_TRANSLATE_NOOP("bitcoin-core", "Prepend debug output with timestamp (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Print this help message and exit"), -QT_TRANSLATE_NOOP("bitcoin-core", "Print version and exit"), QT_TRANSLATE_NOOP("bitcoin-core", "Prune cannot be configured with a negative value."), QT_TRANSLATE_NOOP("bitcoin-core", "Prune mode is incompatible with -txindex."), QT_TRANSLATE_NOOP("bitcoin-core", "Pruning blockstore..."), -QT_TRANSLATE_NOOP("bitcoin-core", "RPC server options:"), -QT_TRANSLATE_NOOP("bitcoin-core", "Rebuild chain state and block index from the blk*.dat files on disk"), -QT_TRANSLATE_NOOP("bitcoin-core", "Rebuild chain state from the currently indexed blocks"), QT_TRANSLATE_NOOP("bitcoin-core", "Reducing -maxconnections from %d to %d, because of system limitations."), -QT_TRANSLATE_NOOP("bitcoin-core", "Relay and mine data carrier transactions (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Relay non-P2SH multisig (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Replaying blocks..."), -QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions on startup"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."), QT_TRANSLATE_NOOP("bitcoin-core", "Rewinding blocks..."), -QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"), -QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"), -QT_TRANSLATE_NOOP("bitcoin-core", "Send transactions with full-RBF opt-in enabled (RPC only, default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Set database cache size in megabytes (%d to %d, default: %d)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Set key pool size to <n> (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Set maximum BIP141 block weight (default: %d)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Set the number of threads to service RPC calls (default: %d)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Show all debugging options (usage: --help -help-debug)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Shrink debug.log file on client startup (default: 1 when no -debug)"), QT_TRANSLATE_NOOP("bitcoin-core", "Signing transaction failed"), QT_TRANSLATE_NOOP("bitcoin-core", "Specified -walletdir \"%s\" does not exist"), QT_TRANSLATE_NOOP("bitcoin-core", "Specified -walletdir \"%s\" is a relative path"), QT_TRANSLATE_NOOP("bitcoin-core", "Specified -walletdir \"%s\" is not a directory"), -QT_TRANSLATE_NOOP("bitcoin-core", "Specify configuration file (default: %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Specify connection timeout in milliseconds (minimum: 1, default: %d)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Specify data directory"), -QT_TRANSLATE_NOOP("bitcoin-core", "Specify pid file (default: %s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Specify wallet file (within data directory)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"), -QT_TRANSLATE_NOOP("bitcoin-core", "Spend unconfirmed change when sending transactions (default: %u)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Specified blocks directory \"%s\" does not exist.\n"), QT_TRANSLATE_NOOP("bitcoin-core", "Starting network threads..."), QT_TRANSLATE_NOOP("bitcoin-core", "The source code is available from %s."), QT_TRANSLATE_NOOP("bitcoin-core", "The transaction amount is too small to pay the fee"), @@ -393,9 +176,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "The wallet will avoid paying less than the mi QT_TRANSLATE_NOOP("bitcoin-core", "This is experimental software."), QT_TRANSLATE_NOOP("bitcoin-core", "This is the minimum transaction fee you pay on every transaction."), QT_TRANSLATE_NOOP("bitcoin-core", "This is the transaction fee you will pay if you send a transaction."), -QT_TRANSLATE_NOOP("bitcoin-core", "Threshold for disconnecting misbehaving peers (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Tor control port password (default: empty)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Tor control port to use if onion listening enabled (default: %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amount too small"), QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amounts must not be negative"), QT_TRANSLATE_NOOP("bitcoin-core", "Transaction fee and change calculation failed"), @@ -406,28 +186,21 @@ 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 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 network specified in -onlynet: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Unsupported argument -benchmark ignored, use -debug=bench."), QT_TRANSLATE_NOOP("bitcoin-core", "Unsupported argument -debugnet ignored, use -debug=net."), QT_TRANSLATE_NOOP("bitcoin-core", "Unsupported argument -tor found, use -onion."), QT_TRANSLATE_NOOP("bitcoin-core", "Unsupported logging category %s=%s."), -QT_TRANSLATE_NOOP("bitcoin-core", "Upgrade wallet to latest format on startup"), QT_TRANSLATE_NOOP("bitcoin-core", "Upgrading UTXO database"), -QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Use the test chain"), +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", "Username for JSON-RPC connections"), 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 debugging/testing options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart %s to complete"), -QT_TRANSLATE_NOOP("bitcoin-core", "Wallet options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning: unknown new rules activated (versionbit %i)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Whether to operate in a blocks only mode (default: %u)"), -QT_TRANSLATE_NOOP("bitcoin-core", "You need to rebuild the database using -reindex to change -txindex"), QT_TRANSLATE_NOOP("bitcoin-core", "Zapping all transactions from wallet..."), -QT_TRANSLATE_NOOP("bitcoin-core", "ZeroMQ notification options:"), }; diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 9df05d2a13..30625f419a 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -20,6 +20,7 @@ QList<BitcoinUnits::Unit> BitcoinUnits::availableUnits() unitlist.append(BTC); unitlist.append(mBTC); unitlist.append(uBTC); + unitlist.append(SAT); return unitlist; } @@ -30,6 +31,7 @@ bool BitcoinUnits::valid(int unit) case BTC: case mBTC: case uBTC: + case SAT: return true; default: return false; @@ -43,6 +45,7 @@ QString BitcoinUnits::longName(int unit) case BTC: return QString("BTC"); case mBTC: return QString("mBTC"); case uBTC: return QString::fromUtf8("µBTC (bits)"); + case SAT: return QString("Satoshi (sat)"); default: return QString("???"); } } @@ -52,7 +55,8 @@ QString BitcoinUnits::shortName(int unit) switch(unit) { case uBTC: return QString::fromUtf8("bits"); - default: return longName(unit); + case SAT: return QString("sat"); + default: return longName(unit); } } @@ -63,6 +67,7 @@ QString BitcoinUnits::description(int unit) case BTC: return QString("Bitcoins"); case mBTC: return QString("Milli-Bitcoins (1 / 1" THIN_SP_UTF8 "000)"); case uBTC: return QString("Micro-Bitcoins (bits) (1 / 1" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)"); + case SAT: return QString("Satoshi (sat) (1 / 100" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)"); default: return QString("???"); } } @@ -71,10 +76,11 @@ qint64 BitcoinUnits::factor(int unit) { switch(unit) { - case BTC: return 100000000; + case BTC: return 100000000; case mBTC: return 100000; case uBTC: return 100; - default: return 100000000; + case SAT: return 1; + default: return 100000000; } } @@ -85,6 +91,7 @@ int BitcoinUnits::decimals(int unit) case BTC: return 8; case mBTC: return 5; case uBTC: return 2; + case SAT: return 0; default: return 0; } } @@ -100,9 +107,7 @@ QString BitcoinUnits::format(int unit, const CAmount& nIn, bool fPlus, Separator int num_decimals = decimals(unit); qint64 n_abs = (n > 0 ? n : -n); qint64 quotient = n_abs / coin; - qint64 remainder = n_abs % coin; QString quotient_str = QString::number(quotient); - QString remainder_str = QString::number(remainder).rightJustified(num_decimals, '0'); // Use SI-style thin space separators as these are locale independent and can't be // confused with the decimal marker. @@ -116,7 +121,14 @@ QString BitcoinUnits::format(int unit, const CAmount& nIn, bool fPlus, Separator quotient_str.insert(0, '-'); else if (fPlus && n > 0) quotient_str.insert(0, '+'); - return quotient_str + QString(".") + remainder_str; + + if (num_decimals > 0) { + qint64 remainder = n_abs % coin; + QString remainder_str = QString::number(remainder).rightJustified(num_decimals, '0'); + return quotient_str + QString(".") + remainder_str; + } else { + return quotient_str; + } } diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 310f651815..9b01b4678a 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -58,7 +58,8 @@ public: { BTC, mBTC, - uBTC + uBTC, + SAT }; enum SeparatorStyle diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 37fd06ccc9..8a4a2955f6 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -17,6 +17,7 @@ #include <interfaces/node.h> #include <validation.h> #include <net.h> +#include <netbase.h> #include <txmempool.h> #include <ui_interface.h> #include <util.h> @@ -27,8 +28,6 @@ #include <QDebug> #include <QTimer> -class CBlockIndex; - static int64_t nLastHeaderTipUpdateNotification = 0; static int64_t nLastBlockTipUpdateNotification = 0; @@ -268,3 +267,13 @@ void ClientModel::unsubscribeFromCoreSignals() m_handler_notify_block_tip->disconnect(); m_handler_notify_header_tip->disconnect(); } + +bool ClientModel::getProxyInfo(std::string& ip_port) const +{ + proxyType ipv4, ipv6; + if (m_node.getProxy((Network) 1, ipv4) && m_node.getProxy((Network) 2, ipv6)) { + ip_port = ipv4.proxy.ToStringIPPort(); + return true; + } + return false; +} diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index a609222f7d..9d4fa74b7a 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -70,6 +70,8 @@ public: QString formatClientStartupTime() const; QString dataDir() const; + bool getProxyInfo(std::string& ip_port) const; + // caches for the best header mutable std::atomic<int> cachedBestHeaderHeight; mutable std::atomic<int64_t> cachedBestHeaderTime; diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index b08de27041..9b6480a915 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -109,11 +109,7 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *_platformStyle, QWidge connect(ui->treeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(viewItemChanged(QTreeWidgetItem*, int))); // click on header -#if QT_VERSION < 0x050000 - ui->treeWidget->header()->setClickable(true); -#else ui->treeWidget->header()->setSectionsClickable(true); -#endif connect(ui->treeWidget->header(), SIGNAL(sectionClicked(int)), this, SLOT(headerSectionClicked(int))); // ok button @@ -122,10 +118,6 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *_platformStyle, QWidge // (un)select all connect(ui->pushButtonSelectAll, SIGNAL(clicked()), this, SLOT(buttonSelectAllClicked())); - // change coin control first column label due Qt4 bug. - // see https://github.com/bitcoin/bitcoin/issues/5716 - ui->treeWidget->headerItem()->setText(COLUMN_CHECKBOX, QString()); - ui->treeWidget->setColumnWidth(COLUMN_CHECKBOX, 84); ui->treeWidget->setColumnWidth(COLUMN_AMOUNT, 110); ui->treeWidget->setColumnWidth(COLUMN_LABEL, 190); @@ -392,13 +384,11 @@ void CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column) // TODO: Remove this temporary qt5 fix after Qt5.3 and Qt5.4 are no longer used. // Fixed in Qt5.5 and above: https://bugreports.qt.io/browse/QTBUG-43473 -#if QT_VERSION >= 0x050000 else if (column == COLUMN_CHECKBOX && item->childCount() > 0) { if (item->checkState(COLUMN_CHECKBOX) == Qt::PartiallyChecked && item->child(0)->checkState(COLUMN_CHECKBOX) == Qt::PartiallyChecked) item->setCheckState(COLUMN_CHECKBOX, Qt::Checked); } -#endif } // shows count of locked unspent outputs diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index a3721991ee..8f34e6bc82 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -38,6 +38,69 @@ </widget> </item> <item> + <spacer name="horizontalSpacer_0_Main"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>5</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_Main_Prune"> + <item> + <widget class="QCheckBox" name="prune"> + <property name="toolTip"> + <string>Disables some advanced features but all blocks will still be fully validated. Reverting this setting requires re-downloading the entire blockchain. Actual disk usage may be somewhat higher.</string> + </property> + <property name="text"> + <string>Prune &block storage to</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="pruneSize"/> + </item> + <item> + <widget class="QLabel" name="pruneSizeUnitLabel"> + <property name="text"> + <string>GB</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_Main_Prune"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="pruneWarning"> + <property name="text"> + <string>Reverting this setting requires re-downloading the entire blockchain.</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + </widget> + </item> + <item> <layout class="QHBoxLayout" name="horizontalLayout_2_Main"> <item> <widget class="QLabel" name="databaseCacheLabel"> @@ -81,7 +144,7 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_3_Main"> + <layout class="QHBoxLayout" name="horizontalLayout_Main_VerifyLabel"> <item> <widget class="QLabel" name="threadsScriptVerifLabel"> <property name="text"> @@ -103,7 +166,7 @@ </widget> </item> <item> - <spacer name="horizontalSpacer_3_Main"> + <spacer name="horizontalSpacer_Main_Threads"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> diff --git a/src/qt/forms/receivecoinsdialog.ui b/src/qt/forms/receivecoinsdialog.ui index 09fb435a58..2f916d0b44 100644 --- a/src/qt/forms/receivecoinsdialog.ui +++ b/src/qt/forms/receivecoinsdialog.ui @@ -206,10 +206,10 @@ <enum>Qt::StrongFocus</enum> </property> <property name="toolTip"> - <string>Bech32 addresses (BIP-173) are cheaper to spend from and offer better protection against typos. When unchecked a P2SH wrapped SegWit address will be created, compatible with older wallets.</string> + <string>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.</string> </property> <property name="text"> - <string>Generate Bech32 address</string> + <string>Generate native segwit (Bech32) address</string> </property> </widget> </item> diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 1d21d8c766..ff47653fb7 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -27,8 +27,6 @@ static const bool DEFAULT_SPLASHSCREEN = true; #define COLOR_BAREADDRESS QColor(140, 140, 140) /* Transaction list -- TX status decoration - open until date */ #define COLOR_TX_STATUS_OPENUNTILDATE QColor(64, 64, 255) -/* Transaction list -- TX status decoration - offline */ -#define COLOR_TX_STATUS_OFFLINE QColor(192, 192, 192) /* Transaction list -- TX status decoration - danger, tx needs attention */ #define COLOR_TX_STATUS_DANGER QColor(200, 100, 100) /* Transaction list -- TX status decoration - default color */ diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 563f930dec..9dde2c392c 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -53,13 +53,9 @@ #include <QSettings> #include <QTextDocument> // for Qt::mightBeRichText #include <QThread> +#include <QUrlQuery> #include <QMouseEvent> -#if QT_VERSION < 0x050000 -#include <QUrl> -#else -#include <QUrlQuery> -#endif #if QT_VERSION >= 0x50200 #include <QFontDatabase> @@ -67,16 +63,6 @@ static fs::detail::utf8_codecvt_facet utf8; -#if defined(Q_OS_MAC) -extern double NSAppKitVersionNumber; -#if !defined(NSAppKitVersionNumber10_8) -#define NSAppKitVersionNumber10_8 1187 -#endif -#if !defined(NSAppKitVersionNumber10_9) -#define NSAppKitVersionNumber10_9 1265 -#endif -#endif - namespace GUIUtil { QString dateTimeStr(const QDateTime &date) @@ -95,11 +81,7 @@ QFont fixedPitchFont() return QFontDatabase::systemFont(QFontDatabase::FixedFont); #else QFont font("Monospace"); -#if QT_VERSION >= 0x040800 font.setStyleHint(QFont::Monospace); -#else - font.setStyleHint(QFont::TypeWriter); -#endif return font; #endif } @@ -127,12 +109,10 @@ void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent) parent->setFocusProxy(widget); widget->setFont(fixedPitchFont()); -#if QT_VERSION >= 0x040700 // We don't want translators to use own addresses in translations // and this is the only place, where this address is supplied. widget->setPlaceholderText(QObject::tr("Enter a Bitcoin address (e.g. %1)").arg( QString::fromStdString(DummyAddress(Params())))); -#endif widget->setValidator(new BitcoinAddressEntryValidator(parent)); widget->setCheckValidator(new BitcoinAddressCheckValidator(parent)); } @@ -151,12 +131,8 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out) } rv.amount = 0; -#if QT_VERSION < 0x050000 - QList<QPair<QString, QString> > items = uri.queryItems(); -#else QUrlQuery uriQuery(uri); QList<QPair<QString, QString> > items = uriQuery.queryItems(); -#endif for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++) { bool fShouldReturnFalse = false; @@ -242,11 +218,7 @@ bool isDust(interfaces::Node& node, const QString& address, const CAmount& amoun QString HtmlEscape(const QString& str, bool fMultiLine) { -#if QT_VERSION < 0x050000 - QString escaped = Qt::escape(str); -#else QString escaped = str.toHtmlEscaped(); -#endif if(fMultiLine) { escaped = escaped.replace("\n", "<br>\n"); @@ -287,11 +259,7 @@ QString getSaveFileName(QWidget *parent, const QString &caption, const QString & QString myDir; if(dir.isEmpty()) // Default to user documents location { -#if QT_VERSION < 0x050000 - myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); -#else myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); -#endif } else { @@ -337,11 +305,7 @@ QString getOpenFileName(QWidget *parent, const QString &caption, const QString & QString myDir; if(dir.isEmpty()) // Default to user documents location { -#if QT_VERSION < 0x050000 - myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); -#else myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); -#endif } else { @@ -407,52 +371,16 @@ bool openBitcoinConf() /* Create the file */ boost::filesystem::ofstream configFile(pathConfig, std::ios_base::app); - + if (!configFile.good()) return false; - + configFile.close(); - + /* Open bitcoin.conf with the associated application */ return QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig))); } -void SubstituteFonts(const QString& language) -{ -#if defined(Q_OS_MAC) -// Background: -// OSX's default font changed in 10.9 and Qt is unable to find it with its -// usual fallback methods when building against the 10.7 sdk or lower. -// The 10.8 SDK added a function to let it find the correct fallback font. -// If this fallback is not properly loaded, some characters may fail to -// render correctly. -// -// The same thing happened with 10.10. .Helvetica Neue DeskInterface is now default. -// -// Solution: If building with the 10.7 SDK or lower and the user's platform -// is 10.9 or higher at runtime, substitute the correct font. This needs to -// happen before the QApplication is created. -#if defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8 - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_8) - { - if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_9) - /* On a 10.9 - 10.9.x system */ - QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande"); - else - { - /* 10.10 or later system */ - if (language == "zh_CN" || language == "zh_TW" || language == "zh_HK") // traditional or simplified Chinese - QFont::insertSubstitution(".Helvetica Neue DeskInterface", "Heiti SC"); - else if (language == "ja") // Japanese - QFont::insertSubstitution(".Helvetica Neue DeskInterface", "Songti SC"); - else - QFont::insertSubstitution(".Helvetica Neue DeskInterface", "Lucida Grande"); - } - } -#endif -#endif -} - ToolTipToRichTextFilter::ToolTipToRichTextFilter(int _size_threshold, QObject *parent) : QObject(parent), size_threshold(_size_threshold) @@ -495,11 +423,7 @@ void TableViewLastColumnResizingFixer::disconnectViewHeadersSignals() // Refactored here for readability. void TableViewLastColumnResizingFixer::setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode) { -#if QT_VERSION < 0x050000 - tableView->horizontalHeader()->setResizeMode(logicalIndex, resizeMode); -#else tableView->horizontalHeader()->setSectionResizeMode(logicalIndex, resizeMode); -#endif } void TableViewLastColumnResizingFixer::resizeColumn(int nColumnIndex, int width) @@ -771,7 +695,7 @@ LSSharedFileListItemRef findStartupItemInList(LSSharedFileListRef list, CFURLRef if (listSnapshot == nullptr) { return nullptr; } - + // loop through the list of startup items and try to find the bitcoin app for(int i = 0; i < CFArrayGetCount(listSnapshot); i++) { LSSharedFileListItemRef item = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(listSnapshot, i); @@ -799,7 +723,7 @@ LSSharedFileListItemRef findStartupItemInList(LSSharedFileListRef list, CFURLRef CFRelease(currentItemURL); } } - + CFRelease(listSnapshot); return nullptr; } @@ -810,7 +734,7 @@ bool GetStartOnSystemStartup() if (bitcoinAppUrl == nullptr) { return false; } - + LSSharedFileListRef loginItems = LSSharedFileListCreate(nullptr, kLSSharedFileListSessionLoginItems, nullptr); LSSharedFileListItemRef foundItem = findStartupItemInList(loginItems, bitcoinAppUrl); @@ -824,7 +748,7 @@ bool SetStartOnSystemStartup(bool fAutoStart) if (bitcoinAppUrl == nullptr) { return false; } - + LSSharedFileListRef loginItems = LSSharedFileListCreate(nullptr, kLSSharedFileListSessionLoginItems, nullptr); LSSharedFileListItemRef foundItem = findStartupItemInList(loginItems, bitcoinAppUrl); @@ -836,7 +760,7 @@ bool SetStartOnSystemStartup(bool fAutoStart) // remove item LSSharedFileListItemRemove(loginItems, foundItem); } - + CFRelease(bitcoinAppUrl); return true; } @@ -997,7 +921,7 @@ void ClickableLabel::mouseReleaseEvent(QMouseEvent *event) { Q_EMIT clicked(event->pos()); } - + void ClickableProgressBar::mouseReleaseEvent(QMouseEvent *event) { Q_EMIT clicked(event->pos()); diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 4a26964098..6aa65369fa 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -120,9 +120,6 @@ namespace GUIUtil // Open the config file bool openBitcoinConf(); - // Replace invalid default fonts with known good ones - void SubstituteFonts(const QString& language); - /** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. This assures that Qt can word-wrap long tooltip messages. Tooltips longer than the provided size threshold (in characters) are wrapped. @@ -219,11 +216,11 @@ namespace GUIUtil protected: void mouseReleaseEvent(QMouseEvent *event); }; - + class ClickableProgressBar : public QProgressBar { Q_OBJECT - + Q_SIGNALS: /** Emitted when the progressbar is clicked. The relative mouse coordinates of the click are * passed to the signal. @@ -233,19 +230,7 @@ namespace GUIUtil void mouseReleaseEvent(QMouseEvent *event); }; -#if defined(Q_OS_MAC) && QT_VERSION >= 0x050000 - // workaround for Qt OSX Bug: - // https://bugreports.qt-project.org/browse/QTBUG-15631 - // QProgressBar uses around 10% CPU even when app is in background - class ProgressBar : public ClickableProgressBar - { - bool event(QEvent *e) { - return (e->type() != QEvent::StyleAnimationUpdate) ? QProgressBar::event(e) : false; - } - }; -#else typedef ClickableProgressBar ProgressBar; -#endif } // namespace GUIUtil diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 2b712b4317..1b51699b31 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -4,7 +4,7 @@ <context> <name>AddressBookPage</name> <message> - <location filename="../forms/addressbookpage.ui" line="+30"/> + <location filename="../forms/addressbookpage.ui" line="+37"/> <source>Right-click to edit address or label</source> <translation type="unfinished"></translation> </message> @@ -39,7 +39,12 @@ <translation>Delete the currently selected address from the list</translation> </message> <message> - <location line="+30"/> + <location line="-71"/> + <source>Enter address or label to search</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+101"/> <source>Export the data in the current tab to a file</source> <translation>Export the data in the current tab to a file</translation> </message> @@ -54,7 +59,7 @@ <translation>&Delete</translation> </message> <message> - <location filename="../addressbookpage.cpp" line="+50"/> + <location filename="../addressbookpage.cpp" line="+85"/> <source>Choose the address to send coins to</source> <translation type="unfinished"></translation> </message> @@ -84,12 +89,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+4"/> + <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> <translation type="unfinished"></translation> </message> <message> - <location line="+6"/> + <location line="+7"/> <source>&Copy Address</source> <translation type="unfinished"></translation> </message> @@ -104,7 +109,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+193"/> + <location line="+177"/> <source>Export Address List</source> <translation type="unfinished"></translation> </message> @@ -127,7 +132,7 @@ <context> <name>AddressTableModel</name> <message> - <location filename="../addresstablemodel.cpp" line="+169"/> + <location filename="../addresstablemodel.cpp" line="+164"/> <source>Label</source> <translation type="unfinished"></translation> </message> @@ -291,7 +296,7 @@ <context> <name>BanTableModel</name> <message> - <location filename="../bantablemodel.cpp" line="+89"/> + <location filename="../bantablemodel.cpp" line="+88"/> <source>IP/Netmask</source> <translation type="unfinished"></translation> </message> @@ -304,27 +309,27 @@ <context> <name>BitcoinGUI</name> <message> - <location filename="../bitcoingui.cpp" line="+358"/> + <location filename="../bitcoingui.cpp" line="+307"/> <source>Sign &message...</source> <translation>Sign &message...</translation> </message> <message> - <location line="+430"/> + <location line="+483"/> <source>Synchronizing with network...</source> <translation>Synchronizing with network...</translation> </message> <message> - <location line="-508"/> + <location line="-561"/> <source>&Overview</source> <translation>&Overview</translation> </message> <message> - <location line="-144"/> + <location line="-140"/> <source>Node</source> <translation type="unfinished"></translation> </message> <message> - <location line="+145"/> + <location line="+141"/> <source>Show general overview of wallet</source> <translation>Show general overview of wallet</translation> </message> @@ -409,7 +414,17 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+360"/> + <location line="+104"/> + <source>Wallet:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+83"/> + <source>default wallet</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+226"/> <source>Click to disable network activity.</source> <translation type="unfinished"></translation> </message> @@ -434,7 +449,12 @@ <translation>Reindexing blocks on disk...</translation> </message> <message> - <location line="-511"/> + <location line="+316"/> + <source>Proxy is <b>enabled</b>: %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-880"/> <source>Send coins to a Bitcoin address</source> <translation>Send coins to a Bitcoin address</translation> </message> @@ -464,17 +484,17 @@ <translation>&Verify message...</translation> </message> <message> - <location line="+517"/> + <location line="+570"/> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> <message> - <location line="-743"/> + <location line="-792"/> <source>Wallet</source> <translation>Wallet</translation> </message> <message> - <location line="+153"/> + <location line="+149"/> <source>&Send</source> <translation>&Send</translation> </message> @@ -554,7 +574,7 @@ <translation type="unfinished"></translation> </message> <message numerus="yes"> - <location line="+357"/> + <location line="+410"/> <source>%n active connection(s) to Bitcoin network</source> <translation> <numerusform>%n active connection to Bitcoin network</numerusform> @@ -615,12 +635,12 @@ <translation>Up to date</translation> </message> <message> - <location line="-441"/> + <location line="-494"/> <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="+200"/> + <location line="+253"/> <source>%1 client</source> <translation type="unfinished"></translation> </message> @@ -635,7 +655,7 @@ <translation>Catching up...</translation> </message> <message> - <location line="+145"/> + <location line="+151"/> <source>Date: %1 </source> <translation type="unfinished"></translation> @@ -647,7 +667,13 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> + <location line="+2"/> + <source>Wallet: %1 +</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> <source>Type: %1 </source> <translation type="unfinished"></translation> @@ -695,7 +721,7 @@ <translation>Wallet is <b>encrypted</b> and currently <b>locked</b></translation> </message> <message> - <location filename="../bitcoin.cpp" line="+534"/> + <location filename="../bitcoin.cpp" line="+529"/> <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> <translation type="unfinished"></translation> </message> @@ -849,7 +875,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+325"/> + <location line="+315"/> <source>(%1 locked)</source> <translation type="unfinished"></translation> </message> @@ -874,8 +900,8 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+42"/> - <location line="+52"/> + <location line="+45"/> + <location line="+54"/> <source>(no label)</source> <translation type="unfinished"></translation> </message> @@ -918,12 +944,7 @@ <translation>&Address</translation> </message> <message> - <location filename="../editaddressdialog.cpp" line="+30"/> - <source>New receiving address</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+4"/> + <location filename="../editaddressdialog.cpp" line="+29"/> <source>New sending address</source> <translation type="unfinished"></translation> </message> @@ -938,17 +959,22 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+72"/> + <location line="+71"/> <source>The entered address "%1" is not a valid Bitcoin address.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+5"/> - <source>The entered address "%1" is already in the address book.</source> + <location line="+33"/> + <source>Address "%1" already exists as a receiving address with label "%2" and so cannot be added as a sending address.</source> <translation type="unfinished"></translation> </message> <message> <location line="+5"/> + <source>The entered address "%1" is already in the address book with label "%2".</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-28"/> <source>Could not unlock wallet.</source> <translation type="unfinished"></translation> </message> @@ -961,7 +987,7 @@ <context> <name>FreespaceChecker</name> <message> - <location filename="../intro.cpp" line="+76"/> + <location filename="../intro.cpp" line="+77"/> <source>A new data directory will be created.</source> <translation>A new data directory will be created.</translation> </message> @@ -989,7 +1015,7 @@ <context> <name>HelpMessageDialog</name> <message> - <location filename="../utilitydialog.cpp" line="+40"/> + <location filename="../utilitydialog.cpp" line="+41"/> <source>version</source> <translation type="unfinished">version</translation> </message> @@ -1009,51 +1035,6 @@ <source>Command-line options</source> <translation type="unfinished"></translation> </message> - <message> - <location line="+1"/> - <source>Usage:</source> - <translation type="unfinished">Usage:</translation> - </message> - <message> - <location line="+1"/> - <source>command-line options</source> - <translation type="unfinished">command-line options</translation> - </message> - <message> - <location line="+9"/> - <source>UI Options:</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+4"/> - <source>Choose data directory on startup (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Set language, for example "de_DE" (default: system locale)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Start minimized</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Set SSL root certificates for payment request (default: -system-)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Show splash screen on startup (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Reset all settings changed in the GUI</source> - <translation type="unfinished"></translation> - </message> </context> <context> <name>Intro</name> @@ -1128,7 +1109,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+26"/> + <location line="+27"/> <source>Error</source> <translation>Error</translation> </message> @@ -1238,7 +1219,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../openuridialog.cpp" line="+47"/> + <location filename="../openuridialog.cpp" line="+45"/> <source>Select payment request file to open</source> <translation type="unfinished"></translation> </message> @@ -1266,7 +1247,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+9"/> + <location line="+72"/> <source>Size of &database cache</source> <translation type="unfinished"></translation> </message> @@ -1350,7 +1331,27 @@ <translation>&Network</translation> </message> <message> - <location line="-85"/> + <location line="-191"/> + <source>Disables some advanced features but all blocks will still be fully validated. Reverting this setting requires re-downloading the entire blockchain. Actual disk usage may be somewhat higher.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Prune &block storage to</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+10"/> + <source>GB</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+25"/> + <source>Reverting this setting requires re-downloading the entire blockchain.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+68"/> <source>(0 = auto, <0 = leave that many cores free)</source> <translation type="unfinished"></translation> </message> @@ -1518,28 +1519,28 @@ <translation>&Cancel</translation> </message> <message> - <location filename="../optionsdialog.cpp" line="+82"/> + <location filename="../optionsdialog.cpp" line="+92"/> <source>default</source> <translation>default</translation> </message> <message> - <location line="+64"/> + <location line="+52"/> <source>none</source> <translation type="unfinished"></translation> </message> <message> - <location line="+72"/> + <location line="+77"/> <source>Confirm options reset</source> <translation>Confirm options reset</translation> </message> <message> <location line="+1"/> - <location line="+55"/> + <location line="+60"/> <source>Client restart required to activate changes.</source> <translation type="unfinished"></translation> </message> <message> - <location line="-55"/> + <location line="-60"/> <source>Client will be shut down. Do you want to proceed?</source> <translation type="unfinished"></translation> </message> @@ -1564,7 +1565,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+38"/> + <location line="+43"/> <source>This change would require a client restart.</source> <translation type="unfinished"></translation> </message> @@ -1671,10 +1672,10 @@ <context> <name>PaymentServer</name> <message> - <location filename="../paymentserver.cpp" line="+326"/> - <location line="+214"/> + <location filename="../paymentserver.cpp" line="+317"/> + <location line="+215"/> <location line="+42"/> - <location line="+111"/> + <location line="+110"/> <location line="+14"/> <location line="+18"/> <source>Payment request error</source> @@ -1686,14 +1687,20 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+102"/> + <location line="+82"/> + <location line="+21"/> <location line="+13"/> <location line="+7"/> <source>URI handling</source> <translation type="unfinished"></translation> </message> <message> - <location line="-19"/> + <location line="-41"/> + <source>'bitcoin://' is not a valid URI. Use 'bitcoin:' instead.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+22"/> <source>Payment request fetch URL is invalid: %1</source> <translation type="unfinished"></translation> </message> @@ -1723,12 +1730,12 @@ <location line="+31"/> <location line="+10"/> <location line="+17"/> - <location line="+86"/> + <location line="+85"/> <source>Payment request rejected</source> <translation type="unfinished"></translation> </message> <message> - <location line="-153"/> + <location line="-152"/> <source>Payment request network doesn't match client network.</source> <translation type="unfinished"></translation> </message> @@ -1759,12 +1766,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+55"/> + <location line="+65"/> <source>Refund from %1</source> <translation type="unfinished"></translation> </message> <message> - <location line="+42"/> + <location line="+31"/> <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source> <translation type="unfinished"></translation> </message> @@ -1797,7 +1804,7 @@ <context> <name>PeerTableModel</name> <message> - <location filename="../peertablemodel.cpp" line="+121"/> + <location filename="../peertablemodel.cpp" line="+109"/> <source>User Agent</source> <translation type="unfinished"></translation> </message> @@ -1830,17 +1837,17 @@ <context> <name>QObject</name> <message> - <location filename="../bitcoinunits.cpp" line="+185"/> + <location filename="../bitcoinunits.cpp" line="+197"/> <source>Amount</source> <translation type="unfinished">Amount</translation> </message> <message> - <location filename="../guiutil.cpp" line="+130"/> + <location filename="../guiutil.cpp" line="+124"/> <source>Enter a Bitcoin address (e.g. %1)</source> <translation type="unfinished"></translation> </message> <message> - <location line="+760"/> + <location line="+722"/> <source>%1 d</source> <translation type="unfinished"></translation> </message> @@ -1950,7 +1957,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../bitcoin.cpp" line="+178"/> + <location filename="../bitcoin.cpp" line="+193"/> <source>%1 didn't yet exit safely...</source> <translation type="unfinished"></translation> </message> @@ -1963,13 +1970,18 @@ <context> <name>QObject::QObject</name> <message> - <location filename="../bitcoin.cpp" line="-86"/> + <location filename="../bitcoin.cpp" line="-118"/> + <source>Error parsing command line arguments: %1.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+39"/> <source>Error: Specified data directory "%1" does not exist.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+7"/> - <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source> + <location line="+5"/> + <source>Error: Cannot parse configuration file: %1.</source> <translation type="unfinished"></translation> </message> <message> @@ -1981,7 +1993,7 @@ <context> <name>QRImageWidget</name> <message> - <location filename="../receiverequestdialog.cpp" line="+35"/> + <location filename="../receiverequestdialog.cpp" line="+32"/> <source>&Save Image...</source> <translation type="unfinished"></translation> </message> @@ -2015,7 +2027,7 @@ <location line="+23"/> <location line="+36"/> <location line="+23"/> - <location line="+663"/> + <location line="+679"/> <location line="+23"/> <location line="+23"/> <location line="+23"/> @@ -2037,7 +2049,7 @@ <translation>N/A</translation> </message> <message> - <location line="-1345"/> + <location line="-1361"/> <source>Client version</source> <translation>Client version</translation> </message> @@ -2112,7 +2124,17 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+324"/> + <location line="+94"/> + <source>Wallet: </source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+8"/> + <source>(none)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+238"/> <source>&Reset</source> <translation type="unfinished"></translation> </message> @@ -2140,8 +2162,8 @@ </message> <message> <location line="+60"/> - <location filename="../rpcconsole.cpp" line="+496"/> - <location line="+718"/> + <location filename="../rpcconsole.cpp" line="+502"/> + <location line="+760"/> <source>Select a peer to view detailed information.</source> <translation type="unfinished"></translation> </message> @@ -2176,18 +2198,18 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-1079"/> - <location line="+987"/> + <location line="-1095"/> + <location line="+1003"/> <source>User Agent</source> <translation type="unfinished"></translation> </message> <message> - <location line="-684"/> + <location line="-700"/> <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> <message> - <location line="+68"/> + <location line="+84"/> <source>Decrease font size</source> <translation type="unfinished"></translation> </message> @@ -2247,7 +2269,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-1116"/> + <location line="-1132"/> <source>Last block time</source> <translation>Last block time</translation> </message> @@ -2262,7 +2284,7 @@ <translation>&Console</translation> </message> <message> - <location line="+195"/> + <location line="+211"/> <source>&Network Traffic</source> <translation type="unfinished"></translation> </message> @@ -2272,7 +2294,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../rpcconsole.cpp" line="-401"/> + <location filename="../rpcconsole.cpp" line="-414"/> <source>In:</source> <translation type="unfinished"></translation> </message> @@ -2282,17 +2304,17 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../forms/debugwindow.ui" line="-299"/> + <location filename="../forms/debugwindow.ui" line="-315"/> <source>Debug log file</source> <translation>Debug log file</translation> </message> <message> - <location line="+136"/> + <location line="+152"/> <source>Clear console</source> <translation>Clear console</translation> </message> <message> - <location filename="../rpcconsole.cpp" line="-225"/> + <location filename="../rpcconsole.cpp" line="-253"/> <source>1 &hour</source> <translation type="unfinished"></translation> </message> @@ -2330,7 +2352,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+136"/> + <location line="+54"/> + <source>default wallet</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+110"/> <source>Welcome to the %1 RPC console.</source> <translation type="unfinished"></translation> </message> @@ -2360,7 +2387,17 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+243"/> + <location line="+68"/> + <source>Executing command without any wallet</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>Executing command using "%1" wallet</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+190"/> <source>(node id: %1)</source> <translation type="unfinished"></translation> </message> @@ -2453,27 +2490,27 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+142"/> - <source>Requested payments history</source> + <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> <translation type="unfinished"></translation> </message> <message> - <location line="-162"/> - <source>&Request payment</source> + <location line="+3"/> + <source>Generate native segwit (Bech32) address</source> <translation type="unfinished"></translation> </message> <message> - <location line="+98"/> - <source>Bech32 addresses (BIP-173) are cheaper to spend from and offer better protection against typos. When unchecked a P2SH wrapped SegWit address will be created, compatible with older wallets.</source> + <location line="+61"/> + <source>Requested payments history</source> <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Generate Bech32 address</source> + <location line="-162"/> + <source>&Request payment</source> <translation type="unfinished"></translation> </message> <message> - <location line="+86"/> + <location line="+187"/> <source>Show the selected request (does the same as double clicking an entry)</source> <translation type="unfinished"></translation> </message> @@ -2571,7 +2608,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+10"/> + <location line="+2"/> + <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> @@ -2584,7 +2626,7 @@ <context> <name>RecentRequestsTableModel</name> <message> - <location filename="../recentrequeststablemodel.cpp" line="+28"/> + <location filename="../recentrequeststablemodel.cpp" line="+27"/> <source>Date</source> <translation type="unfinished">Date</translation> </message> @@ -2623,7 +2665,7 @@ <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> - <location filename="../sendcoinsdialog.cpp" line="+578"/> + <location filename="../sendcoinsdialog.cpp" line="+588"/> <source>Send Coins</source> <translation>Send Coins</translation> </message> @@ -2713,22 +2755,24 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+54"/> - <source>per kilobyte</source> + <location line="+51"/> + <source>Specify a custom fee per kB (1,000 bytes) of the transaction's virtual size. + +Note: Since the fee is calculated on a per-byte basis, a fee of "100 satoshis per kB" for a transaction size of 500 bytes (half of 1 kB) would ultimately yield a fee of only 50 satoshis.</source> <translation type="unfinished"></translation> </message> <message> - <location line="-3"/> - <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then "per kilobyte" only pays 250 satoshis in fee, while "total at least" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source> + <location line="+5"/> + <source>per kilobyte</source> <translation type="unfinished"></translation> </message> <message> - <location line="-48"/> + <location line="-53"/> <source>Hide</source> <translation type="unfinished"></translation> </message> <message> - <location line="+78"/> + <location line="+80"/> <location line="+13"/> <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source> <translation type="unfinished"></translation> @@ -2769,12 +2813,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-833"/> + <location line="-835"/> <source>Dust:</source> <translation type="unfinished"></translation> </message> <message> - <location line="+694"/> + <location line="+696"/> <source>Confirmation time target:</source> <translation type="unfinished"></translation> </message> @@ -2809,7 +2853,7 @@ <translation>S&end</translation> </message> <message> - <location filename="../sendcoinsdialog.cpp" line="-494"/> + <location filename="../sendcoinsdialog.cpp" line="-504"/> <source>Copy quantity</source> <translation type="unfinished"></translation> </message> @@ -2849,7 +2893,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+127"/> + <location line="+131"/> <location line="+5"/> <location line="+5"/> <location line="+4"/> @@ -2862,31 +2906,41 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+9"/> - <source>added as transaction fee</source> + <location line="+42"/> + <source>or</source> <translation type="unfinished"></translation> </message> <message> - <location line="+15"/> - <source>Total Amount %1</source> + <location line="-19"/> + <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source> <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>or</source> + <location line="-57"/> + <source>from wallet %1</source> <translation type="unfinished"></translation> </message> <message> - <location line="+4"/> - <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source> + <location line="+36"/> + <source>Please, review your transaction.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+2"/> + <location line="+7"/> + <source>Transaction fee</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+16"/> <source>Not signalling Replace-By-Fee, BIP-125.</source> <translation type="unfinished"></translation> </message> <message> + <location line="+14"/> + <source>Total Amount</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+5"/> <source>Confirm send coins</source> <translation type="unfinished"></translation> @@ -2942,7 +2996,7 @@ <translation type="unfinished"></translation> </message> <message numerus="yes"> - <location line="+42"/> + <location line="+43"/> <source>Estimated to begin confirmation within %n block(s).</source> <translation> <numerusform>Estimated to begin confirmation within %n block.</numerusform> @@ -3084,7 +3138,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../sendcoinsentry.cpp" line="+36"/> + <location filename="../sendcoinsentry.cpp" line="+35"/> <source>Enter a label for this address to add it to your address book</source> <translation type="unfinished"></translation> </message> @@ -3101,7 +3155,7 @@ <context> <name>ShutdownWindow</name> <message> - <location filename="../utilitydialog.cpp" line="+78"/> + <location filename="../utilitydialog.cpp" line="+84"/> <source>%1 is shutting down...</source> <translation type="unfinished"></translation> </message> @@ -3222,12 +3276,12 @@ <translation>Reset all verify message fields</translation> </message> <message> - <location filename="../signverifymessagedialog.cpp" line="+41"/> + <location filename="../signverifymessagedialog.cpp" line="+39"/> <source>Click "Sign Message" to generate signature</source> <translation type="unfinished"></translation> </message> <message> - <location line="+82"/> + <location line="+81"/> <location line="+78"/> <source>The entered address is invalid.</source> <translation type="unfinished"></translation> @@ -3304,7 +3358,7 @@ <context> <name>TrafficGraphWidget</name> <message> - <location filename="../trafficgraphwidget.cpp" line="+80"/> + <location filename="../trafficgraphwidget.cpp" line="+81"/> <source>KB/s</source> <translation type="unfinished"></translation> </message> @@ -3312,7 +3366,7 @@ <context> <name>TransactionDesc</name> <message numerus="yes"> - <location filename="../transactiondesc.cpp" line="+30"/> + <location filename="../transactiondesc.cpp" line="+31"/> <source>Open for %n more block(s)</source> <translation> <numerusform>Open for %n more block</numerusform> @@ -3331,11 +3385,6 @@ </message> <message> <location line="+2"/> - <source>%1/offline</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+2"/> <source>0/unconfirmed, %1</source> <translation type="unfinished"></translation> </message> @@ -3365,25 +3414,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+17"/> + <location line="+23"/> <source>Status</source> <translation type="unfinished"></translation> </message> <message> - <location line="+5"/> - <source>, has not been successfully broadcast yet</source> - <translation type="unfinished"></translation> - </message> - <message numerus="yes"> - <location line="+2"/> - <source>, broadcast through %n node(s)</source> - <translation> - <numerusform>, broadcast through %n node</numerusform> - <numerusform>, broadcast through %n nodes</numerusform> - </translation> - </message> - <message> - <location line="+4"/> + <location line="+3"/> <source>Date</source> <translation type="unfinished">Date</translation> </message> @@ -3399,7 +3435,7 @@ </message> <message> <location line="+5"/> - <location line="+12"/> + <location line="+14"/> <location line="+72"/> <source>From</source> <translation type="unfinished"></translation> @@ -3412,12 +3448,12 @@ <message> <location line="+1"/> <location line="+20"/> - <location line="+69"/> + <location line="+70"/> <source>To</source> <translation type="unfinished"></translation> </message> <message> - <location line="-87"/> + <location line="-88"/> <source>own address</source> <translation type="unfinished"></translation> </message> @@ -3433,16 +3469,16 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+34"/> + <location line="+36"/> <location line="+12"/> - <location line="+53"/> - <location line="+26"/> - <location line="+55"/> + <location line="+54"/> + <location line="+30"/> + <location line="+58"/> <source>Credit</source> <translation type="unfinished"></translation> </message> <message numerus="yes"> - <location line="-144"/> + <location line="-152"/> <source>matures in %n more block(s)</source> <translation> <numerusform>matures in %n more block</numerusform> @@ -3455,14 +3491,14 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+59"/> - <location line="+25"/> - <location line="+55"/> + <location line="+60"/> + <location line="+26"/> + <location line="+61"/> <source>Debit</source> <translation type="unfinished"></translation> </message> <message> - <location line="-70"/> + <location line="-77"/> <source>Total debit</source> <translation type="unfinished"></translation> </message> @@ -3477,18 +3513,18 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+16"/> + <location line="+22"/> <source>Net amount</source> <translation type="unfinished"></translation> </message> <message> <location line="+6"/> - <location line="+11"/> + <location line="+12"/> <source>Message</source> <translation type="unfinished"></translation> </message> <message> - <location line="-9"/> + <location line="-10"/> <source>Comment</source> <translation type="unfinished"></translation> </message> @@ -3504,6 +3540,11 @@ </message> <message> <location line="+1"/> + <source>Transaction virtual size</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> <source>Output index</source> <translation type="unfinished"></translation> </message> @@ -3533,7 +3574,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+20"/> + <location line="+21"/> <source>Amount</source> <translation type="unfinished">Amount</translation> </message> @@ -3566,7 +3607,7 @@ <context> <name>TransactionTableModel</name> <message> - <location filename="../transactiontablemodel.cpp" line="+248"/> + <location filename="../transactiontablemodel.cpp" line="+226"/> <source>Date</source> <translation type="unfinished">Date</translation> </message> @@ -3595,11 +3636,6 @@ </message> <message> <location line="+3"/> - <source>Offline</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"></translation> </message> @@ -3630,11 +3666,6 @@ </message> <message> <location line="+3"/> - <source>This block was not received by any other nodes and will probably not be accepted!</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> <source>Generated but not accepted</source> <translation type="unfinished"></translation> </message> @@ -3674,7 +3705,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+213"/> + <location line="+208"/> <source>(no label)</source> <translation type="unfinished"></translation> </message> @@ -3773,17 +3804,17 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+6"/> + <location line="+5"/> <source>Enter address, transaction id, or label to search</source> <translation type="unfinished"></translation> </message> <message> - <location line="+6"/> + <location line="+4"/> <source>Min amount</source> <translation type="unfinished"></translation> </message> <message> - <location line="+48"/> + <location line="+47"/> <source>Abandon transaction</source> <translation type="unfinished"></translation> </message> @@ -3833,7 +3864,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+194"/> + <location line="+193"/> <source>Export Transaction History</source> <translation type="unfinished"></translation> </message> @@ -3911,7 +3942,7 @@ <context> <name>UnitDisplayStatusBarControl</name> <message> - <location filename="../bitcoingui.cpp" line="+129"/> + <location filename="../bitcoingui.cpp" line="+159"/> <source>Unit to show amounts in. Click to select another unit.</source> <translation type="unfinished"></translation> </message> @@ -3919,7 +3950,7 @@ <context> <name>WalletFrame</name> <message> - <location filename="../walletframe.cpp" line="+28"/> + <location filename="../walletframe.cpp" line="+29"/> <source>No wallet has been loaded.</source> <translation type="unfinished"></translation> </message> @@ -3927,12 +3958,12 @@ <context> <name>WalletModel</name> <message> - <location filename="../walletmodel.cpp" line="+290"/> + <location filename="../walletmodel.cpp" line="+215"/> <source>Send Coins</source> <translation type="unfinished">Send Coins</translation> </message> <message> - <location line="+384"/> + <location line="+289"/> <location line="+39"/> <location line="+6"/> <source>Fee bump error</source> @@ -3982,7 +4013,7 @@ <context> <name>WalletView</name> <message> - <location filename="../walletview.cpp" line="+46"/> + <location filename="../walletview.cpp" line="+47"/> <source>&Export</source> <translation type="unfinished">&Export</translation> </message> @@ -3992,7 +4023,7 @@ <translation type="unfinished">Export the data in the current tab to a file</translation> </message> <message> - <location line="+201"/> + <location line="+207"/> <source>Backup Wallet</source> <translation type="unfinished"></translation> </message> @@ -4021,46 +4052,21 @@ <source>The wallet data was successfully saved to %1.</source> <translation type="unfinished"></translation> </message> + <message> + <location line="+54"/> + <source>Cancel</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>bitcoin-core</name> <message> - <location filename="../bitcoinstrings.cpp" line="+351"/> - <source>Options:</source> - <translation>Options:</translation> - </message> - <message> - <location line="+33"/> - <source>Specify data directory</source> - <translation>Specify data directory</translation> - </message> - <message> - <location line="-99"/> - <source>Connect to a node to retrieve peer addresses, and disconnect</source> - <translation>Connect to a node to retrieve peer addresses, and disconnect</translation> - </message> - <message> - <location line="+102"/> - <source>Specify your own public address</source> - <translation>Specify your own public address</translation> - </message> - <message> - <location line="-116"/> - <source>Accept command line and JSON-RPC commands</source> - <translation>Accept command line and JSON-RPC commands</translation> - </message> - <message> - <location line="-209"/> + <location filename="../bitcoinstrings.cpp" line="+29"/> <source>Distributed under the MIT software license, see the accompanying file %s or %s</source> <translation type="unfinished"></translation> </message> <message> - <location line="+44"/> - <source>If <category> is not supplied or if <category> = 1, output all debugging information.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+36"/> + <location line="+22"/> <source>Prune configured below the minimum of %d MiB. Please use a higher number.</source> <translation type="unfinished"></translation> </message> @@ -4070,37 +4076,27 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+18"/> + <location line="+3"/> <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+151"/> + <location line="+81"/> <source>Error: A fatal internal error occurred, see debug.log for details</source> <translation type="unfinished"></translation> </message> <message> - <location line="+4"/> - <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+41"/> + <location line="+25"/> <source>Pruning blockstore...</source> <translation type="unfinished"></translation> </message> <message> - <location line="+11"/> - <source>Run in the background as a daemon and accept commands</source> - <translation>Run in the background as a daemon and accept commands</translation> - </message> - <message> - <location line="+40"/> + <location line="+28"/> <source>Unable to start HTTP server. See debug log for details.</source> <translation type="unfinished"></translation> </message> <message> - <location line="-397"/> + <location line="-178"/> <source>Bitcoin Core</source> <translation type="unfinished">Bitcoin Core</translation> </message> @@ -4111,26 +4107,6 @@ </message> <message> <location line="+7"/> - <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> - <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> - <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+7"/> - <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> - <translation>Bind to given address and always listen on it. Use [host]:port notation for IPv6</translation> - </message> - <message> - <location line="+12"/> <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source> <translation type="unfinished"></translation> </message> @@ -4140,52 +4116,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+6"/> - <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+18"/> + <location line="+12"/> <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+5"/> - <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+7"/> - <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> - <translation>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</translation> - </message> - <message> - <location line="+6"/> - <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+20"/> - <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+10"/> - <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+7"/> - <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+7"/> + <location line="+11"/> <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source> <translation type="unfinished"></translation> </message> @@ -4195,32 +4131,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+8"/> - <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+6"/> - <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >%u = automatically prune block files to stay under the specified target size in MiB)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+12"/> - <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+5"/> - <source>Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+14"/> + <location line="+11"/> <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source> <translation type="unfinished"></translation> </message> <message> - <location line="+12"/> + <location line="+7"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation type="unfinished"></translation> </message> @@ -4230,7 +4146,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+15"/> + <location line="+12"/> <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source> <translation type="unfinished"></translation> </message> @@ -4240,22 +4156,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+9"/> - <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+5"/> - <source>Username and hashed password for JSON-RPC connections. The field <userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=<USERNAME>/rpcpassword=<PASSWORD> pair of arguments. This option can be specified multiple times</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+6"/> - <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> + <location line="+11"/> <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source> <translation type="unfinished"></translation> </message> @@ -4265,12 +4166,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+11"/> + <location line="+6"/> <source>%d of last 100 blocks have unexpected version</source> <translation type="unfinished"></translation> </message> @@ -4280,56 +4176,21 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+4"/> - <source>-maxmempool must be at least %d MB</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source><category> can be:</source> - <translation type="unfinished"></translation> - </message> - <message> <location line="+2"/> - <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+4"/> - <source>Append comment to the user agent string</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Attempt to recover private keys from a corrupt wallet on startup</source> + <source>-maxmempool must be at least %d MB</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> - <source>Block creation options:</source> - <translation>Block creation options:</translation> - </message> - <message> - <location line="+2"/> <source>Cannot resolve -%s address: '%s'</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Chain selection options:</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> + <location line="+2"/> <source>Change index out of range</source> <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Connection options:</source> - <translation type="unfinished"></translation> - </message> - <message> <location line="+1"/> <source>Copyright (C) %i-%i</source> <translation type="unfinished"></translation> @@ -4341,46 +4202,11 @@ </message> <message> <location line="+1"/> - <source>Debugging/Testing options:</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Do not load the wallet and disable wallet RPC calls</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Do you want to rebuild the block database now?</translation> </message> <message> <location line="+2"/> - <source>Enable publish hash block in <address></source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Enable publish hash transaction in <address></source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Enable publish raw block in <address></source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Enable publish raw transaction in <address></source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Enable transaction replacement in the memory pool (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> <source>Error creating %s: You can't create non-HD wallets with this version.</source> <translation type="unfinished"></translation> </message> @@ -4401,6 +4227,11 @@ </message> <message> <location line="+1"/> + <source>Error loading %s: Private keys can only be disabled during creation</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> <source>Error loading %s: Wallet corrupted</source> <translation type="unfinished"></translation> </message> @@ -4415,7 +4246,7 @@ <translation>Error loading block database</translation> </message> <message> - <location line="+4"/> + <location line="+2"/> <source>Error opening block database</source> <translation>Error opening block database</translation> </message> @@ -4435,12 +4266,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> + <location line="+1"/> <source>Importing...</source> <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> + <location line="+1"/> <source>Incorrect or no genesis block found. Wrong datadir for network?</source> <translation>Incorrect or no genesis block found. Wrong datadir for network?</translation> </message> @@ -4465,12 +4296,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+4"/> - <source>Keep the transaction memory pool below <n> megabytes (default: %u)</source> + <location line="+47"/> + <source>Upgrading txindex database</source> <translation type="unfinished"></translation> </message> <message> - <location line="+4"/> + <location line="-43"/> <source>Loading P2P addresses...</source> <translation type="unfinished"></translation> </message> @@ -4480,32 +4311,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Location of the auth cookie (default: data dir)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+7"/> + <location line="+4"/> <source>Not enough file descriptors available.</source> <translation>Not enough file descriptors available.</translation> </message> <message> <location line="+1"/> - <source>Only connect to nodes in network <net> (ipv4, ipv6 or onion)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+4"/> - <source>Print this help message and exit</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Print version and exit</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> <source>Prune cannot be configured with a negative value.</source> <translation type="unfinished"></translation> </message> @@ -4516,46 +4327,21 @@ </message> <message> <location line="+3"/> - <source>Rebuild chain state and block index from the blk*.dat files on disk</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Rebuild chain state from the currently indexed blocks</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+4"/> <source>Replaying blocks...</source> <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> + <location line="+2"/> <source>Rewinding blocks...</source> <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Set database cache size in megabytes (%d to %d, default: %d)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+14"/> - <source>Specify wallet file (within data directory)</source> - <translation>Specify wallet file (within data directory)</translation> - </message> - <message> - <location line="+4"/> + <location line="+7"/> <source>The source code is available from %s.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+11"/> + <location line="+8"/> <source>Transaction fee and change calculation failed</source> <translation type="unfinished"></translation> </message> @@ -4565,7 +4351,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+4"/> + <location line="+2"/> + <source>Unable to generate keys</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> <source>Unsupported argument -benchmark ignored, use -debug=bench.</source> <translation type="unfinished"></translation> </message> @@ -4585,142 +4376,52 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+2"/> - <source>Upgrading UTXO database</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Use UPnP to map the listening port (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> <location line="+1"/> - <source>Use the test chain</source> + <source>Upgrading UTXO database</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> + <location line="+2"/> <source>User Agent comment (%s) contains unsafe characters.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+2"/> + <location line="+1"/> <source>Verifying blocks...</source> <translation>Verifying blocks...</translation> </message> <message> <location line="+3"/> - <source>Wallet debugging/testing options:</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> <source>Wallet needed to be rewritten: restart %s to complete</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Wallet options:</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="-397"/> - <source>Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+7"/> - <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+17"/> - <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+6"/> - <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+18"/> + <location line="-165"/> <source>Error: Listening for incoming connections failed (listen returned error %s)</source> <translation type="unfinished"></translation> </message> <message> - <location line="+6"/> - <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source> - <translation>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</translation> - </message> - <message> - <location line="+12"/> - <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+14"/> - <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+7"/> + <location line="+5"/> <source>Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source> <translation type="unfinished"></translation> </message> <message> - <location line="+10"/> - <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+24"/> - <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+44"/> + <location line="+22"/> <source>The transaction amount is too small to send after the fee has been deducted</source> <translation type="unfinished"></translation> </message> <message> - <location line="+64"/> - <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> + <location line="+44"/> <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> <message> - <location line="+7"/> - <source>(default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+5"/> - <source>Accept public REST requests (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+5"/> - <source>Automatically create Tor hidden service (default: %d)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+6"/> - <source>Connect through SOCKS5 proxy</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+20"/> + <location line="+22"/> <source>Error loading %s: You can't disable HD on an already existing HD wallet</source> <translation type="unfinished"></translation> </message> <message> - <location line="+6"/> + <location line="+4"/> <source>Error reading from database, shutting down.</source> <translation type="unfinished"></translation> </message> @@ -4730,12 +4431,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+9"/> - <source>Imports blocks from external blk000??.dat file on startup</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> + <location line="+8"/> <source>Information</source> <translation>Information</translation> </message> @@ -4760,52 +4456,17 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Keep at most <n> unconnectable transactions in memory (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+14"/> + <location line="+6"/> <source>Need to specify a port with -whitebind: '%s'</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Node relay options:</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+11"/> - <source>RPC server options:</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> + <location line="+5"/> <source>Reducing -maxconnections from %d to %d, because of system limitations.</source> <translation type="unfinished"></translation> </message> <message> <location line="+4"/> - <source>Rescan the block chain for missing wallet transactions on startup</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+4"/> - <source>Send trace/debug info to console instead of debug.log file</source> - <translation>Send trace/debug info to console instead of debug.log file</translation> - </message> - <message> - <location line="+6"/> - <source>Show all debugging options (usage: --help -help-debug)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> - <translation>Shrink debug.log file on client startup (default: 1 when no -debug)</translation> - </message> - <message> - <location line="+1"/> <source>Signing transaction failed</source> <translation>Signing transaction failed</translation> </message> @@ -4825,27 +4486,23 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+10"/> - <source>The transaction amount is too small to pay the fee</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+2"/> - <source>This is experimental software.</source> + <location line="+1"/> + <source>Specified blocks directory "%s" does not exist. +</source> <translation type="unfinished"></translation> </message> <message> - <location line="+4"/> - <source>Tor control port password (default: empty)</source> + <location line="+3"/> + <source>The transaction amount is too small to pay the fee</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Tor control port to use if onion listening enabled (default: %s)</source> + <location line="+2"/> + <source>This is experimental software.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> + <location line="+3"/> <source>Transaction amount too small</source> <translation>Transaction amount too small</translation> </message> @@ -4870,17 +4527,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+7"/> - <source>Upgrade wallet to latest format on startup</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+5"/> - <source>Username for JSON-RPC connections</source> - <translation>Username for JSON-RPC connections</translation> - </message> - <message> - <location line="+2"/> + <location line="+12"/> <source>Verifying wallet(s)...</source> <translation type="unfinished"></translation> </message> @@ -4890,7 +4537,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+4"/> + <location line="+2"/> <source>Warning</source> <translation>Warning</translation> </message> @@ -4901,136 +4548,21 @@ </message> <message> <location line="+1"/> - <source>Whether to operate in a blocks only mode (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>You need to rebuild the database using -reindex to change -txindex</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> <source>Zapping all transactions from wallet...</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>ZeroMQ notification options:</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="-80"/> - <source>Password for JSON-RPC connections</source> - <translation>Password for JSON-RPC connections</translation> - </message> - <message> - <location line="-263"/> - <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> - <translation>Execute command when the best block changes (%s in cmd is replaced by block hash)</translation> - </message> - <message> - <location line="+185"/> - <source>Allow DNS lookups for -addnode, -seednode and -connect</source> - <translation>Allow DNS lookups for -addnode, -seednode and -connect</translation> - </message> - <message> - <location line="-260"/> - <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> + <location line="-191"/> <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+22"/> - <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+26"/> - <source>Do not keep transactions in the mempool longer than <n> hours (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+2"/> - <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+2"/> + <location line="+18"/> <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source> <translation type="unfinished"></translation> </message> <message> - <location line="+2"/> - <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+27"/> - <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> - <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> - <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+15"/> - <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+13"/> - <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+2"/> - <source>Output debugging information (default: %u, supplying <category> is optional)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+34"/> - <source>Set maximum BIP141 block weight to this * 4. Deprecated, use blockmaxweight</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+5"/> - <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> - <source>Specify directory to hold wallets (default: <datadir>/wallets if it exists, otherwise <datadir>)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> - <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> - <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+7"/> - <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+13"/> + <location line="+40"/> <source>This is the transaction fee you may pay when fee estimates are not available.</source> <translation type="unfinished"></translation> </message> @@ -5045,11 +4577,6 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source> - <translation type="unfinished"></translation> - </message> - <message> <location line="+9"/> <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source> <translation type="unfinished"></translation> @@ -5060,12 +4587,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+5"/> - <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+15"/> + <location line="+8"/> <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source> <translation type="unfinished"></translation> </message> @@ -5075,187 +4597,92 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+9"/> - <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+11"/> + <location line="+12"/> <source>%s is set very high!</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>(default: %s)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+8"/> - <source>Always query for peer addresses via DNS lookup (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+31"/> - <source>Error loading wallet %s. -wallet filename must be a regular file.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> + <location line="+19"/> <source>Error loading wallet %s. Duplicate -wallet filename specified.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Error loading wallet %s. Invalid characters in -wallet filename.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+10"/> - <source>How many blocks to check at startup (default: %u, 0 = all)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> - <source>Include IP addresses in debug output (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+14"/> + <location line="+21"/> <source>Keypool ran out, please call keypoolrefill first</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Listen for connections on <port> (default: %u or testnet: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+6"/> - <source>Maintain at most <n> connections to peers (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Make the wallet broadcast transactions</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Maximum per-connection send buffer, <n>*1000 bytes (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+7"/> - <source>Prepend debug output with timestamp (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+10"/> - <source>Relay and mine data carrier transactions (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Relay non-P2SH multisig (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+9"/> - <source>Set key pool size to <n> (default: %u)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Set maximum BIP141 block weight (default: %d)</source> + <location line="+19"/> + <source>Starting network threads...</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Set the number of threads to service RPC calls (default: %d)</source> + <location line="+3"/> + <source>The wallet will avoid paying less than the minimum relay fee.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+7"/> - <source>Specify configuration file (default: %s)</source> + <location line="+2"/> + <source>This is the minimum transaction fee you pay on every transaction.</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> - <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source> + <source>This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> - <source>Specify pid file (default: %s)</source> + <source>Transaction amounts must not be negative</source> <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Spend unconfirmed change when sending transactions (default: %u)</source> + <location line="+2"/> + <source>Transaction has too long of a mempool chain</source> <translation type="unfinished"></translation> </message> <message> <location line="+1"/> - <source>Starting network threads...</source> + <source>Transaction must have at least one recipient</source> <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>The wallet will avoid paying less than the minimum relay fee.</source> - <translation type="unfinished"></translation> + <location line="+8"/> + <source>Unknown network specified in -onlynet: '%s'</source> + <translation>Unknown network specified in -onlynet: '%s'</translation> </message> <message> - <location line="+2"/> - <source>This is the minimum transaction fee you pay on every transaction.</source> - <translation type="unfinished"></translation> + <location line="-46"/> + <source>Insufficient funds</source> + <translation>Insufficient funds</translation> </message> <message> - <location line="+1"/> - <source>This is the transaction fee you will pay if you send a transaction.</source> + <location line="-128"/> + <source>Can't generate a change-address key. Private keys are disabled for this wallet.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Threshold for disconnecting misbehaving peers (default: %u)</source> + <location line="+8"/> + <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> <message> - <location line="+4"/> - <source>Transaction amounts must not be negative</source> + <location line="+14"/> + <source>Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+2"/> - <source>Transaction has too long of a mempool chain</source> + <location line="+54"/> + <source>Warning: Private keys detected in wallet {%s} with disabled private keys</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Transaction must have at least one recipient</source> + <location line="+24"/> + <source>Cannot write to data directory '%s'; check permissions.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+7"/> - <source>Unknown network specified in -onlynet: '%s'</source> - <translation>Unknown network specified in -onlynet: '%s'</translation> - </message> - <message> - <location line="-85"/> - <source>Insufficient funds</source> - <translation>Insufficient funds</translation> - </message> - <message> - <location line="+15"/> + <location line="+39"/> <source>Loading block index...</source> <translation>Loading block index...</translation> </message> @@ -5265,22 +4692,22 @@ <translation>Loading wallet...</translation> </message> <message> - <location line="-61"/> + <location line="-42"/> <source>Cannot downgrade wallet</source> <translation>Cannot downgrade wallet</translation> </message> <message> - <location line="+87"/> + <location line="+50"/> <source>Rescanning...</source> <translation>Rescanning...</translation> </message> <message> - <location line="-75"/> + <location line="-43"/> <source>Done loading</source> <translation>Done loading</translation> </message> <message> - <location line="+20"/> + <location line="+14"/> <source>Error</source> <translation>Error</translation> </message> diff --git a/src/qt/macdockiconhandler.mm b/src/qt/macdockiconhandler.mm index 9e7de0f98f..b9ad191da7 100644 --- a/src/qt/macdockiconhandler.mm +++ b/src/qt/macdockiconhandler.mm @@ -14,18 +14,14 @@ #include <objc/objc.h> #include <objc/message.h> -#if QT_VERSION < 0x050000 -extern void qt_mac_set_dock_menu(QMenu *); -#endif - static MacDockIconHandler *s_instance = nullptr; bool dockClickHandler(id self,SEL _cmd,...) { Q_UNUSED(self) Q_UNUSED(_cmd) - + s_instance->handleDockIconClickEvent(); - + // Return NO (false) to suppress the default OS X actions return false; } @@ -33,7 +29,7 @@ bool dockClickHandler(id self,SEL _cmd,...) { void setupDockClickHandler() { Class cls = objc_getClass("NSApplication"); id appInst = objc_msgSend((id)cls, sel_registerName("sharedApplication")); - + if (appInst != nullptr) { id delegate = objc_msgSend(appInst, sel_registerName("delegate")); Class delClass = (Class)objc_msgSend(delegate, sel_registerName("class")); @@ -54,9 +50,7 @@ MacDockIconHandler::MacDockIconHandler() : QObject() this->m_dummyWidget = new QWidget(); this->m_dockMenu = new QMenu(this->m_dummyWidget); this->setMainWindow(nullptr); -#if QT_VERSION < 0x050000 - qt_mac_set_dock_menu(this->m_dockMenu); -#elif QT_VERSION >= 0x050200 +#if QT_VERSION >= 0x050200 this->m_dockMenu->setAsDockMenu(); #endif [pool release]; diff --git a/src/qt/macnotificationhandler.mm b/src/qt/macnotificationhandler.mm index 1b16c5f524..0e04d50baa 100644 --- a/src/qt/macnotificationhandler.mm +++ b/src/qt/macnotificationhandler.mm @@ -64,7 +64,7 @@ MacNotificationHandler *MacNotificationHandler::instance() static MacNotificationHandler *s_instance = nullptr; if (!s_instance) { s_instance = new MacNotificationHandler(); - + Class aPossibleClass = objc_getClass("NSBundle"); if (aPossibleClass) { // change NSBundle -bundleIdentifier method to return a correct bundle identifier diff --git a/src/qt/modaloverlay.cpp b/src/qt/modaloverlay.cpp index 249418213f..e9d03c5828 100644 --- a/src/qt/modaloverlay.cpp +++ b/src/qt/modaloverlay.cpp @@ -104,7 +104,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri ui->progressIncreasePerH->setText(QString::number(progressPerHour * 100, 'f', 2)+"%"); // show expected remaining time - if(remainingMSecs >= 0) { + if(remainingMSecs >= 0) { ui->expectedTimeLeft->setText(GUIUtil::formatNiceTimeOffset(remainingMSecs / 1000.0)); } else { ui->expectedTimeLeft->setText(QObject::tr("unknown")); diff --git a/src/qt/networkstyle.cpp b/src/qt/networkstyle.cpp index 2816633b0f..c4b732e3e0 100644 --- a/src/qt/networkstyle.cpp +++ b/src/qt/networkstyle.cpp @@ -68,11 +68,7 @@ NetworkStyle::NetworkStyle(const QString &_appName, const int iconColorHueShift, } //convert back to QPixmap -#if QT_VERSION >= 0x040700 pixmap.convertFromImage(img); -#else - pixmap = QPixmap::fromImage(img); -#endif } appIcon = QIcon(pixmap); diff --git a/src/qt/openuridialog.cpp b/src/qt/openuridialog.cpp index 751cfa8b43..d211f908c8 100644 --- a/src/qt/openuridialog.cpp +++ b/src/qt/openuridialog.cpp @@ -15,9 +15,7 @@ OpenURIDialog::OpenURIDialog(QWidget *parent) : ui(new Ui::OpenURIDialog) { ui->setupUi(this); -#if QT_VERSION >= 0x040700 ui->uriEdit->setPlaceholderText("bitcoin:"); -#endif } OpenURIDialog::~OpenURIDialog() diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index c0ddb89b40..a57343f036 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -36,8 +36,17 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) : /* Main elements init */ ui->databaseCache->setMinimum(nMinDbCache); ui->databaseCache->setMaximum(nMaxDbCache); + static const uint64_t GiB = 1024 * 1024 * 1024; + static const uint64_t nMinDiskSpace = MIN_DISK_SPACE_FOR_BLOCK_FILES / GiB + + (MIN_DISK_SPACE_FOR_BLOCK_FILES % GiB) ? 1 : 0; + ui->pruneSize->setMinimum(nMinDiskSpace); ui->threadsScriptVerif->setMinimum(-GetNumCores()); ui->threadsScriptVerif->setMaximum(MAX_SCRIPTCHECK_THREADS); + ui->pruneWarning->setVisible(false); + ui->pruneWarning->setStyleSheet("QLabel { color: red; }"); + + ui->pruneSize->setEnabled(false); + connect(ui->prune, SIGNAL(toggled(bool)), ui->pruneSize, SLOT(setEnabled(bool))); /* Network elements init */ #ifndef USE_UPNP @@ -88,28 +97,16 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) : /** check if the locale name consists of 2 parts (language_country) */ if(langStr.contains("_")) { -#if QT_VERSION >= 0x040800 /** display language strings as "native language - native country (locale name)", e.g. "Deutsch - Deutschland (de)" */ ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr)); -#else - /** display language strings as "language - country (locale name)", e.g. "German - Germany (de)" */ - ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" - ") + QLocale::countryToString(locale.country()) + QString(" (") + langStr + QString(")"), QVariant(langStr)); -#endif } else { -#if QT_VERSION >= 0x040800 /** display language strings as "native language (locale name)", e.g. "Deutsch (de)" */ ui->lang->addItem(locale.nativeLanguageName() + QString(" (") + langStr + QString(")"), QVariant(langStr)); -#else - /** display language strings as "language (locale name)", e.g. "German (de)" */ - ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" (") + langStr + QString(")"), QVariant(langStr)); -#endif } } -#if QT_VERSION >= 0x040700 ui->thirdPartyTxUrls->setPlaceholderText("https://example.com/tx/%s"); -#endif ui->unit->setModel(new BitcoinUnits(this)); @@ -157,6 +154,9 @@ void OptionsDialog::setModel(OptionsModel *_model) /* warn when one of the following settings changes by user action (placed here so init via mapper doesn't trigger them) */ /* Main */ + connect(ui->prune, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning())); + connect(ui->prune, SIGNAL(clicked(bool)), this, SLOT(togglePruneWarning(bool))); + connect(ui->pruneSize, SIGNAL(valueChanged(int)), this, SLOT(showRestartWarning())); connect(ui->databaseCache, SIGNAL(valueChanged(int)), this, SLOT(showRestartWarning())); connect(ui->threadsScriptVerif, SIGNAL(valueChanged(int)), this, SLOT(showRestartWarning())); /* Wallet */ @@ -176,6 +176,8 @@ void OptionsDialog::setMapper() mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup); mapper->addMapping(ui->threadsScriptVerif, OptionsModel::ThreadsScriptVerif); mapper->addMapping(ui->databaseCache, OptionsModel::DatabaseCache); + mapper->addMapping(ui->prune, OptionsModel::Prune); + mapper->addMapping(ui->pruneSize, OptionsModel::PruneSize); /* Wallet */ mapper->addMapping(ui->spendZeroConfChange, OptionsModel::SpendZeroConfChange); @@ -266,6 +268,11 @@ void OptionsDialog::on_hideTrayIcon_stateChanged(int fState) } } +void OptionsDialog::togglePruneWarning(bool enabled) +{ + ui->pruneWarning->setVisible(!ui->pruneWarning->isVisible()); +} + void OptionsDialog::showRestartWarning(bool fPersistent) { ui->statusLabel->setStyleSheet("QLabel { color: red; }"); @@ -324,7 +331,7 @@ void OptionsDialog::updateDefaultProxyNets() strDefaultProxyGUI = ui->proxyIp->text() + ":" + ui->proxyPort->text(); (strProxy == strDefaultProxyGUI.toStdString()) ? ui->proxyReachIPv6->setChecked(true) : ui->proxyReachIPv6->setChecked(false); - model->node().getProxy(NET_TOR, proxy); + model->node().getProxy(NET_ONION, proxy); strProxy = proxy.proxy.ToStringIP() + ":" + proxy.proxy.ToStringPort(); strDefaultProxyGUI = ui->proxyIp->text() + ":" + ui->proxyPort->text(); (strProxy == strDefaultProxyGUI.toStdString()) ? ui->proxyReachTor->setChecked(true) : ui->proxyReachTor->setChecked(false); diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index faf9ff8959..54e1a8a9b1 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -50,9 +50,10 @@ private Q_SLOTS: void on_openBitcoinConfButton_clicked(); void on_okButton_clicked(); void on_cancelButton_clicked(); - + void on_hideTrayIcon_stateChanged(int fState); + void togglePruneWarning(bool enabled); void showRestartWarning(bool fPersistent = false); void clearStatusLabel(); void updateProxyValidationState(); diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index cae9dace4c..834ff7633c 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -57,7 +57,7 @@ void OptionsModel::Init(bool resetSettings) settings.setValue("fHideTrayIcon", false); fHideTrayIcon = settings.value("fHideTrayIcon").toBool(); Q_EMIT hideTrayIconChanged(fHideTrayIcon); - + if (!settings.contains("fMinimizeToTray")) settings.setValue("fMinimizeToTray", false); fMinimizeToTray = settings.value("fMinimizeToTray").toBool() && !fHideTrayIcon; @@ -88,6 +88,16 @@ void OptionsModel::Init(bool resetSettings) // by command-line and show this in the UI. // Main + if (!settings.contains("bPrune")) + settings.setValue("bPrune", false); + if (!settings.contains("nPruneSize")) + settings.setValue("nPruneSize", 2); + // Convert prune size to MB: + const uint64_t nPruneSizeMB = settings.value("nPruneSize").toInt() * 1000; + if (!m_node.softSetArg("-prune", settings.value("bPrune").toBool() ? std::to_string(nPruneSizeMB) : "0")) { + addOverriddenOption("-prune"); + } + if (!settings.contains("nDatabaseCache")) settings.setValue("nDatabaseCache", (qint64)nDefaultDbCache); if (!m_node.softSetArg("-dbcache", settings.value("nDatabaseCache").toString().toStdString())) @@ -281,6 +291,10 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return settings.value("language"); case CoinControlFeatures: return fCoinControlFeatures; + case Prune: + return settings.value("bPrune"); + case PruneSize: + return settings.value("nPruneSize"); case DatabaseCache: return settings.value("nDatabaseCache"); case ThreadsScriptVerif: @@ -405,6 +419,18 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in settings.setValue("fCoinControlFeatures", fCoinControlFeatures); Q_EMIT coinControlFeaturesChanged(fCoinControlFeatures); break; + case Prune: + if (settings.value("bPrune") != value) { + settings.setValue("bPrune", value); + setRestartRequired(true); + } + break; + case PruneSize: + if (settings.value("nPruneSize") != value) { + settings.setValue("nPruneSize", value); + setRestartRequired(true); + } + break; case DatabaseCache: if (settings.value("nDatabaseCache") != value) { settings.setValue("nDatabaseCache", value); diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index fc1d119a71..2777cbeaf2 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -50,6 +50,8 @@ public: Language, // QString CoinControlFeatures, // bool ThreadsScriptVerif, // int + Prune, // bool + PruneSize, // int DatabaseCache, // int SpendZeroConfChange, // bool Listen, // bool diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp index b0ef475b35..dfeb70d669 100644 --- a/src/qt/paymentrequestplus.cpp +++ b/src/qt/paymentrequestplus.cpp @@ -97,12 +97,10 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c qWarning() << "PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active: " << qCert; return false; } -#if QT_VERSION >= 0x050000 if (qCert.isBlacklisted()) { qWarning() << "PaymentRequestPlus::getMerchant: Payment request: certificate blacklisted: " << qCert; return false; } -#endif const unsigned char *data = (const unsigned char *)certChain.certificate(i).data(); X509 *cert = d2i_X509(nullptr, &data, certChain.certificate(i).size()); if (cert) diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 70cdb3361c..e5e6430959 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -41,12 +41,7 @@ #include <QSslSocket> #include <QStringList> #include <QTextDocument> - -#if QT_VERSION < 0x050000 -#include <QUrl> -#else #include <QUrlQuery> -#endif const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds const QString BITCOIN_IPC_PREFIX("bitcoin:"); @@ -100,11 +95,7 @@ static QList<QString> savedPaymentRequests; static void ReportInvalidCertificate(const QSslCertificate& cert) { -#if QT_VERSION < 0x050000 - qDebug() << QString("%1: Payment server found an invalid certificate: ").arg(__func__) << cert.serialNumber() << cert.subjectInfo(QSslCertificate::CommonName) << cert.subjectInfo(QSslCertificate::OrganizationalUnitName); -#else qDebug() << QString("%1: Payment server found an invalid certificate: ").arg(__func__) << cert.serialNumber() << cert.subjectInfo(QSslCertificate::CommonName) << cert.subjectInfo(QSslCertificate::DistinguishedNameQualifier) << cert.subjectInfo(QSslCertificate::OrganizationalUnitName); -#endif } // @@ -157,13 +148,11 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store) continue; } -#if QT_VERSION >= 0x050000 // Blacklisted certificate if (cert.isBlacklisted()) { ReportInvalidCertificate(cert); continue; } -#endif QByteArray certData = cert.toDer(); const unsigned char *data = (const unsigned char *)certData.data(); @@ -413,11 +402,7 @@ void PaymentServer::handleURIOrFile(const QString& s) } else if (s.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // bitcoin: URI { -#if QT_VERSION < 0x050000 - QUrl uri(s); -#else QUrlQuery uri((QUrl(s))); -#endif if (uri.hasQueryItem("r")) // payment request URI { QByteArray temp; @@ -648,7 +633,7 @@ void PaymentServer::fetchPaymentACK(WalletModel* walletModel, const SendCoinsRec // 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::NONE ? walletModel->wallet().getDefaultChangeType() : walletModel->wallet().getDefaultAddressType(); + 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(); diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 7e318e3035..1c90504e9e 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -64,9 +64,7 @@ public: interfaces::Node::NodesStats nodes_stats; node.getNodesStats(nodes_stats); -#if QT_VERSION >= 0x040700 cachedNodeStats.reserve(nodes_stats.size()); -#endif for (auto& node_stats : nodes_stats) { CNodeCombinedStats stats; @@ -162,7 +160,8 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const case NetNodeId: return (qint64)rec->nodeStats.nodeid; case Address: - return QString::fromStdString(rec->nodeStats.addrName); + // prepend to peer address down-arrow symbol for inbound connection and up-arrow for outbound connection + return QString(rec->nodeStats.fInbound ? "↓ " : "↑ ") + QString::fromStdString(rec->nodeStats.addrName); case Subversion: return QString::fromStdString(rec->nodeStats.cleanSubVer); case Ping: diff --git a/src/qt/platformstyle.cpp b/src/qt/platformstyle.cpp index fce71f661a..a3a10aac18 100644 --- a/src/qt/platformstyle.cpp +++ b/src/qt/platformstyle.cpp @@ -46,7 +46,7 @@ void MakeSingleColorImage(QImage& img, const QColor& colorbase) QIcon ColorizeIcon(const QIcon& ico, const QColor& colorbase) { QIcon new_ico; - for (const QSize sz : ico.availableSizes()) + for (const QSize& sz : ico.availableSizes()) { QImage img(ico.pixmap(sz).toImage()); MakeSingleColorImage(img, colorbase); diff --git a/src/qt/qvalidatedlineedit.h b/src/qt/qvalidatedlineedit.h index 66734cc9d4..9ad9e66ae2 100644 --- a/src/qt/qvalidatedlineedit.h +++ b/src/qt/qvalidatedlineedit.h @@ -34,7 +34,7 @@ public Q_SLOTS: Q_SIGNALS: void validationDidChange(QValidatedLineEdit *validatedLineEdit); - + private Q_SLOTS: void markValid(); void checkValidity(); diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp index 70e11f0296..8c430e0af1 100644 --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -94,14 +94,14 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model) // Last 2 columns are set by the columnResizingFixer, when the table geometry is ready. columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(tableView, AMOUNT_MINIMUM_COLUMN_WIDTH, DATE_COLUMN_WIDTH, this); - // configure bech32 checkbox, disable if launched with legacy as default: if (model->wallet().getDefaultAddressType() == OutputType::BECH32) { ui->useBech32->setCheckState(Qt::Checked); } else { ui->useBech32->setCheckState(Qt::Unchecked); } - ui->useBech32->setVisible(model->wallet().getDefaultAddressType() != OutputType::LEGACY); + // eventually disable the main receive button if private key operations are disabled + ui->receiveButton->setEnabled(!model->privateKeysDisabled()); } } @@ -144,9 +144,14 @@ void ReceiveCoinsDialog::on_receiveButton_clicked() QString address; QString label = ui->reqLabel->text(); /* Generate new receiving address */ - OutputType address_type = model->wallet().getDefaultAddressType(); - if (address_type != OutputType::LEGACY) { - address_type = ui->useBech32->isChecked() ? OutputType::BECH32 : OutputType::P2SH_SEGWIT; + OutputType address_type; + if (ui->useBech32->isChecked()) { + address_type = OutputType::BECH32; + } else { + address_type = model->wallet().getDefaultAddressType(); + if (address_type == OutputType::BECH32) { + address_type = OutputType::P2SH_SEGWIT; + } } address = model->getAddressTableModel()->addRow(AddressTableModel::Receive, label, "", address_type); SendCoinsRecipient info(address, label, diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp index 75146e2214..f9610f2d3b 100644 --- a/src/qt/receiverequestdialog.cpp +++ b/src/qt/receiverequestdialog.cpp @@ -16,9 +16,6 @@ #include <QMimeData> #include <QMouseEvent> #include <QPixmap> -#if QT_VERSION < 0x050000 -#include <QUrl> -#endif #if defined(HAVE_CONFIG_H) #include <config/bitcoin-config.h> /* for USE_QRCODE */ diff --git a/src/qt/res/icons/proxy.png b/src/qt/res/icons/proxy.png Binary files differnew file mode 100644 index 0000000000..67c552d0de --- /dev/null +++ b/src/qt/res/icons/proxy.png diff --git a/src/qt/res/movies/makespinner.sh b/src/qt/res/movies/makespinner.sh index d0deb1238c..76e36e4f31 100755 --- a/src/qt/res/movies/makespinner.sh +++ b/src/qt/res/movies/makespinner.sh @@ -2,6 +2,7 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. +export LC_ALL=C FRAMEDIR=$(dirname $0) for i in {0..35} do diff --git a/src/qt/res/src/proxy.svg b/src/qt/res/src/proxy.svg new file mode 100644 index 0000000000..b42fa63948 --- /dev/null +++ b/src/qt/res/src/proxy.svg @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="128px" + height="128px" + id="svg2991" + version="1.1" + inkscape:version="0.48.4 r9939" + sodipodi:docname="proxy.svg" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"> + <defs + id="defs2993" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="3.8890872" + inkscape:cx="4.0410731" + inkscape:cy="31.916897" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:document-units="px" + inkscape:grid-bbox="true" + inkscape:window-width="1920" + inkscape:window-height="1056" + inkscape:window-x="0" + inkscape:window-y="24" + inkscape:window-maximized="1" /> + <metadata + id="metadata2996"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <text + xml:space="preserve" + style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" + x="26.981934" + y="110.45972" + id="text2999" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan3001" + x="26.981934" + y="110.45972" + style="font-size:111px">P</tspan></text> + </g> +</svg> diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 5122bab36f..f222357f27 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -40,10 +40,6 @@ #include <QTimer> #include <QStringList> -#if QT_VERSION < 0x050000 -#include <QUrl> -#endif - // TODO: add a scrollback limit, as there is currently none // TODO: make it possible to filter out categories (esp debug messages when implemented) // TODO: receive errors and debug messages through ClientModel @@ -70,6 +66,7 @@ namespace { const QStringList historyFilter = QStringList() << "importprivkey" << "importmulti" + << "sethdseed" << "signmessagewithprivkey" << "signrawtransaction" << "signrawtransactionwithkey" @@ -311,7 +308,7 @@ bool RPCConsole::RPCParseCommandLine(interfaces::Node* node, std::string &strRes std::string method = stack.back()[0]; std::string uri; #ifdef ENABLE_WALLET - if (walletID && !walletID->empty()) { + if (walletID) { QByteArray encodedName = QUrl::toPercentEncoding(QString::fromStdString(*walletID)); uri = "/wallet/"+std::string(encodedName.constData(), encodedName.length()); } @@ -424,7 +421,7 @@ void RPCExecutor::request(const QString &command, const QString &walletID) return; } std::string wallet_id = walletID.toStdString(); - if(!RPCConsole::RPCExecuteCommandLine(m_node, result, executableCommand, nullptr, &wallet_id)) + if (!RPCConsole::RPCExecuteCommandLine(m_node, result, executableCommand, nullptr, walletID.isNull() ? nullptr : &wallet_id)) { Q_EMIT reply(RPCConsole::CMD_ERROR, QString("Parse error: unbalanced ' or \"")); return; @@ -455,12 +452,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty QWidget(parent), m_node(node), ui(new Ui::RPCConsole), - clientModel(0), - historyPtr(0), - platformStyle(_platformStyle), - peersTableContextMenu(0), - banTableContextMenu(0), - consoleFontSize(0) + platformStyle(_platformStyle) { ui->setupUi(this); QSettings settings; @@ -706,7 +698,8 @@ void RPCConsole::addWallet(WalletModel * const walletModel) { const QString name = walletModel->getWalletName(); // use name for text and internal data object (to allow to move to a wallet id later) - ui->WalletSelector->addItem(name, name); + QString display_name = name.isEmpty() ? "["+tr("default wallet")+"]" : name; + ui->WalletSelector->addItem(display_name, name); if (ui->WalletSelector->count() == 2 && !isVisible()) { // First wallet added, set to default so long as the window isn't presently visible (and potentially in use) ui->WalletSelector->setCurrentIndex(1); @@ -716,6 +709,16 @@ void RPCConsole::addWallet(WalletModel * const walletModel) ui->WalletSelectorLabel->setVisible(true); } } + +void RPCConsole::removeWallet(WalletModel * const walletModel) +{ + const QString name = walletModel->getWalletName(); + ui->WalletSelector->removeItem(ui->WalletSelector->findData(name)); + if (ui->WalletSelector->count() == 2) { + ui->WalletSelector->setVisible(false); + ui->WalletSelectorLabel->setVisible(false); + } +} #endif static QString categoryClass(int category) @@ -913,7 +916,7 @@ void RPCConsole::on_lineEdit_returnPressed() } if (m_last_wallet_id != walletID) { - if (walletID.isEmpty()) { + if (walletID.isNull()) { message(CMD_REQUEST, tr("Executing command without any wallet")); } else { message(CMD_REQUEST, tr("Executing command using \"%1\" wallet").arg(walletID)); diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index a9a60d09f1..0a1a469934 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -48,6 +48,7 @@ public: void setClientModel(ClientModel *model); void addWallet(WalletModel * const walletModel); + void removeWallet(WalletModel* const walletModel); enum MessageClass { MC_ERROR, @@ -145,18 +146,18 @@ private: }; interfaces::Node& m_node; - Ui::RPCConsole *ui; - ClientModel *clientModel; + Ui::RPCConsole* const ui; + ClientModel *clientModel = nullptr; QStringList history; - int historyPtr; + int historyPtr = 0; QString cmdBeforeBrowsing; QList<NodeId> cachedNodeids; - const PlatformStyle *platformStyle; - RPCTimerInterface *rpcTimerInterface; - QMenu *peersTableContextMenu; - QMenu *banTableContextMenu; - int consoleFontSize; - QCompleter *autoCompleter; + const PlatformStyle* const platformStyle; + RPCTimerInterface *rpcTimerInterface = nullptr; + QMenu *peersTableContextMenu = nullptr; + QMenu *banTableContextMenu = nullptr; + int consoleFontSize = 0; + QCompleter *autoCompleter = nullptr; QThread thread; QString m_last_wallet_id; diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 261ab7a948..5c946f7c77 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -288,44 +288,60 @@ void SendCoinsDialog::on_sendButton_clicked() address.append("</span>"); QString recipientElement; + recipientElement = "<br />"; if (!rcp.paymentRequest.IsInitialized()) // normal payment { if(rcp.label.length() > 0) // label with address { - recipientElement = tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.label)); + recipientElement.append(tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.label))); recipientElement.append(QString(" (%1)").arg(address)); } else // just address { - recipientElement = tr("%1 to %2").arg(amount, address); + recipientElement.append(tr("%1 to %2").arg(amount, address)); } } else if(!rcp.authenticatedMerchant.isEmpty()) // authenticated payment request { - recipientElement = tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.authenticatedMerchant)); + recipientElement.append(tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.authenticatedMerchant))); } else // unauthenticated payment request { - recipientElement = tr("%1 to %2").arg(amount, address); + recipientElement.append(tr("%1 to %2").arg(amount, address)); } formatted.append(recipientElement); } QString questionString = tr("Are you sure you want to send?"); - questionString.append("<br /><br />%1"); + questionString.append("<br /><span style='font-size:10pt;'>"); + questionString.append(tr("Please, review your transaction.")); + questionString.append("</span><br />%1"); if(txFee > 0) { // append fee string if a fee is required - questionString.append("<hr /><span style='color:#aa0000;'>"); - questionString.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee)); - questionString.append("</span> "); - questionString.append(tr("added as transaction fee")); + questionString.append("<hr /><b>"); + questionString.append(tr("Transaction fee")); + questionString.append("</b>"); // append transaction size - questionString.append(" (" + QString::number((double)currentTransaction.getTransactionSize() / 1000) + " kB)"); + questionString.append(" (" + QString::number((double)currentTransaction.getTransactionSize() / 1000) + " kB): "); + + // append transaction fee value + questionString.append("<span style='color:#aa0000; font-weight:bold;'>"); + questionString.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee)); + questionString.append("</span><br />"); + + // append RBF message according to transaction's signalling + questionString.append("<span style='font-size:10pt; font-weight:normal;'>"); + if (ui->optInRBF->isChecked()) { + questionString.append(tr("You can increase the fee later (signals Replace-By-Fee, BIP-125).")); + } else { + questionString.append(tr("Not signalling Replace-By-Fee, BIP-125.")); + } + questionString.append("</span>"); } // add total amount in all subdivision units @@ -337,19 +353,10 @@ void SendCoinsDialog::on_sendButton_clicked() if(u != model->getOptionsModel()->getDisplayUnit()) alternativeUnits.append(BitcoinUnits::formatHtmlWithUnit(u, totalAmount)); } - questionString.append(tr("Total Amount %1") + questionString.append(QString("<b>%1</b>: <b>%2</b>").arg(tr("Total Amount")) .arg(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), totalAmount))); - questionString.append(QString("<span style='font-size:10pt;font-weight:normal;'><br />(=%1)</span>") - .arg(alternativeUnits.join(" " + tr("or") + "<br />"))); - - questionString.append("<hr /><span>"); - if (ui->optInRBF->isChecked()) { - questionString.append(tr("You can increase the fee later (signals Replace-By-Fee, BIP-125).")); - } else { - questionString.append(tr("Not signalling Replace-By-Fee, BIP-125.")); - } - questionString.append("</span>"); - + questionString.append(QString("<br /><span style='font-size:10pt; font-weight:normal;'>(=%1)</span>") + .arg(alternativeUnits.join(" " + tr("or") + " "))); SendConfirmationDialog confirmationDialog(tr("Confirm send coins"), questionString.arg(formatted.join("<br />")), SEND_CONFIRM_DELAY, this); diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index 977425f7e3..e8c85bc2a1 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -32,9 +32,7 @@ SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *par if (platformStyle->getUseExtraSpacing()) ui->payToLayout->setSpacing(4); -#if QT_VERSION >= 0x040700 ui->addAsLabel->setPlaceholderText(tr("Enter a label for this address to add it to your address book")); -#endif // normal bitcoin address field GUIUtil::setupAddressWidget(ui->payTo, this); diff --git a/src/qt/signverifymessagedialog.cpp b/src/qt/signverifymessagedialog.cpp index 94a3ad7987..223b39dc86 100644 --- a/src/qt/signverifymessagedialog.cpp +++ b/src/qt/signverifymessagedialog.cpp @@ -10,7 +10,6 @@ #include <qt/platformstyle.h> #include <qt/walletmodel.h> -#include <init.h> #include <key_io.h> #include <validation.h> // For strMessageMagic #include <wallet/wallet.h> @@ -37,9 +36,7 @@ SignVerifyMessageDialog::SignVerifyMessageDialog(const PlatformStyle *_platformS ui->verifyMessageButton_VM->setIcon(platformStyle->SingleColorIcon(":/icons/transaction_0")); ui->clearButton_VM->setIcon(platformStyle->SingleColorIcon(":/icons/remove")); -#if QT_VERSION >= 0x040700 ui->signatureOut_SM->setPlaceholderText(tr("Click \"Sign Message\" to generate signature")); -#endif GUIUtil::setupAddressWidget(ui->addressIn_SM, this); GUIUtil::setupAddressWidget(ui->addressIn_VM, this); diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 4d972b431c..831ef68cab 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -11,7 +11,6 @@ #include <qt/networkstyle.h> #include <clientversion.h> -#include <init.h> #include <interfaces/handler.h> #include <interfaces/node.h> #include <interfaces/wallet.h> diff --git a/src/qt/test/addressbooktests.cpp b/src/qt/test/addressbooktests.cpp index 0c2e7ae71d..c3d33c76d4 100644 --- a/src/qt/test/addressbooktests.cpp +++ b/src/qt/test/addressbooktests.cpp @@ -56,15 +56,15 @@ void EditAddressAndSubmit( void TestAddAddressesToSendBook() { TestChain100Setup test; - CWallet wallet("mock", WalletDatabase::CreateMock()); + std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>("mock", WalletDatabase::CreateMock()); bool firstRun; - wallet.LoadWallet(firstRun); + wallet->LoadWallet(firstRun); auto build_address = [&wallet]() { CKey key; key.MakeNewKey(true); CTxDestination dest(GetDestinationForKey( - key.GetPubKey(), wallet.m_default_address_type)); + key.GetPubKey(), wallet->m_default_address_type)); return std::make_pair(dest, QString::fromStdString(EncodeDestination(dest))); }; @@ -87,13 +87,13 @@ void TestAddAddressesToSendBook() std::tie(std::ignore, new_address) = build_address(); { - LOCK(wallet.cs_wallet); - wallet.SetAddressBook(r_key_dest, r_label.toStdString(), "receive"); - wallet.SetAddressBook(s_key_dest, s_label.toStdString(), "send"); + LOCK(wallet->cs_wallet); + wallet->SetAddressBook(r_key_dest, r_label.toStdString(), "receive"); + wallet->SetAddressBook(s_key_dest, s_label.toStdString(), "send"); } auto check_addbook_size = [&wallet](int expected_size) { - QCOMPARE(static_cast<int>(wallet.mapAddressBook.size()), expected_size); + QCOMPARE(static_cast<int>(wallet->mapAddressBook.size()), expected_size); }; // We should start with the two addresses we added earlier and nothing else. @@ -103,9 +103,9 @@ void TestAddAddressesToSendBook() std::unique_ptr<const PlatformStyle> platformStyle(PlatformStyle::instantiate("other")); auto node = interfaces::MakeNode(); OptionsModel optionsModel(*node); - AddWallet(&wallet); + AddWallet(wallet); WalletModel walletModel(std::move(node->getWallets()[0]), *node, platformStyle.get(), &optionsModel); - RemoveWallet(&wallet); + RemoveWallet(wallet); EditAddressDialog editAddressDialog(EditAddressDialog::NewSendingAddress); editAddressDialog.setModel(walletModel.getAddressTableModel()); diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index 56d4d3e457..f0ac43a58c 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -26,12 +26,6 @@ #if defined(QT_STATICPLUGIN) #include <QtPlugin> -#if QT_VERSION < 0x050000 -Q_IMPORT_PLUGIN(qcncodecs) -Q_IMPORT_PLUGIN(qjpcodecs) -Q_IMPORT_PLUGIN(qtwcodecs) -Q_IMPORT_PLUGIN(qkrcodecs) -#else #if defined(QT_QPA_PLATFORM_MINIMAL) Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin); #endif @@ -43,7 +37,6 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); #endif #endif -#endif extern void noui_connect(); diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp index a09d98dfe5..c314dadde4 100644 --- a/src/qt/test/wallettests.cpp +++ b/src/qt/test/wallettests.cpp @@ -87,17 +87,6 @@ QModelIndex FindTx(const QAbstractItemModel& model, const uint256& txid) return {}; } -//! Request context menu (call method that is public in qt5, but protected in qt4). -void RequestContextMenu(QWidget* widget) -{ - class Qt4Hack : public QWidget - { - public: - using QWidget::customContextMenuRequested; - }; - static_cast<Qt4Hack*>(widget)->customContextMenuRequested({}); -} - //! Invoke bumpfee on txid and check results. void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, std::string expectError, bool cancel) { @@ -110,7 +99,7 @@ void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, st QAction* action = view.findChild<QAction*>("bumpFeeAction"); table->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); action->setEnabled(expectDisabled); - RequestContextMenu(table); + table->customContextMenuRequested({}); QCOMPARE(action->isEnabled(), !expectDisabled); action->setEnabled(true); @@ -144,21 +133,21 @@ void TestGUI() for (int i = 0; i < 5; ++i) { test.CreateAndProcessBlock({}, GetScriptForRawPubKey(test.coinbaseKey.GetPubKey())); } - CWallet wallet("mock", WalletDatabase::CreateMock()); + std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>("mock", WalletDatabase::CreateMock()); bool firstRun; - wallet.LoadWallet(firstRun); + wallet->LoadWallet(firstRun); { - LOCK(wallet.cs_wallet); - wallet.SetAddressBook(GetDestinationForKey(test.coinbaseKey.GetPubKey(), wallet.m_default_address_type), "", "receive"); - wallet.AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey()); + LOCK(wallet->cs_wallet); + wallet->SetAddressBook(GetDestinationForKey(test.coinbaseKey.GetPubKey(), wallet->m_default_address_type), "", "receive"); + wallet->AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey()); } { LOCK(cs_main); - WalletRescanReserver reserver(&wallet); + WalletRescanReserver reserver(wallet.get()); reserver.reserve(); - wallet.ScanForWalletTransactions(chainActive.Genesis(), nullptr, reserver, true); + wallet->ScanForWalletTransactions(chainActive.Genesis(), nullptr, reserver, true); } - wallet.SetBroadcastTransactions(true); + wallet->SetBroadcastTransactions(true); // Create widgets for sending coins and listing transactions. std::unique_ptr<const PlatformStyle> platformStyle(PlatformStyle::instantiate("other")); @@ -166,17 +155,17 @@ void TestGUI() TransactionView transactionView(platformStyle.get()); auto node = interfaces::MakeNode(); OptionsModel optionsModel(*node); - AddWallet(&wallet); + AddWallet(wallet); WalletModel walletModel(std::move(node->getWallets().back()), *node, platformStyle.get(), &optionsModel); - RemoveWallet(&wallet); + RemoveWallet(wallet); sendCoinsDialog.setModel(&walletModel); transactionView.setModel(&walletModel); // Send two transactions, and verify they are added to transaction list. TransactionTableModel* transactionTableModel = walletModel.getTransactionTableModel(); QCOMPARE(transactionTableModel->rowCount({}), 105); - uint256 txid1 = SendCoins(wallet, sendCoinsDialog, CKeyID(), 5 * COIN, false /* rbf */); - uint256 txid2 = SendCoins(wallet, sendCoinsDialog, CKeyID(), 10 * COIN, true /* rbf */); + uint256 txid1 = SendCoins(*wallet.get(), sendCoinsDialog, CKeyID(), 5 * COIN, false /* rbf */); + uint256 txid2 = SendCoins(*wallet.get(), sendCoinsDialog, CKeyID(), 10 * COIN, true /* rbf */); QCOMPARE(transactionTableModel->rowCount({}), 107); QVERIFY(FindTx(*transactionTableModel, txid1).isValid()); QVERIFY(FindTx(*transactionTableModel, txid2).isValid()); diff --git a/src/qt/trafficgraphwidget.cpp b/src/qt/trafficgraphwidget.cpp index 5a3b645f65..a5551ec014 100644 --- a/src/qt/trafficgraphwidget.cpp +++ b/src/qt/trafficgraphwidget.cpp @@ -80,7 +80,7 @@ void TrafficGraphWidget::paintEvent(QPaintEvent *) const QString units = tr("KB/s"); const float yMarginText = 2.0; - + // draw lines painter.setPen(axisCol); painter.drawText(XMARGIN, YMARGIN + h - h * val / fMax-yMarginText, QString("%1 %2").arg(val).arg(units)); diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 2cb446c459..8297f75799 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -37,8 +37,6 @@ QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const i int nDepth = status.depth_in_main_chain; if (nDepth < 0) return tr("conflicted with a transaction with %1 confirmations").arg(-nDepth); - else if (adjustedTime - status.time_received > 2 * 60 && status.request_count == 0) - return tr("%1/offline").arg(nDepth); else if (nDepth == 0) return tr("0/unconfirmed, %1").arg((inMempool ? tr("in memory pool") : tr("not in memory pool"))) + (status.is_abandoned ? ", "+tr("abandoned") : ""); else if (nDepth < 6) @@ -68,14 +66,6 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall CAmount nNet = nCredit - nDebit; strHTML += "<b>" + tr("Status") + ":</b> " + FormatTxStatus(wtx, status, inMempool, numBlocks, adjustedTime); - int nRequests = status.request_count; - if (nRequests != -1) - { - if (nRequests == 0) - strHTML += tr(", has not been successfully broadcast yet"); - else if (nRequests > 0) - strHTML += tr(", broadcast through %n node(s)", "", nRequests); - } strHTML += "<br>"; strHTML += "<b>" + tr("Date") + ":</b> " + (nTime ? GUIUtil::dateTimeStr(nTime) : "") + "<br>"; diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index b6ed66ad96..65f5e87d15 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -195,10 +195,6 @@ void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, int if (wtx.is_in_main_chain) { status.matures_in = wtx.blocks_to_maturity; - - // Check if the block was requested by anyone - if (adjustedTime - wtx.time_received > 2 * 60 && wtx.request_count == 0) - status.status = TransactionStatus::MaturesWarning; } else { @@ -216,10 +212,6 @@ void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, int { status.status = TransactionStatus::Conflicted; } - else if (adjustedTime - wtx.time_received > 2 * 60 && wtx.request_count == 0) - { - status.status = TransactionStatus::Offline; - } else if (status.depth == 0) { status.status = TransactionStatus::Unconfirmed; diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index 62961434ed..a6424e74fa 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -25,7 +25,7 @@ class TransactionStatus public: TransactionStatus(): countsForBalance(false), sortKey(""), - matures_in(0), status(Offline), depth(0), open_for(0), cur_num_blocks(-1) + matures_in(0), status(Unconfirmed), depth(0), open_for(0), cur_num_blocks(-1) { } enum Status { @@ -33,14 +33,12 @@ public: /// Normal (sent/received) transactions OpenUntilDate, /**< Transaction not yet final, waiting for date */ OpenUntilBlock, /**< Transaction not yet final, waiting for block */ - Offline, /**< Not sent to any other nodes **/ Unconfirmed, /**< Not yet mined into a block **/ Confirming, /**< Confirmed, but waiting for the recommended number of confirmations **/ Conflicted, /**< Conflicts with other transaction or mempool **/ Abandoned, /**< Abandoned from the wallet **/ /// Generated (mined) transactions Immature, /**< Mined but waiting for maturity */ - MaturesWarning, /**< Transaction will likely not mature because no nodes have confirmed */ NotAccepted /**< Mined but not accepted */ }; diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 46169a91d1..63a4afe191 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -286,9 +286,6 @@ QString TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) cons case TransactionStatus::OpenUntilDate: status = tr("Open until %1").arg(GUIUtil::dateTimeStr(wtx->status.open_for)); break; - case TransactionStatus::Offline: - status = tr("Offline"); - break; case TransactionStatus::Unconfirmed: status = tr("Unconfirmed"); break; @@ -307,9 +304,6 @@ QString TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) cons case TransactionStatus::Immature: status = tr("Immature (%1 confirmations, will be available after %2)").arg(wtx->status.depth).arg(wtx->status.depth + wtx->status.matures_in); break; - case TransactionStatus::MaturesWarning: - status = tr("This block was not received by any other nodes and will probably not be accepted!"); - break; case TransactionStatus::NotAccepted: status = tr("Generated but not accepted"); break; @@ -447,8 +441,6 @@ QVariant TransactionTableModel::txStatusDecoration(const TransactionRecord *wtx) case TransactionStatus::OpenUntilBlock: case TransactionStatus::OpenUntilDate: return COLOR_TX_STATUS_OPENUNTILDATE; - case TransactionStatus::Offline: - return COLOR_TX_STATUS_OFFLINE; case TransactionStatus::Unconfirmed: return QIcon(":/icons/transaction_0"); case TransactionStatus::Abandoned: @@ -471,7 +463,6 @@ QVariant TransactionTableModel::txStatusDecoration(const TransactionRecord *wtx) int part = (wtx->status.depth * 4 / total) + 1; return QIcon(QString(":/icons/transaction_%1").arg(part)); } - case TransactionStatus::MaturesWarning: case TransactionStatus::NotAccepted: return QIcon(":/icons/transaction_0"); default: diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index aa6444245a..e60a387934 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -95,15 +95,11 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa hlayout->addWidget(typeWidget); search_widget = new QLineEdit(this); -#if QT_VERSION >= 0x040700 search_widget->setPlaceholderText(tr("Enter address, transaction id, or label to search")); -#endif hlayout->addWidget(search_widget); amountWidget = new QLineEdit(this); -#if QT_VERSION >= 0x040700 amountWidget->setPlaceholderText(tr("Min amount")); -#endif if (platformStyle->getUseExtraSpacing()) { amountWidget->setFixedWidth(97); } else { diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index d5b98486ae..1da25b0761 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -70,29 +70,15 @@ HelpMessageDialog::HelpMessageDialog(interfaces::Node& node, QWidget *parent, bo ui->helpMessage->setVisible(false); } else { setWindowTitle(tr("Command-line options")); - QString header = tr("Usage:") + "\n" + - " bitcoin-qt [" + tr("command-line options") + "] " + "\n"; + QString header = "Usage:\n" + " bitcoin-qt [command-line options] \n"; QTextCursor cursor(ui->helpMessage->document()); cursor.insertText(version); cursor.insertBlock(); cursor.insertText(header); cursor.insertBlock(); - std::string strUsage = node.helpMessage(HelpMessageMode::BITCOIN_QT); - const bool showDebug = gArgs.GetBoolArg("-help-debug", false); - strUsage += HelpMessageGroup(tr("UI Options:").toStdString()); - if (showDebug) { - strUsage += HelpMessageOpt("-allowselfsignedrootcertificates", strprintf("Allow self signed root certificates (default: %u)", DEFAULT_SELFSIGNED_ROOTCERTS)); - } - strUsage += HelpMessageOpt("-choosedatadir", strprintf(tr("Choose data directory on startup (default: %u)").toStdString(), DEFAULT_CHOOSE_DATADIR)); - strUsage += HelpMessageOpt("-lang=<lang>", tr("Set language, for example \"de_DE\" (default: system locale)").toStdString()); - strUsage += HelpMessageOpt("-min", tr("Start minimized").toStdString()); - strUsage += HelpMessageOpt("-resetguisettings", tr("Reset all settings changed in the GUI").toStdString()); - strUsage += HelpMessageOpt("-rootcertificates=<file>", tr("Set SSL root certificates for payment request (default: -system-)").toStdString()); - strUsage += HelpMessageOpt("-splash", strprintf(tr("Show splash screen on startup (default: %u)").toStdString(), DEFAULT_SPLASHSCREEN)); - if (showDebug) { - strUsage += HelpMessageOpt("-uiplatform", strprintf("Select platform to customize UI for (one of windows, macosx, other; default: %s)", BitcoinGUI::DEFAULT_UIPLATFORM)); - } + std::string strUsage = gArgs.GetHelpMessage(); QString coreOptions = QString::fromStdString(strUsage); text = version + "\n" + header + "\n" + coreOptions; diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp index 5b13353d7b..c5a13f61f4 100644 --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -57,8 +57,13 @@ bool WalletFrame::addWallet(WalletModel *walletModel) walletView->setWalletModel(walletModel); walletView->showOutOfSyncWarning(bOutOfSync); - /* TODO we should goto the currently selected page once dynamically adding wallets is supported */ - walletView->gotoOverviewPage(); + WalletView* current_wallet_view = currentWalletView(); + if (current_wallet_view) { + walletView->setCurrentIndex(current_wallet_view->currentIndex()); + } else { + walletView->gotoOverviewPage(); + } + walletStack->addWidget(walletView); mapWalletViews[name] = walletView; @@ -89,6 +94,7 @@ bool WalletFrame::removeWallet(const QString &name) WalletView *walletView = mapWalletViews.take(name); walletStack->removeWidget(walletView); + delete walletView; return true; } diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 3418b1f1a9..cd55b40b71 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -364,6 +364,12 @@ bool WalletModel::changePassphrase(const SecureString &oldPass, const SecureStri } // Handlers for core signals +static void NotifyUnload(WalletModel* walletModel) +{ + qDebug() << "NotifyUnload"; + QMetaObject::invokeMethod(walletModel, "unload", Qt::QueuedConnection); +} + static void NotifyKeyStoreStatusChanged(WalletModel *walletmodel) { qDebug() << "NotifyKeyStoreStatusChanged"; @@ -411,6 +417,7 @@ static void NotifyWatchonlyChanged(WalletModel *walletmodel, bool fHaveWatchonly void WalletModel::subscribeToCoreSignals() { // Connect signals to wallet + m_handler_unload = m_wallet->handleUnload(boost::bind(&NotifyUnload, this)); m_handler_status_changed = m_wallet->handleStatusChanged(boost::bind(&NotifyKeyStoreStatusChanged, this)); m_handler_address_book_changed = m_wallet->handleAddressBookChanged(boost::bind(NotifyAddressBookChanged, this, _1, _2, _3, _4, _5)); m_handler_transaction_changed = m_wallet->handleTransactionChanged(boost::bind(NotifyTransactionChanged, this, _1, _2)); @@ -421,6 +428,7 @@ void WalletModel::subscribeToCoreSignals() void WalletModel::unsubscribeFromCoreSignals() { // Disconnect signals from wallet + m_handler_unload->disconnect(); m_handler_status_changed->disconnect(); m_handler_address_book_changed->disconnect(); m_handler_transaction_changed->disconnect(); @@ -550,6 +558,11 @@ bool WalletModel::isWalletEnabled() return !gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET); } +bool WalletModel::privateKeysDisabled() const +{ + return m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS); +} + QString WalletModel::getWalletName() const { return QString::fromStdString(m_wallet->getWalletName()); diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 9173fcae52..d8935c2fa8 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -197,6 +197,7 @@ public: bool bumpFee(uint256 hash); static bool isWalletEnabled(); + bool privateKeysDisabled() const; interfaces::Node& node() const { return m_node; } interfaces::Wallet& wallet() const { return *m_wallet; } @@ -208,6 +209,7 @@ public: AddressTableModel* getAddressTableModel() const { return addressTableModel; } private: std::unique_ptr<interfaces::Wallet> m_wallet; + std::unique_ptr<interfaces::Handler> m_handler_unload; std::unique_ptr<interfaces::Handler> m_handler_status_changed; std::unique_ptr<interfaces::Handler> m_handler_address_book_changed; std::unique_ptr<interfaces::Handler> m_handler_transaction_changed; @@ -261,6 +263,9 @@ Q_SIGNALS: // Watch-only address added void notifyWatchonlyChanged(bool fHaveWatchonly); + // Signal that wallet is about to be removed + void unload(); + public Q_SLOTS: /* Wallet status might have changed */ void updateStatus(); diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index d529595dec..c53a2910e5 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -107,7 +107,7 @@ void WalletView::setBitcoinGUI(BitcoinGUI *gui) // Pass through transaction notifications connect(this, SIGNAL(incomingTransaction(QString,int,CAmount,QString,QString,QString,QString)), gui, SLOT(incomingTransaction(QString,int,CAmount,QString,QString,QString,QString))); - // Connect HD enabled state signal + // Connect HD enabled state signal connect(this, SIGNAL(hdEnabledStatusChanged()), gui, SLOT(updateWalletStatus())); } } diff --git a/src/qt/winshutdownmonitor.cpp b/src/qt/winshutdownmonitor.cpp index 1e7a76efc0..122d6f0b12 100644 --- a/src/qt/winshutdownmonitor.cpp +++ b/src/qt/winshutdownmonitor.cpp @@ -4,8 +4,8 @@ #include <qt/winshutdownmonitor.h> -#if defined(Q_OS_WIN) && QT_VERSION >= 0x050000 -#include <init.h> +#if defined(Q_OS_WIN) +#include <shutdown.h> #include <util.h> #include <windows.h> diff --git a/src/qt/winshutdownmonitor.h b/src/qt/winshutdownmonitor.h index 0bed55a2c6..c8a523a538 100644 --- a/src/qt/winshutdownmonitor.h +++ b/src/qt/winshutdownmonitor.h @@ -9,7 +9,6 @@ #include <QByteArray> #include <QString> -#if QT_VERSION >= 0x050000 #include <windef.h> // for HWND #include <QAbstractNativeEventFilter> @@ -24,6 +23,5 @@ public: static void registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId); }; #endif -#endif #endif // BITCOIN_QT_WINSHUTDOWNMONITOR_H |