mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-30 08:40:50 +02:00
Merge #14854: qt: Cleanup SplashScreen class
7d1b60ce93
Cleanup SplashScreen class (Hennadii Stepanov)
Pull request description:
Cleaning up after replacing the `QSplashScreen` base class with the `QWidget` class (#4941 by @laanwj).
cc @jonasschnelli
Tree-SHA512: 72e2d67905d85247a11ae6a884f74f710f765adf20db7d1daf0927e6990687e836b486c4ff93bc6dabc3759ed667acfe1d69c8b94fae7181ab271a3fa7a0229a
This commit is contained in:
@@ -212,7 +212,7 @@ Q_SIGNALS:
|
|||||||
void requestedInitialize();
|
void requestedInitialize();
|
||||||
void requestedShutdown();
|
void requestedShutdown();
|
||||||
void stopThread();
|
void stopThread();
|
||||||
void splashFinished(QWidget *window);
|
void splashFinished();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QThread *coreThread;
|
QThread *coreThread;
|
||||||
@@ -352,9 +352,9 @@ void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle)
|
|||||||
{
|
{
|
||||||
SplashScreen *splash = new SplashScreen(m_node, 0, networkStyle);
|
SplashScreen *splash = new SplashScreen(m_node, 0, networkStyle);
|
||||||
// We don't hold a direct pointer to the splash screen after creation, but the splash
|
// We don't hold a direct pointer to the splash screen after creation, but the splash
|
||||||
// screen will take care of deleting itself when slotFinish happens.
|
// screen will take care of deleting itself when finish() happens.
|
||||||
splash->show();
|
splash->show();
|
||||||
connect(this, &BitcoinApplication::splashFinished, splash, &SplashScreen::slotFinish);
|
connect(this, &BitcoinApplication::splashFinished, splash, &SplashScreen::finish);
|
||||||
connect(this, &BitcoinApplication::requestedShutdown, splash, &QWidget::close);
|
connect(this, &BitcoinApplication::requestedShutdown, splash, &QWidget::close);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -495,7 +495,7 @@ void BitcoinApplication::initializeResult(bool success)
|
|||||||
{
|
{
|
||||||
window->show();
|
window->show();
|
||||||
}
|
}
|
||||||
Q_EMIT splashFinished(window);
|
Q_EMIT splashFinished();
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
// Now that initialization/startup is done, process any command-line
|
// Now that initialization/startup is done, process any command-line
|
||||||
@@ -509,7 +509,7 @@ void BitcoinApplication::initializeResult(bool success)
|
|||||||
#endif
|
#endif
|
||||||
pollShutdownTimer->start(200);
|
pollShutdownTimer->start(200);
|
||||||
} else {
|
} else {
|
||||||
Q_EMIT splashFinished(window); // Make sure splash screen doesn't stick around during shutdown
|
Q_EMIT splashFinished(); // Make sure splash screen doesn't stick around during shutdown
|
||||||
quit(); // Exit first main loop invocation
|
quit(); // Exit first main loop invocation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -145,10 +145,8 @@ bool SplashScreen::eventFilter(QObject * obj, QEvent * ev) {
|
|||||||
return QObject::eventFilter(obj, ev);
|
return QObject::eventFilter(obj, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SplashScreen::slotFinish(QWidget *mainWin)
|
void SplashScreen::finish()
|
||||||
{
|
{
|
||||||
Q_UNUSED(mainWin);
|
|
||||||
|
|
||||||
/* If the window is minimized, hide() will be ignored. */
|
/* If the window is minimized, hide() will be ignored. */
|
||||||
/* Make sure we de-minimize the splashscreen window before hiding */
|
/* Make sure we de-minimize the splashscreen window before hiding */
|
||||||
if (isMinimized())
|
if (isMinimized())
|
||||||
|
@@ -5,8 +5,7 @@
|
|||||||
#ifndef BITCOIN_QT_SPLASHSCREEN_H
|
#ifndef BITCOIN_QT_SPLASHSCREEN_H
|
||||||
#define BITCOIN_QT_SPLASHSCREEN_H
|
#define BITCOIN_QT_SPLASHSCREEN_H
|
||||||
|
|
||||||
#include <functional>
|
#include <QWidget>
|
||||||
#include <QSplashScreen>
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@@ -37,8 +36,8 @@ protected:
|
|||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
/** Slot to call finish() method as it's not defined as slot */
|
/** Hide the splash screen window and schedule the splash screen object for deletion */
|
||||||
void slotFinish(QWidget *mainWin);
|
void finish();
|
||||||
|
|
||||||
/** Show message and progress */
|
/** Show message and progress */
|
||||||
void showMessage(const QString &message, int alignment, const QColor &color);
|
void showMessage(const QString &message, int alignment, const QColor &color);
|
||||||
|
Reference in New Issue
Block a user