QHBoxLayout *controlLayout1 = new QHBoxLayout;
controlLayout1->setSpacing( 0 );
- QString line1 = getSettings()->value( "MainToolbar1",
- "64;38;64;37-4;65;").toString();
+ QString line1 = getSettings()->value( "MainToolbar1", MAIN_TB1_DEFAULT )
+ .toString();
parseAndCreate( line1, controlLayout1 );
QHBoxLayout *controlLayout2 = new QHBoxLayout;
controlLayout2->setSpacing( 0 );
- QString line2 = getSettings()->value( "MainToolbar2",
- "0-2;64;3;1;4;64;7;10;9;64-4;36-4;65;35-4;" ).toString();
+ QString line2 = getSettings()->value( "MainToolbar2", MAIN_TB2_DEFAULT )
+ .toString();
parseAndCreate( line2, controlLayout2 );
if( !b_advancedVisible && advControls ) advControls->hide();
controlLayout->setMargin( 0 );
controlLayout->setSpacing( 0 );
- QString line = getSettings()->value( "AdvToolbar", "12;11;13;14" )
+ QString line = getSettings()->value( "AdvToolbar", ADV_TB_DEFAULT )
.toString();
parseAndCreate( line, controlLayout );
}
controlLayout->setMargin( 0 );
controlLayout->setSpacing( 0 );
- QString line = getSettings()->value( "InputToolbar",
- "5-1;33;6-1" ).toString();
+ QString line = getSettings()->value( "InputToolbar", INPT_TB_DEFAULT ).toString();
parseAndCreate( line, controlLayout );
}
/**********************************************************************
controlLayout2->addWidget( inputC );
controlLayout = new QHBoxLayout;
- QString line = getSettings()->value( "FSCtoolbar",
- "0-2;64;3;1;4;64;36;64;37;64;8;65;35-4;34;" ).toString();
+ QString line = getSettings()->value( "FSCtoolbar", FSC_TB_DEFAULT ).toString();
parseAndCreate( line, controlLayout );
controlLayout2->addLayout( controlLayout );
#define I_PLAY_TOOLTIP N_("Play\nIf the playlist is empty, open a media")
+#define MAIN_TB1_DEFAULT "64;38;64;37-4;65"
+#define MAIN_TB2_DEFAULT "0-2;64;3;1;4;64;7;10;9;64-4;36-4;65;35-4"
+#define ADV_TB_DEFAULT "12;11;13;14"
+#define INPT_TB_DEFAULT "5-1;33;6-1"
+#define FSC_TB_DEFAULT "0-2;64;3;1;4;64;36;64;37;64;8;65;35-4;34"
+
+
class QPixmap;
class QLabel;
QLabel *label = new QLabel( qtr( "Toolbar position:" ) );
mainTboxLayout->addWidget(label, 0, 0, 1, 2);
- QComboBox *positionCombo = new QComboBox;
- positionCombo->addItems( QStringList() << qtr( "Above the Video" )
- << qtr( "Under the Video" ) );
+ positionCombo = new QComboBox;
+ positionCombo->addItem( qtr( "Under the Video" ), QVariant( 0 ) );
+ positionCombo->addItem( qtr( "Above the Video" ), QVariant( 1 ) );
mainTboxLayout->addWidget( positionCombo, 0, 2, 1, 1 );
QLabel *line1Label = new QLabel( "Line 1:" );
- QString line1 = getSettings()->value( "MainWindow/MainToolbar1" ).toString();
+ QString line1 = getSettings()->value( "MainWindow/MainToolbar1",
+ MAIN_TB1_DEFAULT ).toString();
controller1 = new DroppingController( p_intf, line1,
this );
mainTboxLayout->addWidget( line1Label, 1, 0, 1, 1 );
mainTboxLayout->addWidget( controller1, 1, 1, 1, 2 );
QLabel *line2Label = new QLabel( "Line 2:" );
- QString line2 = getSettings()->value( "MainWindow/MainToolbar2" ).toString();
+ QString line2 = getSettings()->value( "MainWindow/MainToolbar2",
+ MAIN_TB2_DEFAULT ).toString();
controller2 = new DroppingController( p_intf, line2,
this );
mainTboxLayout->addWidget( line2Label, 2, 0, 1, 1 );
/* Advanced ToolBar */
QLabel *advLabel = new QLabel( qtr( "Advanced Widget toolbar:" ) );
- QString lineA = getSettings()->value( "MainWindow/AdvToolbar" )
- .toString();
+ QString lineA = getSettings()->value( "MainWindow/AdvToolbar",
+ ADV_TB_DEFAULT ).toString();
controllerA = new DroppingController( p_intf, lineA,
this );
mainTboxLayout->addWidget( advLabel, 3, 0, 1, 2 );
QGroupBox *timeToolbarBox = new QGroupBox( qtr( "Time Toolbar" ) , this );
QGridLayout *timeTboxLayout = new QGridLayout( timeToolbarBox );
- QString line = getSettings()->value( "MainWindow/InputToolbar" ).toString();
+ QString line = getSettings()->value( "MainWindow/InputToolbar",
+ INPT_TB_DEFAULT ).toString();
controller = new DroppingController( p_intf, line,
this );
timeTboxLayout->addWidget( controller, 0, 0, 1, -1 );
this );
QGridLayout *FSCTboxLayout = new QGridLayout( FSCToolbarBox );
- QString lineFSC = getSettings()->value( "MainWindow/FSCtoolbar" )
- .toString();
+ QString lineFSC = getSettings()->value( "MainWindow/FSCtoolbar",
+ FSC_TB_DEFAULT ).toString();
controllerFSC = new DroppingController( p_intf,
lineFSC, this );
FSCTboxLayout->addWidget( controllerFSC, 0, 0, 1, -1 );
{
msg_Dbg( p_intf, "Close and save" );
hide();
+ getSettings()->setValue( "MainWindow/ToolbarPos",
+ positionCombo->itemData( positionCombo->currentIndex() ).toInt() );
getSettings()->setValue( "MainWindow/MainToolbar1", controller1->getValue() );
getSettings()->setValue( "MainWindow/MainToolbar2", controller2->getValue() );
getSettings()->setValue( "MainWindow/AdvToolbar", controllerA->getValue() );
class ToolbarEditDialog;
class DroppingController;
class QCheckBox;
+class QComboBox;
class WidgetListing : public QListWidget
{
static ToolbarEditDialog *instance;
QCheckBox *flatBox, *bigBox, *shinyBox;
+ QComboBox *positionCombo;
WidgetListing *widgetListing;
DroppingController *controller1, *controller2, *controllerA;
this, doComponentsUpdate() );
inputC = new InputControlsWidget( p_intf, this );
- /* Add the controls Widget to the main Widget */
- mainLayout->insertWidget( 0, controls, 0, Qt::AlignBottom );
- mainLayout->insertWidget( 0, inputC, 0, Qt::AlignBottom );
-
- /* Visualisation */
+ /* Visualisation */
/* Disabled for now, they SUCK */
#if 0
visualSelector = new VisualSelector( p_intf );
bgWidget->resize(
settings->value( "backgroundSize", QSize( 300, 200 ) ).toSize() );
bgWidget->updateGeometry();
- mainLayout->insertWidget( 0, bgWidget );
CONNECT( this, askBgWidgetToToggle(), bgWidget, toggle() );
if( i_visualmode != QT_ALWAYS_VIDEO_MODE &&
/* And video Outputs */
if( videoEmbeddedFlag )
- {
videoWidget = new VideoWidget( p_intf );
- mainLayout->insertWidget( 0, videoWidget, 10 );
- }
+
+ /* Add the controls Widget to the main Widget */
+ mainLayout->insertWidget( 0, bgWidget );
+ if( videoWidget ) mainLayout->insertWidget( 0, videoWidget, 10 );
+ mainLayout->insertWidget( 2, inputC, 0, Qt::AlignBottom );
+ mainLayout->insertWidget( settings->value( "ToolbarPos", 0 ).toInt() ? 0: 3,
+ controls, 0, Qt::AlignBottom );
+
/* Finish the sizing */
main->updateGeometry();