mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 16:14:40 +02:00
Show a progress dialog on shutdown, when waiting for db jobs. This is actually a bit fake, because the event-loop is blocked, but better than silently blocking shutdown.
This commit is contained in:
@@ -101,6 +101,7 @@
|
||||
#include <QTime>
|
||||
#include <QMessageBox>
|
||||
#include <QNetworkReply>
|
||||
#include <QProgressDialog>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QTranslator>
|
||||
@@ -471,6 +472,8 @@ TomahawkApp::initDatabase()
|
||||
m_database = QPointer<Tomahawk::Database>( new Tomahawk::Database( dbpath, this ) );
|
||||
// this also connects dbImpl schema update signals
|
||||
|
||||
connect( m_database.data(), SIGNAL( waitingForWorkers() ), SLOT( onShutdownDelayed() ) );
|
||||
|
||||
Pipeline::instance()->databaseReady();
|
||||
}
|
||||
|
||||
@@ -595,6 +598,25 @@ TomahawkApp::initSIP()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkApp::onShutdownDelayed()
|
||||
{
|
||||
QProgressDialog* d = new QProgressDialog( tr( "Tomahawk is updating the database. Please wait, this may take a minute!" ), QString(),
|
||||
0, 0, 0, Qt::Tool
|
||||
| Qt::WindowTitleHint
|
||||
| Qt::CustomizeWindowHint );
|
||||
d->setModal( true );
|
||||
d->setAutoClose( false );
|
||||
d->setAutoReset( false );
|
||||
d->setWindowTitle( tr( "Tomahawk" ) );
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
d->setAttribute( Qt::WA_MacAlwaysShowToolWindow );
|
||||
#endif
|
||||
d->show();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkApp::onInfoSystemReady()
|
||||
{
|
||||
|
@@ -102,13 +102,14 @@ public slots:
|
||||
void instanceStarted( KDSingleApplicationGuard::Instance );
|
||||
|
||||
private slots:
|
||||
void playlistRemoved( const Tomahawk::playlist_ptr& playlist );
|
||||
void initServent();
|
||||
void initSIP();
|
||||
void initHTTP();
|
||||
void initFactoriesForAccountManager();
|
||||
void initEnergyEventHandler();
|
||||
|
||||
void onShutdownDelayed();
|
||||
|
||||
void spotifyApiCheckFinished();
|
||||
void onInfoSystemReady();
|
||||
|
||||
@@ -120,6 +121,7 @@ private slots:
|
||||
void updateSplashWidgetMessage( const QString& message );
|
||||
void killSplashWidget();
|
||||
|
||||
void playlistRemoved( const Tomahawk::playlist_ptr& playlist );
|
||||
void ipDetectionFailed( QNetworkReply::NetworkError error, QString errorString );
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user