[vlc-commits] Qt: fix semantics and behaviour for chapters buttons

Jean-Baptiste Kempf git at videolan.org
Fri Apr 6 15:49:40 CEST 2012


vlc/vlc-2.0 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Apr  6 13:29:13 2012 +0200| [c17e2e7f0e530c4acde584391d8e86b8f17d628a] | committer: Jean-Baptiste Kempf

Qt: fix semantics and behaviour for chapters buttons

No sense to display chapter buttons with 1title&1chapter
(cherry picked from commit 2059bea41c0ea723466ccbb3e9d9550b26e2e2ee)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=c17e2e7f0e530c4acde584391d8e86b8f17d628a
---

 modules/gui/qt4/components/controller.cpp |    6 +++---
 modules/gui/qt4/input_manager.cpp         |    9 ++++-----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index 0313be5..dd75161 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -348,7 +348,7 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
     case INPUT_SLIDER: {
         SeekSlider *slider = new SeekSlider( Qt::Horizontal, NULL, !b_shiny );
         SeekPoints *chapters = new SeekPoints( this, p_intf );
-        CONNECT( THEMIM->getIM(), titleChanged( bool ), chapters, update() );
+        CONNECT( THEMIM->getIM(), chapterChanged( bool ), chapters, update() );
         slider->setChapters( chapters );
 
         /* Update the position when the IM has changed */
@@ -545,9 +545,9 @@ QFrame *AbstractController::discFrame()
 
     /* Change the navigation button display when the IM
        navigation changes */
-    CONNECT( THEMIM->getIM(), titleChanged( bool ),
-            discFrame, setVisible( bool ) );
     CONNECT( THEMIM->getIM(), chapterChanged( bool ),
+            discFrame, setVisible( bool ) );
+    CONNECT( THEMIM->getIM(), titleChanged( bool ),
             menuButton, setVisible( bool ) );
     /* Changes the IM navigation when triggered on the nav buttons */
     CONNECT( prevSectionButton, clicked(), THEMIM->getIM(),
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 4281c30..f126e07 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -426,15 +426,14 @@ void InputManager::UpdateNavigation()
 
     if( val.i_int > 0 )
     {
-        emit titleChanged( true );
-        msg_Dbg( p_intf, "Title %"PRId64, val.i_int );
         /* p_input != NULL since val.i_int != 0 */
         var_Change( p_input, "chapter", VLC_VAR_CHOICESCOUNT, &val2, NULL );
-        emit chapterChanged( (val2.i_int > 1) || ( val2.i_int > 0 && val.i_int > 1 ) );
-        msg_Dbg( p_intf, "Chapter: %"PRId64, val2.i_int );
+
+        emit titleChanged( val.i_int > 1 );
+        emit chapterChanged( val2.i_int > 1 );
     }
     else
-        emit titleChanged( false );
+        emit chapterChanged( false );
 }
 
 void InputManager::UpdateStatus()



More information about the vlc-commits mailing list