You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

splashscreen.h 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright (c) 2011-2016 The Starwels developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #ifndef STARWELS_QT_SPLASHSCREEN_H
  5. #define STARWELS_QT_SPLASHSCREEN_H
  6. #include <functional>
  7. #include <QSplashScreen>
  8. class CWallet;
  9. class NetworkStyle;
  10. /** Class for the splashscreen with information of the running client.
  11. *
  12. * @note this is intentionally not a QSplashScreen. Starwels initialization
  13. * can take a long time, and in that case a progress window that cannot be
  14. * moved around and minimized has turned out to be frustrating to the user.
  15. */
  16. class SplashScreen : public QWidget
  17. {
  18. Q_OBJECT
  19. public:
  20. explicit SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle);
  21. ~SplashScreen();
  22. protected:
  23. void paintEvent(QPaintEvent *event);
  24. void closeEvent(QCloseEvent *event);
  25. public Q_SLOTS:
  26. /** Slot to call finish() method as it's not defined as slot */
  27. void slotFinish(QWidget *mainWin);
  28. /** Show message and progress */
  29. void showMessage(const QString &message, int alignment, const QColor &color);
  30. /** Sets the break action */
  31. void setBreakAction(const std::function<void(void)> &action);
  32. protected:
  33. bool eventFilter(QObject * obj, QEvent * ev);
  34. private:
  35. /** Connect core signals to splash screen */
  36. void subscribeToCoreSignals();
  37. /** Disconnect core signals to splash screen */
  38. void unsubscribeFromCoreSignals();
  39. /** Connect wallet signals to splash screen */
  40. void ConnectWallet(CWallet*);
  41. QPixmap pixmap;
  42. QString curMessage;
  43. QColor curColor;
  44. int curAlignment;
  45. QList<CWallet*> connectedWallets;
  46. std::function<void(void)> breakAction;
  47. };
  48. #endif // STARWELS_QT_SPLASHSCREEN_H