Commit 4396baf0 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4: Controller Rework.

Introduction of an abstractController, that can:
- create most of the interface controller widgets
- execute their actions

All buttons connect themselve to a mapper and a doAction( id_action )
that centralize everything. The Action could go into a mainActionner, I guess. Opinions?

This cleans a lot the signal and exchanges between MI and Controller,
between Controller and FSC. The buttons do their own cooking and connect
directly to THEMIM or to some of the few signals of the Controller
(inputExist, inputHasVideo, inputCanRecord)

This reworks most of the HACKS of Teletext Buttons and AtoB Buttons

The FSC inherit from AbstractController and not Controller, which remove the b_fscreation HACK.

There will be some regressions, I tried my best to minimize them.

The code is generic enough to be able to customize the toolbars now. HAVE FUN!
parent 08cbd4da
/*****************************************************************************
* interface_widgets.cpp : Custom widgets for the main interface
* Controller.cpp : Controller for the main interface
****************************************************************************
* Copyright ( C ) 2006 the VideoLAN team
* Copyright ( C ) 2006-2008 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
......@@ -41,13 +41,14 @@
#include <QLabel>
#include <QSpacerItem>
#include <QCursor>
#include <QPushButton>
#include <QToolButton>
#include <QToolButton>
#include <QHBoxLayout>
#include <QMenu>
#include <QPalette>
#include <QResizeEvent>
#include <QDate>
#include <QSignalMapper>
#define I_PLAY_TOOLTIP N_("Play\nIf the playlist is empty, open a media")
......@@ -55,408 +56,364 @@
* TEH controls
**********************************************************************/
static void setupSmallButton( QPushButton *aButton )
/******
* This is an abstract Toolbar/Controller
* This has helper to create any toolbar, any buttons and to manage the actions
*
*****/
AbstractController::AbstractController( intf_thread_t * _p_i ) : QFrame( NULL )
{
aButton->setMaximumSize( QSize( 26, 26 ) );
aButton->setMinimumSize( QSize( 26, 26 ) );
aButton->setIconSize( QSize( 20, 20 ) );
aButton->setFocusPolicy( Qt::NoFocus );
}
/* init static variables in advanced controls */
mtime_t AdvControlsWidget::timeA = 0;
mtime_t AdvControlsWidget::timeB = 0;
p_intf = _p_i;
AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i, bool b_fsCreation = false ) :
QFrame( NULL ), p_intf( _p_i )
{
QHBoxLayout *advLayout = new QHBoxLayout( this );
advLayout->setMargin( 0 );
advLayout->setSpacing( 0 );
advLayout->setAlignment( Qt::AlignBottom );
/* A to B Button */
ABButton = new QPushButton;
setupSmallButton( ABButton );
advLayout->addWidget( ABButton );
BUTTON_SET_ACT_I( ABButton, "", atob_nob,
qtr( "Loop from point A to point B continuously.\nClick to set point A" ),
fromAtoB() );
timeA = timeB = 0;
i_last_input_id = 0;
/* in FS controller we skip this, because we dont want to have it double
controlled */
if( !b_fsCreation )
CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ),
this, AtoBLoop( float, int, int ) );
/* set up synchronization between main controller and fs controller */
CONNECT( THEMIM->getIM(), advControlsSetIcon(), this, setIcon() );
connect( this, SIGNAL( timeChanged() ),
THEMIM->getIM(), SIGNAL( advControlsSetIcon()));
#if 0
frameButton = new QPushButton( "Fr" );
frameButton->setMaximumSize( QSize( 26, 26 ) );
frameButton->setIconSize( QSize( 20, 20 ) );
advLayout->addWidget( frameButton );
BUTTON_SET_ACT( frameButton, "Fr", qtr( "Frame by frame" ), frame() );
#endif
/* We need one layout. An controller without layout is stupid with
current architecture */
controlLayout = new QGridLayout( this );
/* Record Button */
recordButton = new QPushButton;
setupSmallButton( recordButton );
advLayout->addWidget( recordButton );
BUTTON_SET_ACT_I( recordButton, "", record,
qtr( "Record" ), record() );
/* Snapshot Button */
snapshotButton = new QPushButton;
setupSmallButton( snapshotButton );
advLayout->addWidget( snapshotButton );
BUTTON_SET_ACT_I( snapshotButton, "", snapshot,
qtr( "Take a snapshot" ), snapshot() );
/* Main action provider */
toolbarActionsMapper = new QSignalMapper();
CONNECT( toolbarActionsMapper, mapped( int ),
this, doAction( int ) );
CONNECT( THEMIM->getIM(), statusChanged( int ), this, setStatus( int ) );
}
AdvControlsWidget::~AdvControlsWidget()
{}
void AdvControlsWidget::enableInput( bool enable )
void AbstractController::setStatus( int status )
{
int i_input_id = 0;
if( THEMIM->getInput() != NULL )
{
input_item_t *p_item = input_GetItem( THEMIM->getInput() );
i_input_id = p_item->i_id;
recordButton->setVisible( var_GetBool( THEMIM->getInput(), "can-record" ) );
}
else
{
recordButton->setVisible( false );
}
ABButton->setEnabled( enable );
recordButton->setEnabled( enable );
if( enable && ( i_last_input_id != i_input_id ) )
{
timeA = timeB = 0;
i_last_input_id = i_input_id;
emit timeChanged();
}
}
bool b_hasInput = THEMIM->getIM()->hasInput();
/* Activate the interface buttons according to the presence of the input */
emit inputExists( b_hasInput );
void AdvControlsWidget::enableVideo( bool enable )
{
snapshotButton->setEnabled( enable );
#if 0
frameButton->setEnabled( enable );
#endif
}
emit inputPlaying( status == PLAYING_S );
void AdvControlsWidget::snapshot()
{
vout_thread_t *p_vout =
(vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
if( p_vout )
{
vout_Control( p_vout, VOUT_SNAPSHOT );
vlc_object_release( p_vout );
}
emit inputIsRecordable( b_hasInput &&
var_GetBool( THEMIM->getInput(), "can-record" ) );
}
/* Function called when the button is clicked() */
void AdvControlsWidget::fromAtoB()
void AbstractController::setupButton( QAbstractButton *aButton )
{
if( !timeA )
{
timeA = var_GetTime( THEMIM->getInput(), "time" );
emit timeChanged();
return;
}
if( !timeB )
{
timeB = var_GetTime( THEMIM->getInput(), "time" );
var_SetTime( THEMIM->getInput(), "time" , timeA );
emit timeChanged();
return;
}
timeA = 0;
timeB = 0;
emit timeChanged();
}
static QSizePolicy sizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
sizePolicy.setHorizontalStretch( 0 );
sizePolicy.setVerticalStretch( 0 );
/* setting/synchro icons after click on main or fs controller */
void AdvControlsWidget::setIcon()
{
if( !timeA && !timeB)
{
ABButton->setIcon( QIcon( ":/atob_nob" ) );
ABButton->setToolTip( qtr( "Loop from point A to point B continuously\nClick to set point A" ) );
}
else if( timeA && !timeB )
{
ABButton->setIcon( QIcon( ":/atob_noa" ) );
ABButton->setToolTip( qtr( "Click to set point B" ) );
}
else if( timeA && timeB )
{
ABButton->setIcon( QIcon( ":/atob" ) );
ABButton->setToolTip( qtr( "Stop the A to B loop" ) );
}
aButton->setSizePolicy( sizePolicy );
aButton->setFixedSize( QSize( 26, 26 ) );
aButton->setIconSize( QSize( 20, 20 ) );
aButton->setFocusPolicy( Qt::NoFocus );
}
/* Function called regularly when in an AtoB loop */
void AdvControlsWidget::AtoBLoop( float f_pos, int i_time, int i_length )
#define CONNECT_MAP( a ) CONNECT( a, clicked(), toolbarActionsMapper, map() )
#define SET_MAPPING( a, b ) toolbarActionsMapper->setMapping( a , b )
#define CONNECT_MAP_SET( a, b ) \
CONNECT_MAP( a ); \
SET_MAPPING( a, b );
#define BUTTON_SET_BAR( button, image, tooltip ) \
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? */
#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? */
QWidget *AbstractController::createWidget( buttonType_e button, bool b_flat,
bool b_big, bool b_shiny )
{
if( timeB )
QWidget *widget = NULL;
switch( button )
{
if( ( i_time >= (int)( timeB/1000000 ) )
|| ( i_time < (int)( timeA/1000000 ) ) )
var_SetTime( THEMIM->getInput(), "time" , timeA );
case PLAY_BUTTON: {
PlayButton *playButton = new PlayButton;
setupButton( playButton );
BUTTON_SET_BAR( playButton, play_b, qtr( I_PLAY_TOOLTIP ) );
CONNECT_MAP_SET( playButton, PLAY_ACTION );
CONNECT( this, inputPlaying( bool ),
playButton, updateButton( bool ));
widget = playButton;
}
break;
case STOP_BUTTON:{
QToolButton *stopButton = new QToolButton;
setupButton( stopButton );
CONNECT_MAP_SET( stopButton, STOP_ACTION );
BUTTON_SET_BAR( stopButton, stop_b, qtr( "Stop playback" ) );
widget = stopButton;
}
break;
case PREVIOUS_BUTTON:{
QToolButton *prevButton = new QToolButton;
setupButton( prevButton );
CONNECT_MAP_SET( prevButton, PREVIOUS_ACTION );
BUTTON_SET_BAR( prevButton, previous_b,
qtr( "Previous media in the playlist" ) );
widget = prevButton;
}
break;
case NEXT_BUTTON:
{
QToolButton *nextButton = new QToolButton;
setupButton( nextButton );
CONNECT_MAP_SET( nextButton, NEXT_ACTION );
BUTTON_SET_BAR( nextButton, next_b,
qtr( "Next media in the playlist" ) );
widget = nextButton;
}
break;
case SLOWER_BUTTON:{
QToolButton *slowerButton = new QToolButton;
setupButton( slowerButton );
CONNECT_MAP_SET( slowerButton, SLOWER_ACTION );
BUTTON_SET_BAR( slowerButton, slower, qtr( "Slower" ) );
ENABLE_ON_INPUT( slowerButton );
widget = slowerButton;
}
break;
case FASTER_BUTTON:{
QToolButton *fasterButton = new QToolButton;
setupButton( fasterButton );
CONNECT_MAP_SET( fasterButton, SLOWER_ACTION );
BUTTON_SET_BAR( fasterButton, faster, qtr( "Faster" ) );
ENABLE_ON_INPUT( fasterButton );
widget = fasterButton;
}
break;
#if 0
case FRAME_BUTTON: {
QToolButton *frameButton = new QToolButton( "Fr" );
setupButton( frameButton );
BUTTON_SET_BAR( frameButton, "", qtr( "Frame by frame" ) );
ENABLE_ON_INPUT( frameButton );
widget = frameButton;
}
break;
#endif
case FULLSCREEN_BUTTON:{
QToolButton *fullscreenButton = new QToolButton;
setupButton( fullscreenButton );
CONNECT_MAP_SET( fullscreenButton, FULLSCREEN_ACTION );
BUTTON_SET_BAR( fullscreenButton, fullscreen,
qtr( "Toggle the video in fullscreen" ) );
ENABLE_ON_VIDEO( fullscreenButton );
widget = fullscreenButton;
}
break;
case EXTENDED_BUTTON:{
QToolButton *extSettingsButton = new QToolButton;
setupButton( extSettingsButton );
CONNECT_MAP_SET( extSettingsButton, EXTENDED_ACTION );
BUTTON_SET_BAR( extSettingsButton, extended,
qtr( "Show extended settings" ) );
widget = extSettingsButton;
}
break;
case PLAYLIST_BUTTON:{
QToolButton *playlistButton = new QToolButton;
setupButton( playlistButton );
CONNECT_MAP_SET( playlistButton, PLAYLIST_ACTION );
BUTTON_SET_BAR( playlistButton, playlist,
qtr( "Show playlist" ) );
widget = playlistButton;
}
break;
case SNAPSHOT_BUTTON:{
QToolButton *snapshotButton = new QToolButton;
setupButton( snapshotButton );
CONNECT_MAP_SET( snapshotButton, SNAPSHOT_ACTION );
BUTTON_SET_BAR( snapshotButton, snapshot, qtr( "Take a snapshot" ) );
ENABLE_ON_VIDEO( snapshotButton );
widget = snapshotButton;
}
break;
case RECORD_BUTTON:{
QToolButton *recordButton = new QToolButton;
setupButton( recordButton );
CONNECT_MAP_SET( recordButton, RECORD_ACTION );
BUTTON_SET_BAR( recordButton, record, qtr( "Record" ) );
ENABLE_ON_INPUT( recordButton );
widget = recordButton;
}
break;
case ATOB_BUTTON: {
AtoB_Button *ABButton = new AtoB_Button;
setupButton( ABButton );
BUTTON_SET_BAR( ABButton, atob_nob, qtr( "Loop from point A to point "
"B continuously.\nClick to set point A" ) );
ENABLE_ON_INPUT( ABButton );
CONNECT_MAP_SET( ABButton, ATOB_ACTION );
CONNECT( THEMIM->getIM(), AtoBchanged( bool, bool),
ABButton, setIcons( bool, bool ) );
widget = ABButton;
}
break;
case INPUT_SLIDER: {
InputSlider *slider = new InputSlider( Qt::Horizontal, NULL );
/* Update the position when the IM has changed */
CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ),
slider, setPosition( float, int, int ) );
/* And update the IM, when the position has changed */
CONNECT( slider, sliderDragged( float ),
THEMIM->getIM(), sliderUpdate( float ) );
widget = slider;
}
break;
case MENU_BUTTONS:
widget = discFrame();
widget->hide();
break;
case TELETEXT_BUTTONS:
widget = telexFrame();
widget->hide();
break;
case VOLUME:
{
SoundWidget *snd = new SoundWidget( p_intf, b_shiny );
widget = snd;
}
break;
default:
msg_Warn( p_intf, "This should not happen" );
break;
}
}
void AdvControlsWidget::record()
{
input_thread_t *p_input = THEMIM->getInput();
if( p_input )
/* Customize Buttons */
if( b_flat || b_big )
{
/* This method won't work fine if the stream can't be cut anywhere */
const bool b_recording = var_GetBool( p_input, "record" );
var_SetBool( p_input, "record", !b_recording );
#if 0
else
QToolButton *tmpButton = qobject_cast<QToolButton *>(widget);
if( tmpButton )
{
/* 'record' access-filter is not loaded, we open Save dialog */
input_item_t *p_item = input_GetItem( p_input );
if( !p_item )
return;
char *psz = input_item_GetURI( p_item );
if( psz )
THEDP->streamingDialog( NULL, psz, true );
if( b_flat )
tmpButton->setAutoRaise( b_flat );
if( b_big )
{
tmpButton->setFixedSize( QSize( 32, 32 ) );
tmpButton->setIconSize( QSize( 26, 26 ) );
}
}
#endif
}
return widget;
}
#if 0
//FIXME Frame by frame function
void AdvControlsWidget::frame(){}
#endif
/*****************************
* DA Control Widget !
*****************************/
ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
MainInterface *_p_mi,
bool b_advControls,
bool b_shiny,
bool b_fsCreation) :
QFrame( _p_mi ), p_intf( _p_i )
QWidget *AbstractController::discFrame()
{
setSizePolicy( QSizePolicy::Preferred , QSizePolicy::Maximum );
/** The main Slider **/
slider = new InputSlider( Qt::Horizontal, NULL );
/* Update the position when the IM has changed */
CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ),
slider, setPosition( float, int, int ) );
/* And update the IM, when the position has changed */
CONNECT( slider, sliderDragged( float ),
THEMIM->getIM(), sliderUpdate( float ) );
/** Slower and faster Buttons **/
slowerButton = new QToolButton;
slowerButton->setAutoRaise( true );
slowerButton->setMaximumSize( QSize( 26, 20 ) );
slowerButton->setFocusPolicy( Qt::NoFocus );
BUTTON_SET_ACT_I( slowerButton, "", slower, qtr( "Slower" ), slower() );
fasterButton = new QToolButton;
fasterButton->setAutoRaise( true );
fasterButton->setMaximumSize( QSize( 26, 20 ) );
fasterButton->setFocusPolicy( Qt::NoFocus );
BUTTON_SET_ACT_I( fasterButton, "", faster, qtr( "Faster" ), faster() );
/* advanced Controls handling */
b_advancedVisible = b_advControls;
advControls = new AdvControlsWidget( p_intf, b_fsCreation );
if( !b_advancedVisible ) advControls->hide();
/** Disc and Menus handling */
discFrame = new QWidget( this );
QWidget *discFrame = new QWidget( this );
QHBoxLayout *discLayout = new QHBoxLayout( discFrame );
discLayout->setSpacing( 0 );
discLayout->setMargin( 0 );
discLayout->setSpacing( 0 ); discLayout->setMargin( 0 );
prevSectionButton = new QPushButton( discFrame );
setupSmallButton( prevSectionButton );
QToolButton *prevSectionButton = new QToolButton( discFrame );
setupButton( prevSectionButton );
BUTTON_SET_BAR( prevSectionButton, dvd_prev,
qtr("Previous Chapter/Title" ) );
discLayout->addWidget( prevSectionButton );
menuButton = new QPushButton( discFrame );
setupSmallButton( menuButton );
QToolButton *menuButton = new QToolButton( discFrame );
setupButton( menuButton );
discLayout->addWidget( menuButton );
BUTTON_SET_BAR( menuButton, dvd_menu, qtr( "Menu" ) );
nextSectionButton = new QPushButton( discFrame );
setupSmallButton( nextSectionButton );
QToolButton *nextSectionButton = new QToolButton( discFrame );
setupButton( nextSectionButton );
discLayout->addWidget( nextSectionButton );
BUTTON_SET_BAR( nextSectionButton, dvd_next,
qtr("Next Chapter/Title" ) );
BUTTON_SET_IMG( prevSectionButton, "", dvd_prev, "" );
BUTTON_SET_IMG( nextSectionButton, "", dvd_next, "" );
BUTTON_SET_IMG( menuButton, "", dvd_menu, qtr( "Menu" ) );
discFrame->hide();
/* Change the navigation button display when the IM navigation changes */
CONNECT( THEMIM->getIM(), navigationChanged( int ),
this, setNavigation( int ) );
/* Change the navigation button display when the IM
navigation changes */
CONNECT( THEMIM->getIM(), titleChanged( bool ),
discFrame, setVisible( bool ) );
CONNECT( THEMIM->getIM(), chapterChanged( bool ),
menuButton, setVisible( bool ) );
/* Changes the IM navigation when triggered on the nav buttons */
CONNECT( prevSectionButton, clicked(), THEMIM->getIM(),
sectionPrev() );
sectionPrev() );
CONNECT( nextSectionButton, clicked(), THEMIM->getIM(),
sectionNext() );
sectionNext() );
CONNECT( menuButton, clicked(), THEMIM->getIM(),
sectionMenu() );
sectionMenu() );
return discFrame;
}
QWidget *AbstractController::telexFrame()
{
/**
* Telextext QFrame
* TODO: Merge with upper menu in a StackLayout
**/
telexFrame = new QWidget( this );
TeletextController *telexFrame = new TeletextController;
QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame );
telexLayout->setSpacing( 0 );
telexLayout->setMargin( 0 );
telexOn = new QPushButton;
setupSmallButton( telexOn );
telexLayout->setSpacing( 0 ); telexLayout->setMargin( 0 );
CONNECT( THEMIM->getIM(), teletextPossible( bool ),
telexFrame, setVisible( bool ) );
/* On/Off button */
QToolButton *telexOn = new QToolButton;
telexFrame->telexOn = telexOn;
setupButton( telexOn );
BUTTON_SET_BAR( telexOn, tv, qtr( "Teletext Activation" ) );
telexLayout->addWidget( telexOn );
telexTransparent = new QPushButton;
setupSmallButton( telexTransparent );
/* Teletext Activation and set */
CONNECT( telexOn, clicked( bool ),
THEMIM->getIM(), activateTeletext( bool ) );
CONNECT( THEMIM->getIM(), teletextActivated( bool ),
telexFrame, enableTeletextButtons( bool ) );
/* Transparency button */
QToolButton *telexTransparent = new QToolButton;
telexFrame->telexTransparent = telexTransparent;
setupButton( telexTransparent );
BUTTON_SET_BAR( telexTransparent, tvtelx,
qtr( "Toggle Transparency " ) );
telexTransparent->setEnabled( false );
telexLayout->addWidget( telexTransparent );
b_telexTransparent = false;
telexPage = new QSpinBox;
/* Transparency change and set */
CONNECT( telexTransparent, clicked( bool ),
THEMIM->getIM(), telexSetTransparency( bool ) );
CONNECT( THEMIM->getIM(), teletextTransparencyActivated( bool ),
telexFrame, toggleTeletextTransparency( bool ) );
/* Page setting */
QSpinBox *telexPage = new QSpinBox;
telexFrame->telexPage = telexPage;
telexPage->setRange( 0, 999 );
telexPage->setValue( 100 );
telexPage->setAccelerated( true );
telexPage->setWrapping( true );
telexPage->setAlignment( Qt::AlignRight );
telexPage->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum );
telexLayout->addWidget( telexPage );
telexFrame->hide(); /* default hidden */
CONNECT( telexPage, valueChanged( int ), THEMIM->getIM(),
telexGotoPage( int ) );
CONNECT( THEMIM->getIM(), setNewTelexPage( int ),
telexPage, setValue( int ) );
BUTTON_SET_IMG( telexOn, "", tv, qtr( "Teletext on" ) );
CONNECT( telexOn, clicked(), THEMIM->getIM(),
telexToggleButtons() );
CONNECT( telexOn, clicked( bool ), THEMIM->getIM(),
telexToggle( bool ) );
CONNECT( THEMIM->getIM(), toggleTelexButtons(),
this, toggleTeletext() );
b_telexEnabled = false;
telexTransparent->setEnabled( false );
telexPage->setEnabled( false );
telexLayout->addWidget( telexPage );
BUTTON_SET_IMG( telexTransparent, "", tvtelx, qtr( "Teletext" ) );
CONNECT( telexTransparent, clicked( bool ),
THEMIM->getIM(), telexSetTransparency() );
CONNECT( THEMIM->getIM(), toggleTelexTransparency(),
this, toggleTeletextTransparency() );
CONNECT( THEMIM->getIM(), teletextEnabled( bool ),
this, enableTeletext( bool ) );
/** Play Buttons **/
QSizePolicy sizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
sizePolicy.setHorizontalStretch( 0 );
sizePolicy.setVerticalStretch( 0 );
/* Page change and set */
CONNECT( telexPage, valueChanged( int ),
THEMIM->getIM(), telexSetPage( int ) );
CONNECT( THEMIM->getIM(), newTelexPageSet( int ),
telexPage, setValue( int ) );
/* Play */
playButton = new QPushButton;
playButton->setSizePolicy( sizePolicy );
playButton->setMaximumSize( QSize( 32, 32 ) );
playButton->setMinimumSize( QSize( 32, 32 ) );
playButton->setIconSize( QSize( 26, 26 ) );
playButton->setFocusPolicy( Qt::NoFocus );
/** Prev + Stop + Next Block **/
controlButLayout = new QHBoxLayout;
controlButLayout->setSpacing( 0 ); /* Don't remove that, will be useful */
/* Prev */
QPushButton *prevButton = new QPushButton;
prevButton->setSizePolicy( sizePolicy );
setupSmallButton( prevButton );
controlButLayout->addWidget( prevButton );
/* Stop */
QPushButton *stopButton = new QPushButton;
stopButton->setSizePolicy( sizePolicy );
setupSmallButton( stopButton );
controlButLayout->addWidget( stopButton );