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