Bitcoin Core  22.0.0
P2P Digital Currency
splashscreen.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2020 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_QT_SPLASHSCREEN_H
6 #define BITCOIN_QT_SPLASHSCREEN_H
7 
8 #include <QWidget>
9 
10 #include <memory>
11 
12 class NetworkStyle;
13 
14 namespace interfaces {
15 class Handler;
16 class Node;
17 class Wallet;
18 };
19 
26 class SplashScreen : public QWidget
27 {
28  Q_OBJECT
29 
30 public:
31  explicit SplashScreen(const NetworkStyle *networkStyle);
32  ~SplashScreen();
34 
35 protected:
36  void paintEvent(QPaintEvent *event) override;
37  void closeEvent(QCloseEvent *event) override;
38 
39 public Q_SLOTS:
41  void finish();
42 
44  void showMessage(const QString &message, int alignment, const QColor &color);
45 
47  void handleLoadWallet();
48 
49 protected:
50  bool eventFilter(QObject * obj, QEvent * ev) override;
51 
52 private:
58  void shutdown();
59 
60  QPixmap pixmap;
61  QString curMessage;
62  QColor curColor;
64 
66  bool m_shutdown = false;
67  std::unique_ptr<interfaces::Handler> m_handler_init_message;
68  std::unique_ptr<interfaces::Handler> m_handler_show_progress;
69  std::unique_ptr<interfaces::Handler> m_handler_load_wallet;
70  std::list<std::unique_ptr<interfaces::Wallet>> m_connected_wallets;
71  std::list<std::unique_ptr<interfaces::Handler>> m_connected_wallet_handlers;
72 };
73 
74 #endif // BITCOIN_QT_SPLASHSCREEN_H
void unsubscribeFromCoreSignals()
Disconnect core signals to splash screen.
std::unique_ptr< interfaces::Handler > m_handler_show_progress
Definition: splashscreen.h:68
bool eventFilter(QObject *obj, QEvent *ev) override
std::unique_ptr< interfaces::Handler > m_handler_load_wallet
Definition: splashscreen.h:69
Class for the splashscreen with information of the running client.
Definition: splashscreen.h:26
void setNode(interfaces::Node &node)
std::unique_ptr< interfaces::Handler > m_handler_init_message
Definition: splashscreen.h:67
std::list< std::unique_ptr< interfaces::Wallet > > m_connected_wallets
Definition: splashscreen.h:70
void subscribeToCoreSignals()
Connect core signals to splash screen.
SplashScreen(const NetworkStyle *networkStyle)
void closeEvent(QCloseEvent *event) override
void showMessage(const QString &message, int alignment, const QColor &color)
Show message and progress.
interfaces::Node * m_node
Definition: splashscreen.h:65
void finish()
Hide the splash screen window and schedule the splash screen object for deletion. ...
std::list< std::unique_ptr< interfaces::Handler > > m_connected_wallet_handlers
Definition: splashscreen.h:71
QString curMessage
Definition: splashscreen.h:61
void paintEvent(QPaintEvent *event) override
QPixmap pixmap
Definition: splashscreen.h:60
void handleLoadWallet()
Handle wallet load notifications.
void shutdown()
Initiate shutdown.
QColor curColor
Definition: splashscreen.h:62
Top-level interface for a bitcoin node (bitcoind process).
Definition: node.h:54