]> git.sesse.net Git - vlc/commitdiff
Qt: moving Random to the normal toolbars
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 28 Nov 2009 13:09:35 +0000 (14:09 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 4 Dec 2009 06:21:39 +0000 (07:21 +0100)
modules/gui/qt4/actions_manager.cpp
modules/gui/qt4/actions_manager.hpp
modules/gui/qt4/components/controller.cpp
modules/gui/qt4/components/controller.hpp
modules/gui/qt4/components/controller_widget.cpp

index b07e390ed76080d33fadf8c65bc28e0673b4d79e..e4ac5a4a4f3b0e5658aa651fb9974fe232504c7b 100644 (file)
@@ -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;
index d42519e1726776e8d460280251e45df242006918..9a56fde24e1f68fae58a39f853e3758b0a259af5 100644 (file)
@@ -51,6 +51,7 @@ typedef enum actionType_e
     SKIP_BACK_ACTION,
     SKIP_FW_ACTION,
     QUIT_ACTION,
+    RANDOM_ACTION,
 } actionType_e;
 
 class ActionsManager : public QObject
index 47aac5bd3d8be5b5e5bb56b4d878a78d3e43bb1e..aa73f05a80a2d9c787ce10421ddd7bfab64eef4c 100644 (file)
@@ -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:
index 9a4933d48d645ab5cfdd30246f34bb3ba11a5675..f7a046b12f73e2814ae2652ff1762c4d0ee0fbc9 100644 (file)
@@ -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
 {
index d6916bae3860d69f2c9df5dd7bbcc315ca828e45..f13a64855ae0413999e414c3544d091e00a979c5 100644 (file)
@@ -235,4 +235,3 @@ void AtoB_Button::setIcons( bool timeA, bool timeB )
     }
 }
 
-