aboutsummaryrefslogtreecommitdiff
path: root/src/interface
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-04-17 14:33:47 -0400
committerJohn Newbery <john@johnnewbery.com>2018-04-04 16:52:40 -0400
commit3d619e9d3658e36cba4a19a5bed33e5538317b27 (patch)
tree5d4767f191928188fae2dc82c630da52a9cf1f28 /src/interface
parentc0f2756be517feddacd7c6b89b9faa888b3fef8e (diff)
downloadbitcoin-3d619e9d3658e36cba4a19a5bed33e5538317b27.tar.xz
Remove direct bitcoin calls from qt/bitcoingui.cpp
Diffstat (limited to 'src/interface')
-rw-r--r--src/interface/node.cpp9
-rw-r--r--src/interface/node.h15
2 files changed, 24 insertions, 0 deletions
diff --git a/src/interface/node.cpp b/src/interface/node.cpp
index 877c5f57a8..7bfe79ed50 100644
--- a/src/interface/node.cpp
+++ b/src/interface/node.cpp
@@ -45,6 +45,7 @@ class NodeImpl : public Node
Shutdown();
}
void startShutdown() override { StartShutdown(); }
+ bool shutdownRequested() override { return ShutdownRequested(); }
void mapPort(bool use_upnp) override
{
if (use_upnp) {
@@ -59,6 +60,14 @@ class NodeImpl : public Node
{
return MakeHandler(::uiInterface.InitMessage.connect(fn));
}
+ std::unique_ptr<Handler> handleMessageBox(MessageBoxFn fn) override
+ {
+ return MakeHandler(::uiInterface.ThreadSafeMessageBox.connect(fn));
+ }
+ std::unique_ptr<Handler> handleQuestion(QuestionFn fn) override
+ {
+ return MakeHandler(::uiInterface.ThreadSafeQuestion.connect(fn));
+ }
};
} // namespace
diff --git a/src/interface/node.h b/src/interface/node.h
index 368bade28b..00304cce24 100644
--- a/src/interface/node.h
+++ b/src/interface/node.h
@@ -59,6 +59,9 @@ public:
//! Start shutdown.
virtual void startShutdown() = 0;
+ //! Return whether shutdown was requested.
+ virtual bool shutdownRequested() = 0;
+
//! Map port.
virtual void mapPort(bool use_upnp) = 0;
@@ -68,6 +71,18 @@ public:
//! Register handler for init messages.
using InitMessageFn = std::function<void(const std::string& message)>;
virtual std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) = 0;
+
+ //! Register handler for message box messages.
+ using MessageBoxFn =
+ std::function<bool(const std::string& message, const std::string& caption, unsigned int style)>;
+ virtual std::unique_ptr<Handler> handleMessageBox(MessageBoxFn fn) = 0;
+
+ //! Register handler for question messages.
+ using QuestionFn = std::function<bool(const std::string& message,
+ const std::string& non_interactive_message,
+ const std::string& caption,
+ unsigned int style)>;
+ virtual std::unique_ptr<Handler> handleQuestion(QuestionFn fn) = 0;
};
//! Return implementation of Node interface.