mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-12-01 14:20:11 +01:00
2023-01-30 Fred Gleason <fredg@paravelsystems.com>
* Refactored splash screen code so as not to hide the splash screen until after the event loop is started. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -61,7 +61,7 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
//
|
||||
// Splash Screen
|
||||
//
|
||||
air_splash_screen=new SplashScreen();
|
||||
air_splash_screen=new SplashScreen(this);
|
||||
air_splash_screen->show();
|
||||
air_splash_screen->showMessage(tr("Opening database..."));
|
||||
|
||||
@@ -826,7 +826,11 @@ void MainWidget::ripcConnectedData(bool state)
|
||||
delete q;
|
||||
}
|
||||
}
|
||||
air_splash_screen->finish(this);
|
||||
|
||||
QTimer *timer=new QTimer();
|
||||
timer->setSingleShot(true);
|
||||
connect(timer,SIGNAL(timeout()),air_splash_screen,SLOT(finish()));
|
||||
timer->start(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,9 +22,10 @@
|
||||
|
||||
#include "../icons/rdairplay-splash.xpm"
|
||||
|
||||
SplashScreen::SplashScreen()
|
||||
SplashScreen::SplashScreen(QWidget *main_win)
|
||||
: QSplashScreen(QPixmap(rdairplay_splash_xpm),Qt::WindowStaysOnTopHint)
|
||||
{
|
||||
d_main_window=main_win;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,3 +34,8 @@ void SplashScreen::showMessage(const QString &str)
|
||||
QSplashScreen::showMessage(str+" ",Qt::AlignRight|Qt::AlignBottom,Qt::white);
|
||||
}
|
||||
|
||||
|
||||
void SplashScreen::finish()
|
||||
{
|
||||
QSplashScreen::finish(d_main_window);
|
||||
}
|
||||
|
||||
@@ -27,10 +27,14 @@ class SplashScreen : public QSplashScreen
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
SplashScreen();
|
||||
SplashScreen(QWidget *main_win);
|
||||
|
||||
public slots:
|
||||
void showMessage(const QString &str);
|
||||
void showMessage(const QString &str);
|
||||
void finish();
|
||||
|
||||
private:
|
||||
QWidget *d_main_window;
|
||||
};
|
||||
|
||||
#endif // SPLASHSCREEN_H
|
||||
|
||||
Reference in New Issue
Block a user