Bitcoin ABC  0.24.7
P2P Digital Currency
splashscreen.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2016 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 }; // namespace interfaces
19 
26 class SplashScreen : public QWidget {
27  Q_OBJECT
28 
29 public:
30  explicit SplashScreen(const NetworkStyle *networkStyle);
31  ~SplashScreen();
32  void setNode(interfaces::Node &node);
33 
34 protected:
35  void paintEvent(QPaintEvent *event) override;
36  void closeEvent(QCloseEvent *event) override;
37 
38 public Q_SLOTS:
41  void finish();
42 
44  void showMessage(const QString &message, int alignment,
45  const QColor &color);
46 
48  void handleLoadWallet();
49 
50 protected:
51  bool eventFilter(QObject *obj, QEvent *ev) override;
52 
53 private:
59  void shutdown();
60 
61  QPixmap pixmap;
62  QString curMessage;
63  QColor curColor;
65 
67  bool m_shutdown = false;
68  std::unique_ptr<interfaces::Handler> m_handler_init_message;
69  std::unique_ptr<interfaces::Handler> m_handler_show_progress;
70  std::unique_ptr<interfaces::Handler> m_handler_load_wallet;
71  std::list<std::unique_ptr<interfaces::Wallet>> m_connected_wallets;
72  std::list<std::unique_ptr<interfaces::Handler>> m_connected_wallet_handlers;
73 };
74 
75 #endif // BITCOIN_QT_SPLASHSCREEN_H
interfaces
Definition: dummywallet.cpp:12
SplashScreen::curAlignment
int curAlignment
Definition: splashscreen.h:64
SplashScreen::m_connected_wallet_handlers
std::list< std::unique_ptr< interfaces::Handler > > m_connected_wallet_handlers
Definition: splashscreen.h:72
SplashScreen::setNode
void setNode(interfaces::Node &node)
Definition: splashscreen.cpp:154
SplashScreen::m_shutdown
bool m_shutdown
Definition: splashscreen.h:67
SplashScreen::finish
void finish()
Hide the splash screen window and schedule the splash screen object for deletion.
Definition: splashscreen.cpp:180
SplashScreen::paintEvent
void paintEvent(QPaintEvent *event) override
Definition: splashscreen.cpp:254
NetworkStyle
Definition: networkstyle.h:13
SplashScreen::handleLoadWallet
void handleLoadWallet()
Handle wallet load notifications.
Definition: splashscreen.cpp:220
SplashScreen::eventFilter
bool eventFilter(QObject *obj, QEvent *ev) override
Definition: splashscreen.cpp:170
SplashScreen::unsubscribeFromCoreSignals
void unsubscribeFromCoreSignals()
Disconnect core signals to splash screen.
Definition: splashscreen.cpp:235
SplashScreen::m_handler_init_message
std::unique_ptr< interfaces::Handler > m_handler_init_message
Definition: splashscreen.h:68
SplashScreen::~SplashScreen
~SplashScreen()
Definition: splashscreen.cpp:148
SplashScreen::SplashScreen
SplashScreen(const NetworkStyle *networkStyle)
Definition: splashscreen.cpp:27
SplashScreen::subscribeToCoreSignals
void subscribeToCoreSignals()
Connect core signals to splash screen.
Definition: splashscreen.cpp:211
SplashScreen::m_connected_wallets
std::list< std::unique_ptr< interfaces::Wallet > > m_connected_wallets
Definition: splashscreen.h:71
SplashScreen::m_handler_show_progress
std::unique_ptr< interfaces::Handler > m_handler_show_progress
Definition: splashscreen.h:69
SplashScreen::curMessage
QString curMessage
Definition: splashscreen.h:62
SplashScreen::showMessage
void showMessage(const QString &message, int alignment, const QColor &color)
Show message and progress.
Definition: splashscreen.cpp:246
interfaces::Node
Top-level interface for a bitcoin node (bitcoind process).
Definition: node.h:55
SplashScreen::m_node
interfaces::Node * m_node
Definition: splashscreen.h:66
SplashScreen::pixmap
QPixmap pixmap
Definition: splashscreen.h:61
SplashScreen
Class for the splashscreen with information of the running client.
Definition: splashscreen.h:26
SplashScreen::curColor
QColor curColor
Definition: splashscreen.h:63
SplashScreen::closeEvent
void closeEvent(QCloseEvent *event) override
Definition: splashscreen.cpp:262
SplashScreen::shutdown
void shutdown()
Initiate shutdown.
Definition: splashscreen.cpp:163
SplashScreen::m_handler_load_wallet
std::unique_ptr< interfaces::Handler > m_handler_load_wallet
Definition: splashscreen.h:70