mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Properly init StopAfterPlayback action.
This commit is contained in:
@@ -92,6 +92,7 @@ TomahawkTrayIcon::TomahawkTrayIcon( QObject* parent )
|
|||||||
connect( &m_animationTimer, SIGNAL( timeout() ), SLOT( onAnimationTimer() ) );
|
connect( &m_animationTimer, SIGNAL( timeout() ), SLOT( onAnimationTimer() ) );
|
||||||
connect( this, SIGNAL( activated( QSystemTrayIcon::ActivationReason ) ), SLOT( onActivated( QSystemTrayIcon::ActivationReason ) ) );
|
connect( this, SIGNAL( activated( QSystemTrayIcon::ActivationReason ) ), SLOT( onActivated( QSystemTrayIcon::ActivationReason ) ) );
|
||||||
|
|
||||||
|
onStop();
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,6 +242,7 @@ void
|
|||||||
TomahawkTrayIcon::onPlay()
|
TomahawkTrayIcon::onPlay()
|
||||||
{
|
{
|
||||||
m_stopContinueAfterTrackAction->setEnabled( true );
|
m_stopContinueAfterTrackAction->setEnabled( true );
|
||||||
|
|
||||||
onResume();
|
onResume();
|
||||||
onStopContinueAfterTrackChanged();
|
onStopContinueAfterTrackChanged();
|
||||||
}
|
}
|
||||||
@@ -250,6 +252,7 @@ void
|
|||||||
TomahawkTrayIcon::onStop()
|
TomahawkTrayIcon::onStop()
|
||||||
{
|
{
|
||||||
m_stopContinueAfterTrackAction->setEnabled( false );
|
m_stopContinueAfterTrackAction->setEnabled( false );
|
||||||
|
|
||||||
onPause();
|
onPause();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,12 +267,12 @@ TomahawkTrayIcon::onResume()
|
|||||||
void
|
void
|
||||||
TomahawkTrayIcon::onStopContinueAfterTrackChanged()
|
TomahawkTrayIcon::onStopContinueAfterTrackChanged()
|
||||||
{
|
{
|
||||||
|
m_stopContinueAfterTrackAction->setText( tr( "&Stop Playback after current Track" ) );
|
||||||
|
|
||||||
if ( !AudioEngine::instance()->currentTrack().isNull() )
|
if ( !AudioEngine::instance()->currentTrack().isNull() )
|
||||||
{
|
{
|
||||||
if ( AudioEngine::instance()->currentTrack()->toQuery()->equals( AudioEngine::instance()->stopAfterTrack() ) )
|
if ( AudioEngine::instance()->currentTrack()->toQuery()->equals( AudioEngine::instance()->stopAfterTrack() ) )
|
||||||
m_stopContinueAfterTrackAction->setText( tr( "&Continue Playback after current Track" ) );
|
m_stopContinueAfterTrackAction->setText( tr( "&Continue Playback after current Track" ) );
|
||||||
else
|
|
||||||
m_stopContinueAfterTrackAction->setText( tr( "&Stop Playback after current Track" ) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user