mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 17:43:59 +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 <QTime>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
|
#include <QProgressDialog>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
@@ -471,6 +472,8 @@ TomahawkApp::initDatabase()
|
|||||||
m_database = QPointer<Tomahawk::Database>( new Tomahawk::Database( dbpath, this ) );
|
m_database = QPointer<Tomahawk::Database>( new Tomahawk::Database( dbpath, this ) );
|
||||||
// this also connects dbImpl schema update signals
|
// this also connects dbImpl schema update signals
|
||||||
|
|
||||||
|
connect( m_database.data(), SIGNAL( waitingForWorkers() ), SLOT( onShutdownDelayed() ) );
|
||||||
|
|
||||||
Pipeline::instance()->databaseReady();
|
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
|
void
|
||||||
TomahawkApp::onInfoSystemReady()
|
TomahawkApp::onInfoSystemReady()
|
||||||
{
|
{
|
||||||
|
@@ -102,13 +102,14 @@ public slots:
|
|||||||
void instanceStarted( KDSingleApplicationGuard::Instance );
|
void instanceStarted( KDSingleApplicationGuard::Instance );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void playlistRemoved( const Tomahawk::playlist_ptr& playlist );
|
|
||||||
void initServent();
|
void initServent();
|
||||||
void initSIP();
|
void initSIP();
|
||||||
void initHTTP();
|
void initHTTP();
|
||||||
void initFactoriesForAccountManager();
|
void initFactoriesForAccountManager();
|
||||||
void initEnergyEventHandler();
|
void initEnergyEventHandler();
|
||||||
|
|
||||||
|
void onShutdownDelayed();
|
||||||
|
|
||||||
void spotifyApiCheckFinished();
|
void spotifyApiCheckFinished();
|
||||||
void onInfoSystemReady();
|
void onInfoSystemReady();
|
||||||
|
|
||||||
@@ -120,6 +121,7 @@ private slots:
|
|||||||
void updateSplashWidgetMessage( const QString& message );
|
void updateSplashWidgetMessage( const QString& message );
|
||||||
void killSplashWidget();
|
void killSplashWidget();
|
||||||
|
|
||||||
|
void playlistRemoved( const Tomahawk::playlist_ptr& playlist );
|
||||||
void ipDetectionFailed( QNetworkReply::NetworkError error, QString errorString );
|
void ipDetectionFailed( QNetworkReply::NetworkError error, QString errorString );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user