+ getSettings()->beginWriteArray( "ToolbarProfiles" );
+ for( int i = 0; i < profileCombo->count(); i++ )
+ {
+ getSettings()->setArrayIndex(i);
+ getSettings()->setValue( "ProfileName", profileCombo->itemText( i ) );
+ getSettings()->setValue( "Value", profileCombo->itemData( i ) );
+ }
+ getSettings()->endArray();
+}
+
+void ToolbarEditDialog::newProfile()
+{
+ bool ok;
+ QString name = QInputDialog::getText( this, qtr( "Profile Name" ),
+ qtr( "Please enter the new profile name." ), QLineEdit::Normal, 0, &ok );
+ if( !ok ) return;
+
+ QString temp = QString::number( positionCombo->currentIndex() );
+ temp += "|" + controller1->getValue();
+ temp += "|" + controller2->getValue();
+ temp += "|" + controllerA->getValue();
+ temp += "|" + controller->getValue();
+ temp += "|" + controllerFSC->getValue();
+
+ profileCombo->addItem( name, temp );
+ profileCombo->setCurrentIndex( profileCombo->count() - 1 );
+}
+
+void ToolbarEditDialog::deleteProfile()
+{
+ profileCombo->removeItem( profileCombo->currentIndex() );
+}
+
+void ToolbarEditDialog::changeProfile( int i )
+{
+ QStringList qs_list = profileCombo->itemData( i ).toString().split( "|" );
+ if( qs_list.count() < 6 )
+ return;
+
+ positionCombo->setCurrentIndex( positionCombo->findData( qs_list[0].toInt() ) );
+ controller1->resetLine( qs_list[1] );
+ controller2->resetLine( qs_list[2] );
+ controllerA->resetLine( qs_list[3] );
+ controller->resetLine( qs_list[4] );
+ controllerFSC->resetLine( qs_list[5] );