Commit 7bcfcc69 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: moving Random to the normal toolbars

parent d41b6e26
...@@ -89,6 +89,9 @@ void ActionsManager::doAction( int id_action ) ...@@ -89,6 +89,9 @@ void ActionsManager::doAction( int id_action )
break; break;
case QUIT_ACTION: case QUIT_ACTION:
THEDP->quit(); break; THEDP->quit(); break;
case RANDOM_ACTION:
// FIXME
break;
default: default:
msg_Dbg( p_intf, "Action: %i", id_action ); msg_Dbg( p_intf, "Action: %i", id_action );
break; break;
......
...@@ -51,6 +51,7 @@ typedef enum actionType_e ...@@ -51,6 +51,7 @@ typedef enum actionType_e
SKIP_BACK_ACTION, SKIP_BACK_ACTION,
SKIP_FW_ACTION, SKIP_FW_ACTION,
QUIT_ACTION, QUIT_ACTION,
RANDOM_ACTION,
} actionType_e; } actionType_e;
class ActionsManager : public QObject class ActionsManager : public QObject
......
...@@ -172,7 +172,6 @@ void AbstractController::createAndAddWidget( QBoxLayout *controlLayout, ...@@ -172,7 +172,6 @@ void AbstractController::createAndAddWidget( QBoxLayout *controlLayout,
button->setToolTip( tooltip ); \ button->setToolTip( tooltip ); \
button->setIcon( QIcon( ":/"#image ) ); button->setIcon( QIcon( ":/"#image ) );
#define ENABLE_ON_VIDEO( a ) \ #define ENABLE_ON_VIDEO( a ) \
CONNECT( THEMIM->getIM(), voutChanged( bool ), a, setEnabled( bool ) ); \ CONNECT( THEMIM->getIM(), voutChanged( bool ), a, setEnabled( bool ) ); \
a->setEnabled( THEMIM->getIM()->hasVideo() ); /* TODO: is this necessary? when input is started before the interface? */ 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, ...@@ -180,18 +179,19 @@ void AbstractController::createAndAddWidget( QBoxLayout *controlLayout,
#define ENABLE_ON_INPUT( a ) \ #define ENABLE_ON_INPUT( a ) \
CONNECT( this, inputExists( bool ), a, setEnabled( bool ) ); \ CONNECT( this, inputExists( bool ), a, setEnabled( bool ) ); \
a->setEnabled( THEMIM->getIM()->hasInput() ); /* TODO: is this necessary? when input is started before the interface? */ 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; \ #define NORMAL_BUTTON( name ) \
setupButton( name ## Button ); \ QToolButton * name ## Button = new QToolButton; \
setupButton( name ## Button ); \
CONNECT_MAP_SET( name ## Button, name ## _ACTION ); \ CONNECT_MAP_SET( name ## Button, name ## _ACTION ); \
BUTTON_SET_BAR( name ## Button ); \ BUTTON_SET_BAR( name ## Button ); \
widget = name ## Button; widget = name ## Button;
QWidget *AbstractController::createWidget( buttonType_e button, int options ) QWidget *AbstractController::createWidget( buttonType_e button, int options )
{ {
bool b_flat = options & WIDGET_FLAT; bool b_flat = options & WIDGET_FLAT;
bool b_big = options & WIDGET_BIG; bool b_big = options & WIDGET_BIG;
bool b_shiny = options & WIDGET_SHINY; bool b_shiny = options & WIDGET_SHINY;
bool b_special = false; bool b_special = false;
...@@ -239,8 +239,9 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options ) ...@@ -239,8 +239,9 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
ENABLE_ON_VIDEO( FRAMEButton ); ENABLE_ON_VIDEO( FRAMEButton );
} }
break; break;
case FULLSCREEN_BUTTON:{ case FULLSCREEN_BUTTON:
case DEFULLSCREEN_BUTTON:{ case DEFULLSCREEN_BUTTON:
{
NORMAL_BUTTON( FULLSCREEN ); NORMAL_BUTTON( FULLSCREEN );
ENABLE_ON_VIDEO( FULLSCREENButton ); ENABLE_ON_VIDEO( FULLSCREENButton );
} }
...@@ -361,6 +362,7 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options ) ...@@ -361,6 +362,7 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
break; break;
case RANDOM_BUTTON: { case RANDOM_BUTTON: {
NORMAL_BUTTON( RANDOM ); NORMAL_BUTTON( RANDOM );
RANDOMButton->setCheckable( true );
} }
break; break;
default: default:
......
...@@ -80,6 +80,7 @@ typedef enum buttonType_e ...@@ -80,6 +80,7 @@ typedef enum buttonType_e
SKIP_BACK_BUTTON, SKIP_BACK_BUTTON,
SKIP_FW_BUTTON, SKIP_FW_BUTTON,
QUIT_BUTTON, QUIT_BUTTON,
RANDOM_BUTTON,
BUTTON_MAX, BUTTON_MAX,
SPLITTER = 0x20, SPLITTER = 0x20,
...@@ -102,7 +103,7 @@ static const char* const nameL[BUTTON_MAX] = { N_("Play"), N_("Stop"), N_("Open" ...@@ -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_("Previous"), N_("Next"), N_("Slower"), N_("Faster"), N_("Fullscreen"),
N_("De-Fullscreen"), N_("Extended panel"), N_("Playlist"), N_("Snapshot"), N_("De-Fullscreen"), N_("Extended panel"), N_("Playlist"), N_("Snapshot"),
N_("Record"), N_("A->B Loop"), N_("Frame By Frame"), N_("Trickplay Reverse"), 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, static const char* const tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP,
N_("Stop playback"), N_("Open a medium"), N_("Stop playback"), N_("Open a medium"),
N_("Previous media in the playlist"), N_("Previous media in the playlist"),
...@@ -111,14 +112,15 @@ static const char* const tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP, ...@@ -111,14 +112,15 @@ static const char* const tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP,
N_("Show extended settings" ), N_( "Show playlist" ), N_("Show extended settings" ), N_( "Show playlist" ),
N_( "Take a snapshot" ), N_( "Record" ), N_( "Take a snapshot" ), N_( "Record" ),
N_( "Loop from point A to point B continuously." ), N_("Frame by frame"), 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", static const QString iconL[BUTTON_MAX] ={ ":/toolbar/play_b", ":/toolbar/stop_b",
":/toolbar/eject", ":/toolbar/previous_b", ":/toolbar/next_b", ":/toolbar/eject", ":/toolbar/previous_b", ":/toolbar/next_b",
":/toolbar/slower", ":/toolbar/faster", ":/toolbar/fullscreen", ":/toolbar/slower", ":/toolbar/faster", ":/toolbar/fullscreen",
":/toolbar/defullscreen", ":/toolbar/extended", ":/toolbar/playlist", ":/toolbar/defullscreen", ":/toolbar/extended", ":/toolbar/playlist",
":/toolbar/snapshot", ":/toolbar/record", ":/toolbar/atob_nob", ":/toolbar/snapshot", ":/toolbar/record", ":/toolbar/atob_nob",
":/toolbar/frame", ":/toolbar/reverse", ":/toolbar/skip_back", ":/toolbar/frame", ":/toolbar/reverse", ":/toolbar/skip_back",
":/toolbar/skip_fw", ":/toolbar/clear" }; ":/toolbar/skip_fw", ":/toolbar/clear", ":/buttons/playlist/shuffle_on" };
enum enum
{ {
......
...@@ -235,4 +235,3 @@ void AtoB_Button::setIcons( bool timeA, bool timeB ) ...@@ -235,4 +235,3 @@ void AtoB_Button::setIcons( bool timeA, bool timeB )
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment