1
0
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:
Christian Muehlhaeuser
2014-10-25 03:56:58 +02:00
parent 03b68390c1
commit cea6076a83
2 changed files with 25 additions and 1 deletions

View File

@@ -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()
{

View File

@@ -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: