+ mainLayout->addWidget( FSCToolbarBox, 2, 1, 1, -1 );
+
+ /* Profile */
+ QGroupBox *profileBox = new QGroupBox( qtr( "Profile" ), this );
+ QGridLayout *profileBoxLayout = new QGridLayout( profileBox );
+
+ profileCombo = new QComboBox;
+ QLabel *profileLabel = new QLabel( qtr( "Select profile:" ), this );
+
+ QToolButton *newButton = new QToolButton;
+ newButton->setIcon( QIcon( ":/new" ) );
+ QToolButton *deleteButton = new QToolButton;
+ deleteButton->setIcon( QIcon( ":/toolbar/clear" ) );
+ deleteButton->setToolTip( qtr( "Delete the current profile" ) );
+
+ profileBoxLayout->addWidget( profileLabel, 0, 0 );
+ profileBoxLayout->addWidget( profileCombo, 0, 1 );
+ profileBoxLayout->addWidget( newButton, 0, 2 );
+ profileBoxLayout->addWidget( deleteButton, 0, 3 );
+
+ mainLayout->addWidget( profileBox, 3, 1, 1, -1 );
+
+ /* Fill combos */
+ int i_size = getSettings()->beginReadArray( "ToolbarProfiles" );
+ for( int i = 0; i < i_size; i++ )
+ {
+ getSettings()->setArrayIndex(i);
+ profileCombo->addItem( getSettings()->value( "ProfileName" ).toString(),
+ getSettings()->value( "Value" ).toString() );
+ }
+ getSettings()->endArray();
+
+ /* Load defaults ones if we have no combos */
+ /* We could decide that we load defaults on first launch of the dialog
+ or when the combo is back to 0. I choose the second solution, because some clueless
+ user might hit on delete a bit too much, but discussion is opened. -- jb */
+ if( i_size == 0 )
+ {
+ profileCombo->addItem( PROFILE_NAME_1, QString( VALUE_1 ) );
+ profileCombo->addItem( PROFILE_NAME_2, QString( VALUE_2 ) );
+ profileCombo->addItem( PROFILE_NAME_3, QString( VALUE_3 ) );
+ profileCombo->addItem( PROFILE_NAME_4, QString( VALUE_4 ) );
+ profileCombo->addItem( PROFILE_NAME_5, QString( VALUE_5 ) );
+ }
+ profileCombo->setCurrentIndex( -1 );