Don't exit application to fast, to allow fadeout
This commit is contained in:
parent
e36a333212
commit
375abfd04e
@ -97,6 +97,8 @@ class Base : public QObject, boost::noncopyable {
|
||||
|
||||
void TrackEnded();
|
||||
|
||||
void FadeoutFinishedSignal();
|
||||
|
||||
void StatusText(const QString&);
|
||||
void Error(const QString&);
|
||||
|
||||
|
@ -576,6 +576,7 @@ void GstEngine::Stop() {
|
||||
|
||||
void GstEngine::FadeoutFinished() {
|
||||
fadeout_pipeline_.reset();
|
||||
emit FadeoutFinishedSignal();
|
||||
}
|
||||
|
||||
void GstEngine::Pause() {
|
||||
|
@ -298,7 +298,7 @@ MainWindow::MainWindow(
|
||||
connect(ui_->action_previous_track, SIGNAL(triggered()), player_, SLOT(Previous()));
|
||||
connect(ui_->action_play_pause, SIGNAL(triggered()), player_, SLOT(PlayPause()));
|
||||
connect(ui_->action_stop, SIGNAL(triggered()), player_, SLOT(Stop()));
|
||||
connect(ui_->action_quit, SIGNAL(triggered()), qApp, SLOT(quit()));
|
||||
connect(ui_->action_quit, SIGNAL(triggered()), SLOT(Exit()));
|
||||
connect(ui_->action_stop_after_this_track, SIGNAL(triggered()), SLOT(StopAfterCurrent()));
|
||||
connect(ui_->action_mute, SIGNAL(triggered()), player_, SLOT(Mute()));
|
||||
#ifdef HAVE_LIBLASTFM
|
||||
@ -1751,3 +1751,13 @@ bool MainWindow::winEvent(MSG* msg, long*) {
|
||||
return false;
|
||||
}
|
||||
#endif // Q_OS_WIN32
|
||||
|
||||
void MainWindow::Exit() {
|
||||
// To shut down the application when fadeout will be finished
|
||||
connect(player_->engine(), SIGNAL(FadeoutFinishedSignal()), qApp, SLOT(quit()));
|
||||
|
||||
player_->Stop();
|
||||
|
||||
hide();
|
||||
tray_icon_->SetVisible(false);
|
||||
}
|
||||
|
@ -230,6 +230,8 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
||||
|
||||
void Raise();
|
||||
|
||||
void Exit();
|
||||
|
||||
private:
|
||||
void ConnectInfoView(SongInfoBase* view);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user