[vlc-devel] commit: Qt: moving Random to the normal toolbars (Jean-Baptiste Kempf )

git version control git at videolan.org
Fri Dec 4 07:21:46 CET 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Nov 28 14:09:35 2009 +0100| [7bcfcc69ba66f323c8d5a91c31b005aa8795cfbe] | committer: Jean-Baptiste Kempf 

Qt: moving Random to the normal toolbars

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

 modules/gui/qt4/actions_manager.cpp              |    3 +++
 modules/gui/qt4/actions_manager.hpp              |    1 +
 modules/gui/qt4/components/controller.cpp        |   20 +++++++++++---------
 modules/gui/qt4/components/controller.hpp        |    8 +++++---
 modules/gui/qt4/components/controller_widget.cpp |    1 -
 5 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/modules/gui/qt4/actions_manager.cpp b/modules/gui/qt4/actions_manager.cpp
index b07e390..e4ac5a4 100644
--- a/modules/gui/qt4/actions_manager.cpp
+++ b/modules/gui/qt4/actions_manager.cpp
@@ -89,6 +89,9 @@ void ActionsManager::doAction( int id_action )
             break;
         case QUIT_ACTION:
             THEDP->quit();  break;
+        case RANDOM_ACTION:
+            // FIXME
+            break;
         default:
             msg_Dbg( p_intf, "Action: %i", id_action );
             break;
diff --git a/modules/gui/qt4/actions_manager.hpp b/modules/gui/qt4/actions_manager.hpp
index d42519e..9a56fde 100644
--- a/modules/gui/qt4/actions_manager.hpp
+++ b/modules/gui/qt4/actions_manager.hpp
@@ -51,6 +51,7 @@ typedef enum actionType_e
     SKIP_BACK_ACTION,
     SKIP_FW_ACTION,
     QUIT_ACTION,
+    RANDOM_ACTION,
 } actionType_e;
 
 class ActionsManager : public QObject
diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index 47aac5b..aa73f05 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -172,7 +172,6 @@ void AbstractController::createAndAddWidget( QBoxLayout *controlLayout,
     button->setToolTip( tooltip );          \
     button->setIcon( QIcon( ":/"#image ) );
 
-
 #define ENABLE_ON_VIDEO( a ) \
     CONNECT( THEMIM->getIM(), voutChanged( bool ), a, setEnabled( bool ) ); \
     a->setEnabled( THEMIM->getIM()->hasVideo() ); /* TODO: is this necessary? when input is started before the interface? */
@@ -180,18 +179,19 @@ void AbstractController::createAndAddWidget( QBoxLayout *controlLayout,
 #define ENABLE_ON_INPUT( a ) \
     CONNECT( this, inputExists( bool ), a, setEnabled( bool ) ); \
     a->setEnabled( THEMIM->getIM()->hasInput() ); /* TODO: is this necessary? when input is started before the interface? */
-#define NORMAL_BUTTON( name ) \
-    QToolButton * name ## Button = new QToolButton; \
-    setupButton( name ## Button ); \
+
+#define NORMAL_BUTTON( name )                           \
+    QToolButton * name ## Button = new QToolButton;     \
+    setupButton( name ## Button );                      \
     CONNECT_MAP_SET( name ## Button, name ## _ACTION ); \
-    BUTTON_SET_BAR( name ## Button ); \
+    BUTTON_SET_BAR( name ## Button );                   \
     widget = name ## Button;
 
 QWidget *AbstractController::createWidget( buttonType_e button, int options )
 {
 
-    bool b_flat = options & WIDGET_FLAT;
-    bool b_big = options & WIDGET_BIG;
+    bool b_flat  = options & WIDGET_FLAT;
+    bool b_big   = options & WIDGET_BIG;
     bool b_shiny = options & WIDGET_SHINY;
     bool b_special = false;
 
@@ -239,8 +239,9 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
         ENABLE_ON_VIDEO( FRAMEButton );
         }
         break;
-    case FULLSCREEN_BUTTON:{
-    case DEFULLSCREEN_BUTTON:{
+    case FULLSCREEN_BUTTON:
+    case DEFULLSCREEN_BUTTON:
+        {
         NORMAL_BUTTON( FULLSCREEN );
         ENABLE_ON_VIDEO( FULLSCREENButton );
         }
@@ -361,6 +362,7 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
         break;
     case RANDOM_BUTTON: {
         NORMAL_BUTTON( RANDOM );
+        RANDOMButton->setCheckable( true );
         }
         break;
     default:
diff --git a/modules/gui/qt4/components/controller.hpp b/modules/gui/qt4/components/controller.hpp
index 9a4933d..f7a046b 100644
--- a/modules/gui/qt4/components/controller.hpp
+++ b/modules/gui/qt4/components/controller.hpp
@@ -80,6 +80,7 @@ typedef enum buttonType_e
     SKIP_BACK_BUTTON,
     SKIP_FW_BUTTON,
     QUIT_BUTTON,
+    RANDOM_BUTTON,
     BUTTON_MAX,
 
     SPLITTER = 0x20,
@@ -102,7 +103,7 @@ static const char* const nameL[BUTTON_MAX] = { N_("Play"), N_("Stop"), N_("Open"
     N_("Previous"), N_("Next"), N_("Slower"), N_("Faster"), N_("Fullscreen"),
    N_("De-Fullscreen"), N_("Extended panel"), N_("Playlist"), N_("Snapshot"),
    N_("Record"), N_("A->B Loop"), N_("Frame By Frame"), N_("Trickplay Reverse"),
-   N_("Step backward" ), N_("Step forward"), N_("Quit") };
+   N_("Step backward" ), N_("Step forward"), N_("Quit"), N_("Random") };
 static const char* const tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP,
     N_("Stop playback"), N_("Open a medium"),
     N_("Previous media in the playlist"),
@@ -111,14 +112,15 @@ static const char* const tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP,
     N_("Show extended settings" ), N_( "Show playlist" ),
     N_( "Take a snapshot" ), N_( "Record" ),
     N_( "Loop from point A to point B continuously." ), N_("Frame by frame"),
-    N_("Reverse"), N_("Step backward"), N_("Step forward"), N_("Quit") };
+    N_("Reverse"), N_("Step backward"), N_("Step forward"), N_("Quit"),
+    N_("Random") };
 static const QString iconL[BUTTON_MAX] ={ ":/toolbar/play_b", ":/toolbar/stop_b",
     ":/toolbar/eject", ":/toolbar/previous_b", ":/toolbar/next_b",
     ":/toolbar/slower", ":/toolbar/faster", ":/toolbar/fullscreen",
     ":/toolbar/defullscreen", ":/toolbar/extended", ":/toolbar/playlist",
     ":/toolbar/snapshot", ":/toolbar/record", ":/toolbar/atob_nob",
     ":/toolbar/frame", ":/toolbar/reverse", ":/toolbar/skip_back",
-    ":/toolbar/skip_fw", ":/toolbar/clear" };
+    ":/toolbar/skip_fw", ":/toolbar/clear", ":/buttons/playlist/shuffle_on" };
 
 enum
 {
diff --git a/modules/gui/qt4/components/controller_widget.cpp b/modules/gui/qt4/components/controller_widget.cpp
index d6916ba..f13a648 100644
--- a/modules/gui/qt4/components/controller_widget.cpp
+++ b/modules/gui/qt4/components/controller_widget.cpp
@@ -235,4 +235,3 @@ void AtoB_Button::setIcons( bool timeA, bool timeB )
     }
 }
 
-




More information about the vlc-devel mailing list