QWidget* Dynamic::QuizPlayBias::widget( QWidget* parent ) { QWidget *widget = new QWidget( parent ); QVBoxLayout *layout = new QVBoxLayout( widget ); QLabel *label = new QLabel( i18n( "Last character of the previous song is\n" "the first character of the next song" ) ); layout->addWidget( label ); QComboBox *combo = new QComboBox(); combo->addItem( i18n( "of the track title (Title quiz)" ), nameForFollow( TitleToTitle ) ); combo->addItem( i18n( "of the artist (Artist quiz)" ), nameForFollow( ArtistToArtist ) ); combo->addItem( i18n( "of the album name (Album quiz)" ), nameForFollow( AlbumToAlbum ) ); switch( m_follow ) { case TitleToTitle: combo->setCurrentIndex(0); break; case ArtistToArtist: combo->setCurrentIndex(1); break; case AlbumToAlbum: combo->setCurrentIndex(2); break; } connect( combo, SIGNAL( currentIndexChanged(int) ), this, SLOT( selectionChanged( int ) ) ); layout->addWidget( combo ); return widget; }
QWidget* Dynamic::AlbumPlayBias::widget( QWidget* parent ) { QComboBox *combo = new QComboBox( parent ); combo->addItem( i18n( "Track directly follows previous track in album" ), nameForFollow( DirectlyFollow ) ); combo->addItem( i18n( "Track comes after previous track in album" ), nameForFollow( Follow ) ); combo->addItem( i18n( "Track is in the same album as previous track" ), nameForFollow( DontCare ) ); switch( m_follow ) { case DirectlyFollow: combo->setCurrentIndex(0); break; case Follow: combo->setCurrentIndex(0); break; case DontCare: combo->setCurrentIndex(0); break; } connect( combo, SIGNAL( currentIndexChanged(int) ), this, SLOT( selectionChanged( int ) ) ); return combo; }
void Dynamic::AlbumPlayBias::toXml( QXmlStreamWriter *writer ) const { writer->writeTextElement( "follow", nameForFollow( m_follow ) ); }