1a9add78c9
542ce6e Report [CANCELLED] instead of [DONE] when shut down during txdb upgrade (Jonas Schnelli) 83fbea3 Report txdb upgrade not more often then every 10% (Jonas Schnelli) 06c5b6e Show txdb upgrade progress in debug log (Jonas Schnelli) 316fcb5 Allow to cancel the txdb upgrade via splashscreen callback (Jonas Schnelli) ae09d45 Allow to shut down during txdb upgrade (Jonas Schnelli) 00cb69b [Qt] allow to execute a callback during splashscreen progress (Jonas Schnelli) Tree-SHA512: 23190f23f441bfd60821e49f8b3698a6bef97eb0e0ee659328e4a7395769ecd1616420eacc38aa1fa0ff62b9de5f13a0098dc798cdec6bff649575cefebc0db2
58 lines
1.6 KiB
C++
58 lines
1.6 KiB
C++
// Copyright (c) 2011-2015 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_QT_SPLASHSCREEN_H
|
|
#define BITCOIN_QT_SPLASHSCREEN_H
|
|
|
|
#include <functional>
|
|
#include <QSplashScreen>
|
|
|
|
class NetworkStyle;
|
|
|
|
/** Class for the splashscreen with information of the running client.
|
|
*
|
|
* @note this is intentionally not a QSplashScreen. Bitcoin Core initialization
|
|
* can take a long time, and in that case a progress window that cannot be
|
|
* moved around and minimized has turned out to be frustrating to the user.
|
|
*/
|
|
class SplashScreen : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle);
|
|
~SplashScreen();
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *event);
|
|
void closeEvent(QCloseEvent *event);
|
|
|
|
public Q_SLOTS:
|
|
/** Slot to call finish() method as it's not defined as slot */
|
|
void slotFinish(QWidget *mainWin);
|
|
|
|
/** Show message and progress */
|
|
void showMessage(const QString &message, int alignment, const QColor &color);
|
|
|
|
/** Sets the break action */
|
|
void setBreakAction(const std::function<void(void)> &action);
|
|
protected:
|
|
bool eventFilter(QObject * obj, QEvent * ev);
|
|
|
|
private:
|
|
/** Connect core signals to splash screen */
|
|
void subscribeToCoreSignals();
|
|
/** Disconnect core signals to splash screen */
|
|
void unsubscribeFromCoreSignals();
|
|
|
|
QPixmap pixmap;
|
|
QString curMessage;
|
|
QColor curColor;
|
|
int curAlignment;
|
|
|
|
std::function<void(void)> breakAction;
|
|
};
|
|
|
|
#endif // BITCOIN_QT_SPLASHSCREEN_H
|