[vlc-devel] commit: Qt: random button is now just a checkable button and doesn' t change icon nor tooltip. (Jean-Baptiste Kempf )

git version control git at videolan.org
Sat Feb 28 01:40:53 CET 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Feb 28 01:39:17 2009 +0100| [34d5eedc690eb80ae957e100536d13502c11fce1] | committer: Jean-Baptiste Kempf 

Qt: random button is now just a checkable button and doesn't change icon nor tooltip.

This fixes the previous behaviour that was confusing.

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

 .../gui/qt4/components/playlist/standardpanel.cpp  |   17 +++--------------
 modules/gui/qt4/vlc.qrc                            |    1 -
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 6b57047..35b4fd0 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -118,16 +118,9 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
 
     /* Random 2-state button */
     randomButton = new QPushButton( this );
-    if( model->hasRandom() )
-    {
-        randomButton->setIcon( QIcon( ":/shuffle_on" ));
-        randomButton->setToolTip( qtr( I_PL_RANDOM ));
-    }
-    else
-    {
-         randomButton->setIcon( QIcon( ":/shuffle_off" ) );
-         randomButton->setToolTip( qtr( I_PL_NORANDOM ));
-    }
+    randomButton->setIcon( QIcon( ":/shuffle_on" ));
+    randomButton->setToolTip( qtr( I_PL_RANDOM ));
+    randomButton->setCheckable( true );
     BUTTONACT( randomButton, toggleRandom() );
     buttons->addWidget( randomButton );
 
@@ -204,10 +197,6 @@ void StandardPLPanel::toggleRandom()
 {
     bool prev = model->hasRandom();
     model->setRandom( !prev );
-    randomButton->setIcon( prev ?
-                QIcon( ":/shuffle_off" ) :
-                QIcon( ":/shuffle_on" ) );
-    randomButton->setToolTip( prev ? qtr( I_PL_NORANDOM ) : qtr(I_PL_RANDOM ) );
 }
 
 void StandardPLPanel::gotoPlayingItem()
diff --git a/modules/gui/qt4/vlc.qrc b/modules/gui/qt4/vlc.qrc
index 0e5aef3..e74f5bb 100644
--- a/modules/gui/qt4/vlc.qrc
+++ b/modules/gui/qt4/vlc.qrc
@@ -39,7 +39,6 @@
   <file alias="repeat_all">pixmaps/playlist/repeat_all.png</file>
   <file alias="repeat_off">pixmaps/playlist/repeat_off.png</file>
   <file alias="repeat_one">pixmaps/playlist/repeat_one.png</file>
-  <file alias="shuffle_off">pixmaps/playlist/shuffle_off.png</file>
   <file alias="shuffle_on">pixmaps/playlist/shuffle_on.png</file>
   <file alias="jump_to">pixmaps/playlist/jumpto.png</file>
   <file alias="type_directory">pixmaps/types/type_directory.png</file>




More information about the vlc-devel mailing list