Commit f729cfdf authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

[Qt] Fix small glitches, issues, because of previous commits.

parent 06825f81
...@@ -59,7 +59,8 @@ ...@@ -59,7 +59,8 @@
* This has helper to create any toolbar, any buttons and to manage the actions * This has helper to create any toolbar, any buttons and to manage the actions
* *
*****/ *****/
AbstractController::AbstractController( intf_thread_t * _p_i ) : QFrame( NULL ) AbstractController::AbstractController( intf_thread_t * _p_i, QWidget *_parent )
: QFrame( _parent )
{ {
p_intf = _p_i; p_intf = _p_i;
advControls = NULL; advControls = NULL;
...@@ -329,11 +330,11 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options ) ...@@ -329,11 +330,11 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
break; break;
case MENU_BUTTONS: case MENU_BUTTONS:
widget = discFrame(); widget = discFrame();
// widget->hide(); widget->hide();
break; break;
case TELETEXT_BUTTONS: case TELETEXT_BUTTONS:
widget = telexFrame(); widget = telexFrame();
// widget->hide(); widget->hide();
break; break;
case VOLUME: case VOLUME:
{ {
...@@ -359,7 +360,7 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options ) ...@@ -359,7 +360,7 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
break; break;
case ADVANCED_CONTROLLER: case ADVANCED_CONTROLLER:
{ {
advControls = new AdvControlsWidget( p_intf ); advControls = new AdvControlsWidget( p_intf, this );
widget = advControls; widget = advControls;
} }
break; break;
...@@ -373,7 +374,7 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options ) ...@@ -373,7 +374,7 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
} }
break; break;
default: default:
msg_Warn( p_intf, "This should not happen" ); msg_Warn( p_intf, "This should not happen %i", button );
break; break;
} }
...@@ -780,8 +781,9 @@ void AbstractController::frame() ...@@ -780,8 +781,9 @@ void AbstractController::frame()
* DA Control Widget ! * DA Control Widget !
*****************************/ *****************************/
ControlsWidget::ControlsWidget( intf_thread_t *_p_i, ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
bool b_advControls ) : bool b_advControls,
AbstractController( _p_i ) QWidget *_parent ) :
AbstractController( _p_i, _parent )
{ {
setSizePolicy( QSizePolicy::Preferred , QSizePolicy::Maximum ); setSizePolicy( QSizePolicy::Preferred , QSizePolicy::Maximum );
...@@ -795,21 +797,22 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, ...@@ -795,21 +797,22 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
controlLayout1->setSpacing( 0 ); controlLayout1->setSpacing( 0 );
QString line1 = getSettings()->value( "MainWindow/Controls1", QString line1 = getSettings()->value( "MainWindow/Controls1",
"18;19;25" ).toString(); "64;36;37;38;65").toString();
parseAndCreate( line1, controlLayout1 ); parseAndCreate( line1, controlLayout1 );
/* QString line2 = QString( "%1-2;%2;%3;%4;%5;%6;%6;%7;%8;%9;%6;%10;%11-4") /* QString line2 = QString( "%1-2;%2;%3;%4;%5;%6;%6;%7;%8;%9;%6;%10;%11-4")
.arg( PLAY_BUTTON ) .arg( WIDGET_SPACER ) .arg( PLAY_BUTTON ) .arg( WIDGET_SPACER )
.arg( PREVIOUS_BUTTON ) .arg( STOP_BUTTON ) .arg( PREVIOUS_BUTTON ) .arg( STOP_BUTTON )
.arg( NEXT_BUTTON ) .arg( WIDGET_SPACER ) .arg( NEXT_BUTTON ) .arg( WIDGET_SPACER )
.arg( FULLSCREEN_BUTTON ) .arg( PLAYLIST_BUTTON ) .arg( FULLSCREEN_BUTTON ) .arg( PLAYLIST_BUTTON )
.arg( EXTENDED_BUTTON ) .arg( WIDGET_SPACER_EXTEND ) .arg( EXTENDED_BUTTON ) .arg( WIDGET_SPACER_EXTEND )
.arg( VOLUME ); */ .arg( VOLUME );
msg_Dbg( p_intf, "%s", qtu( line2 )); */
QHBoxLayout *controlLayout2 = new QHBoxLayout; QHBoxLayout *controlLayout2 = new QHBoxLayout;
controlLayout2->setSpacing( 0 ); controlLayout2->setSpacing( 0 );
QString line2 = getSettings()->value( "MainWindow/Controls2", QString line2 = getSettings()->value( "MainWindow/Controls2",
"0-2;21;4;2;5;21;8;11;10;21;22;20-4" ).toString(); "0-2;64;3;1;4;64;7;10;9;65;34-4" ).toString();
parseAndCreate( line2, controlLayout2 ); parseAndCreate( line2, controlLayout2 );
if( !b_advancedVisible && advControls ) advControls->hide(); if( !b_advancedVisible && advControls ) advControls->hide();
...@@ -838,8 +841,8 @@ void ControlsWidget::toggleAdvanced() ...@@ -838,8 +841,8 @@ void ControlsWidget::toggleAdvanced()
emit advancedControlsToggled( b_advancedVisible ); emit advancedControlsToggled( b_advancedVisible );
} }
AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i ) : AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i, QWidget *_parent ) :
AbstractController( _p_i ) AbstractController( _p_i, _parent )
{ {
controlLayout = new QHBoxLayout( this ); controlLayout = new QHBoxLayout( this );
controlLayout->setMargin( 0 ); controlLayout->setMargin( 0 );
...@@ -851,12 +854,12 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i ) : ...@@ -851,12 +854,12 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i ) :
.arg( FRAME_BUTTON ); */ .arg( FRAME_BUTTON ); */
QString line = getSettings()->value( "MainWindow/AdvControl", QString line = getSettings()->value( "MainWindow/AdvControl",
"12;13;14;15" ).toString(); "12;11;13;14" ).toString();
parseAndCreate( line, controlLayout ); parseAndCreate( line, controlLayout );
} }
InputControlsWidget::InputControlsWidget( intf_thread_t *_p_i ) : InputControlsWidget::InputControlsWidget( intf_thread_t *_p_i, QWidget *_parent ) :
AbstractController( _p_i ) AbstractController( _p_i, _parent )
{ {
controlLayout = new QHBoxLayout( this ); controlLayout = new QHBoxLayout( this );
controlLayout->setMargin( 0 ); controlLayout->setMargin( 0 );
...@@ -867,7 +870,7 @@ InputControlsWidget::InputControlsWidget( intf_thread_t *_p_i ) : ...@@ -867,7 +870,7 @@ InputControlsWidget::InputControlsWidget( intf_thread_t *_p_i ) :
.arg( INPUT_SLIDER ) .arg( INPUT_SLIDER )
.arg( FASTER_BUTTON ); */ .arg( FASTER_BUTTON ); */
QString line = getSettings()->value( "MainWindow/InputControl", QString line = getSettings()->value( "MainWindow/InputControl",
"6-1;16;7-1" ).toString(); "5-1;33;6-1" ).toString();
parseAndCreate( line, controlLayout ); parseAndCreate( line, controlLayout );
} }
/********************************************************************** /**********************************************************************
...@@ -901,11 +904,11 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i ) ...@@ -901,11 +904,11 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i )
controlLayout->setLayoutMargins( 5, 2, 5, 2, 5 ); controlLayout->setLayoutMargins( 5, 2, 5, 2, 5 );
/* First line */ /* First line */
InputControlsWidget *inputC = new InputControlsWidget( p_intf ); InputControlsWidget *inputC = new InputControlsWidget( p_intf, this );
// controlLayout->addWidget( inputC, 0, 0, 1, -1 ); controlLayout->addWidget( inputC );
/* Second line */ /* Second line */
/* QString line2 = QString( "%1-2;%2;%3;%4;%5;%2;%6;%2;%7;%2;%8;%9;%10-4") /* QString line = QString( "%1-2;%2;%3;%4;%5;%2;%6;%2;%7;%2;%8;%9;%10-4")
.arg( PLAY_BUTTON ) .arg( PLAY_BUTTON )
.arg( WIDGET_SPACER ) .arg( WIDGET_SPACER )
.arg( PREVIOUS_BUTTON ) .arg( PREVIOUS_BUTTON )
...@@ -919,7 +922,7 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i ) ...@@ -919,7 +922,7 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i )
.arg( VOLUME ); */ .arg( VOLUME ); */
QString line = getSettings()->value( "MainWindow/FSCline", QString line = getSettings()->value( "MainWindow/FSCline",
"0-2;21;4;2;5;21;18;21;19;21;9;22;23-4" ).toString(); "0-2;64;3;1;4;64;36;64;37;64;8;65;35-4;34" ).toString();
parseAndCreate( line, controlLayout ); parseAndCreate( line, controlLayout );
/* hiding timer */ /* hiding timer */
......
...@@ -143,7 +143,7 @@ class AbstractController : public QFrame ...@@ -143,7 +143,7 @@ class AbstractController : public QFrame
Q_OBJECT Q_OBJECT
public: public:
AbstractController( intf_thread_t *_p_i ); AbstractController( intf_thread_t *_p_i, QWidget *_parent = 0 );
protected: protected:
intf_thread_t *p_intf; intf_thread_t *p_intf;
...@@ -251,7 +251,7 @@ class AdvControlsWidget : public AbstractController ...@@ -251,7 +251,7 @@ class AdvControlsWidget : public AbstractController
{ {
Q_OBJECT Q_OBJECT
public: public:
AdvControlsWidget( intf_thread_t * ); AdvControlsWidget( intf_thread_t *, QWidget *_parent = 0 );
}; };
/* Slider Bar */ /* Slider Bar */
...@@ -259,7 +259,7 @@ class InputControlsWidget : public AbstractController ...@@ -259,7 +259,7 @@ class InputControlsWidget : public AbstractController
{ {
Q_OBJECT Q_OBJECT
public: public:
InputControlsWidget( intf_thread_t * ); InputControlsWidget( intf_thread_t * , QWidget *_parent = 0 );
}; };
/* Button Bar */ /* Button Bar */
...@@ -268,7 +268,8 @@ class ControlsWidget : public AbstractController ...@@ -268,7 +268,8 @@ class ControlsWidget : public AbstractController
Q_OBJECT Q_OBJECT
public: public:
/* p_intf, advanced control visible or not, blingbling or not */ /* p_intf, advanced control visible or not, blingbling or not */
ControlsWidget( intf_thread_t *_p_i, bool b_advControls ); ControlsWidget( intf_thread_t *_p_i, bool b_advControls,
QWidget *_parent = 0 );
virtual ~ControlsWidget(); virtual ~ControlsWidget();
protected: protected:
......
...@@ -54,14 +54,15 @@ ToolbarEditDialog::ToolbarEditDialog( intf_thread_t *_p_intf) ...@@ -54,14 +54,15 @@ ToolbarEditDialog::ToolbarEditDialog( intf_thread_t *_p_intf)
QSizePolicy::MinimumExpanding ); QSizePolicy::MinimumExpanding );
QGridLayout *boxLayout = new QGridLayout( widgetBox ); QGridLayout *boxLayout = new QGridLayout( widgetBox );
boxLayout->addWidget( new WidgetListing( p_intf, this ), 0, 0, 1, -1);
flatBox = new QCheckBox( qtr( "Flat Button" ) ); flatBox = new QCheckBox( qtr( "Flat Button" ) );
bigBox = new QCheckBox( qtr( "Big Button" ) ); bigBox = new QCheckBox( qtr( "Big Button" ) );
shinyBox = new QCheckBox( qtr( "Native Slider" ) ); shinyBox = new QCheckBox( qtr( "Native Slider" ) );
shinyBox->setChecked( true ); shinyBox->setChecked( true );
boxLayout->addWidget( new WidgetListing( p_intf, this ), 0, 0, 1, -1);
boxLayout->addWidget( flatBox, 1, 0 ); boxLayout->addWidget( flatBox, 1, 0 );
boxLayout->addWidget( bigBox, 1, 1 ); boxLayout->addWidget( bigBox, 1, 1 );
boxLayout->addWidget( bigBox, 1, 2 ); boxLayout->addWidget( shinyBox, 1, 2 );
mainLayout->addWidget( widgetBox, 0, 0, 1, -1 ); mainLayout->addWidget( widgetBox, 0, 0, 1, -1 );
...@@ -174,8 +175,8 @@ WidgetListing::WidgetListing( intf_thread_t *p_intf, QWidget *_parent ) ...@@ -174,8 +175,8 @@ WidgetListing::WidgetListing( intf_thread_t *p_intf, QWidget *_parent )
break; break;
case VOLUME: case VOLUME:
{ {
bool b_shiny = false; SoundWidget *snd = new SoundWidget( this, p_intf,
SoundWidget *snd = new SoundWidget( this, p_intf, b_shiny ); parent->getOptions() & WIDGET_SHINY );
widget = snd; widget = snd;
} }
widgetItem->setText( qtr("Volume") ); widgetItem->setText( qtr("Volume") );
...@@ -232,7 +233,7 @@ WidgetListing::WidgetListing( intf_thread_t *p_intf, QWidget *_parent ) ...@@ -232,7 +233,7 @@ WidgetListing::WidgetListing( intf_thread_t *p_intf, QWidget *_parent )
break; break;
case ADVANCED_CONTROLLER: case ADVANCED_CONTROLLER:
{ {
AdvControlsWidget *advControls = new AdvControlsWidget( p_intf ); AdvControlsWidget *advControls = new AdvControlsWidget( p_intf, this );
widget = advControls; widget = advControls;
} }
widgetItem->setText( qtr("Advanced Buttons") ); widgetItem->setText( qtr("Advanced Buttons") );
...@@ -288,7 +289,7 @@ DroppingController::DroppingController( intf_thread_t *_p_intf ) ...@@ -288,7 +289,7 @@ DroppingController::DroppingController( intf_thread_t *_p_intf )
setFrameShadow( QFrame::Raised ); setFrameShadow( QFrame::Raised );
QString line2 = getSettings()->value( "MainWindow/Controls2", QString line2 = getSettings()->value( "MainWindow/Controls2",
"0-2;21;4;2;5;21;8;11;10;21;22;20-4" ).toString(); "0-2;64;3;1;4;64;7;10;9;65;34-4" ).toString();
parseAndCreate( line2, controlLayout ); parseAndCreate( line2, controlLayout );
...@@ -329,6 +330,7 @@ void DroppingController::createAndAddWidget( QBoxLayout *controlLayout, ...@@ -329,6 +330,7 @@ void DroppingController::createAndAddWidget( QBoxLayout *controlLayout,
/* Some Widgets are deactivated at creation */ /* Some Widgets are deactivated at creation */
widg->setEnabled( true ); widg->setEnabled( true );
widg->show();
controlLayout->insertWidget( i_index, widg ); controlLayout->insertWidget( i_index, widg );
} }
} }
......
...@@ -55,7 +55,8 @@ public: ...@@ -55,7 +55,8 @@ public:
} }
virtual ~ToolbarEditDialog(); virtual ~ToolbarEditDialog();
int getOptions() { return flatBox->isChecked() * WIDGET_FLAT + int getOptions() { return flatBox->isChecked() * WIDGET_FLAT +
bigBox->isChecked() * WIDGET_BIG; } bigBox->isChecked() * WIDGET_BIG +
shinyBox->isChecked() * WIDGET_SHINY; }
private: private:
ToolbarEditDialog( intf_thread_t * ); ToolbarEditDialog( intf_thread_t * );
static ToolbarEditDialog *instance; static ToolbarEditDialog *instance;
......
...@@ -375,10 +375,10 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -375,10 +375,10 @@ void MainInterface::handleMainUi( QSettings *settings )
/* Create the CONTROLS Widget */ /* Create the CONTROLS Widget */
controls = new ControlsWidget( p_intf, controls = new ControlsWidget( p_intf,
settings->value( "adv-controls", false ).toBool() ); settings->value( "adv-controls", false ).toBool(), this );
CONNECT( controls, advancedControlsToggled( bool ), CONNECT( controls, advancedControlsToggled( bool ),
this, doComponentsUpdate() ); this, doComponentsUpdate() );
InputControlsWidget *inputC = new InputControlsWidget( p_intf ); InputControlsWidget *inputC = new InputControlsWidget( p_intf, this );
/* Add the controls Widget to the main Widget */ /* Add the controls Widget to the main Widget */
mainLayout->insertWidget( 0, controls, 0, Qt::AlignBottom ); mainLayout->insertWidget( 0, controls, 0, Qt::AlignBottom );
......
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