Page MenuHomePhabricator

D2816.diff
No OneTemporary

D2816.diff

diff --git a/src/interfaces/node.h b/src/interfaces/node.h
--- a/src/interfaces/node.h
+++ b/src/interfaces/node.h
@@ -5,6 +5,7 @@
#ifndef BITCOIN_INTERFACES_NODE_H
#define BITCOIN_INTERFACES_NODE_H
+#include <init.h> // For HelpMessageMode
#include <netaddress.h> // For Network
#include <functional>
@@ -67,6 +68,9 @@
//! Return whether shutdown was requested.
virtual bool shutdownRequested() = 0;
+ //! Get help message string.
+ virtual std::string helpMessage(HelpMessageMode mode) = 0;
+
//! Map port.
virtual void mapPort(bool use_upnp) = 0;
diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp
--- a/src/interfaces/node.cpp
+++ b/src/interfaces/node.cpp
@@ -69,6 +69,9 @@
StopMapPort();
}
}
+ std::string helpMessage(HelpMessageMode mode) override {
+ return HelpMessage(mode);
+ }
bool getProxy(Network net, proxyType &proxy_info) override {
return GetProxy(net, proxy_info);
}
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -649,7 +649,7 @@
// Show help message immediately after parsing command-line options (for
// "-lang") and setting locale, but before showing splash screen.
if (HelpRequested(gArgs) || gArgs.IsArgSet("-version")) {
- HelpMessageDialog help(nullptr, gArgs.IsArgSet("-version"));
+ HelpMessageDialog help(*node, nullptr, gArgs.IsArgSet("-version"));
help.showOrPrint();
return EXIT_SUCCESS;
}
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -103,7 +103,7 @@
setWindowTitle(windowTitle);
rpcConsole = new RPCConsole(_platformStyle, 0);
- helpMessageDialog = new HelpMessageDialog(this, false);
+ helpMessageDialog = new HelpMessageDialog(node, this, false);
#ifdef ENABLE_WALLET
if (enableWallet) {
/** Create wallet frame and make it the central widget */
@@ -692,7 +692,7 @@
void BitcoinGUI::aboutClicked() {
if (!clientModel) return;
- HelpMessageDialog dlg(this, true);
+ HelpMessageDialog dlg(m_node, this, true);
dlg.exec();
}
diff --git a/src/qt/utilitydialog.h b/src/qt/utilitydialog.h
--- a/src/qt/utilitydialog.h
+++ b/src/qt/utilitydialog.h
@@ -11,6 +11,10 @@
class BitcoinGUI;
class ClientModel;
+namespace interfaces {
+class Node;
+}
+
namespace Ui {
class HelpMessageDialog;
}
@@ -20,7 +24,8 @@
Q_OBJECT
public:
- explicit HelpMessageDialog(QWidget *parent, bool about);
+ explicit HelpMessageDialog(interfaces::Node &node, QWidget *parent,
+ bool about);
~HelpMessageDialog();
void printToConsole();
diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp
--- a/src/qt/utilitydialog.cpp
+++ b/src/qt/utilitydialog.cpp
@@ -19,6 +19,7 @@
#include "clientversion.h"
#include "init.h"
+#include "interfaces/node.h"
#include "util.h"
#include <cstdio>
@@ -31,7 +32,8 @@
#include <QVBoxLayout>
/** "Help message" or "About" dialog box */
-HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about)
+HelpMessageDialog::HelpMessageDialog(interfaces::Node &node, QWidget *parent,
+ bool about)
: QDialog(parent), ui(new Ui::HelpMessageDialog) {
ui->setupUi(this);
@@ -78,7 +80,7 @@
cursor.insertText(header);
cursor.insertBlock();
- std::string strUsage = HelpMessage(HelpMessageMode::BITCOIN_QT);
+ std::string strUsage = node.helpMessage(HelpMessageMode::BITCOIN_QT);
const bool showDebug = gArgs.GetBoolArg("-help-debug", false);
strUsage += HelpMessageGroup(tr("UI Options:").toStdString());
if (showDebug) {

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 1, 08:46 (29 m, 42 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187125
Default Alt Text
D2816.diff (3 KB)

Event Timeline