[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [dragon] src/app: fix play button appearance when stalled
From:       Harald Sitter <sitter () kde ! org>
Date:       2012-06-01 0:11:14
Message-ID: 20120601001114.75B17A60BB () git ! kde ! org
[Download RAW message or body]

Git commit 422138c31e6e0f738fe11cc86ea9af167cf2cde4 by Harald Sitter.
Committed on 01/06/2012 at 02:11.
Pushed by sitter into branch 'master'.

fix play button appearance when stalled

technically speaking the buffering state is part of the overall
playback state machine (obvious states: playing & paused). also see
phonon/doc/state-machine.svg.
now in the context of the play/pause button, which indicates either
activity or inactivity within the playback machine, both playing
and buffering are active whereas pause is inactive, so WRT to
button state toggling buffering needs to be handled exactly like
play.

CCBUG: 243982

M  +3    -3    src/app/stateChange.cpp

http://commits.kde.org/dragon/422138c31e6e0f738fe11cc86ea9af167cf2cde4

diff --git a/src/app/stateChange.cpp b/src/app/stateChange.cpp
index 3b16cbc..78c09cc 100644
--- a/src/app/stateChange.cpp
+++ b/src/app/stateChange.cpp
@@ -64,7 +64,7 @@ MainWindow::engineStateChanged( Phonon::State state, Phonon::State \
oldstate )  }
 
     bool enable = false;
-    if(state == Phonon::PlayingState || state == Phonon::PausedState)
+    if(state == Phonon::PlayingState || state == Phonon::PausedState || state == \
Phonon::BufferingState)  {
       enable = true;
     }
@@ -86,8 +86,8 @@ MainWindow::engineStateChanged( Phonon::State state, Phonon::State \
oldstate )  // is disabled if we are empty, this looks more sensible
         PlayAction* playAction = static_cast<PlayAction*>( \
actionCollection()->action(QLatin1String( "play" )) );  playAction->setEnabled( \
                hasMedia );
-        playAction->setPlaying( state == Phonon::PlayingState );
-        actionCollection()->action(QLatin1String( "aspect_ratio_menu" \
))->setEnabled(( state == Phonon::PlayingState || state == Phonon::PausedState) && \
TheStream::hasVideo() ); +        playAction->setPlaying( state == \
Phonon::PlayingState || state == Phonon::BufferingState ); +        \
actionCollection()->action(QLatin1String( "aspect_ratio_menu" ))->setEnabled((enable) \
&& TheStream::hasVideo() );  
         // set correct aspect ratio
         if( state != Phonon::LoadingState )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic