File indexing completed on 2024-05-19 04:49:50

0001 /****************************************************************************************
0002  * Copyright (c) 2009 Nikolaj Hald Nielsen <nhn@kde.org>                                *
0003  * Copyright (c) 2009 Téo Mrnjavac <teo@kde.org>                                        *
0004  * Copyright (c) 2010 Oleksandr Khayrullin <saniokh@gmail.com>                          *
0005  *                                                                                      *
0006  * This program is free software; you can redistribute it and/or modify it under        *
0007  * the terms of the GNU General Public License as published by the Free Software        *
0008  * Foundation; either version 2 of the License, or (at your option) any later           *
0009  * version.                                                                             *
0010  *                                                                                      *
0011  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0012  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0013  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0014  *                                                                                      *
0015  * You should have received a copy of the GNU General Public License along with         *
0016  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0017  ****************************************************************************************/
0018 
0019 #include "PlaylistLayoutEditDialog.h"
0020 
0021 #include "core/support/Debug.h"
0022 
0023 #include "playlist/layouts/LayoutManager.h"
0024 #include "playlist/PlaylistDefines.h"
0025 
0026 #include <KMessageBox>
0027 
0028 #include <QInputDialog>
0029 #include <QLineEdit>
0030 
0031 Playlist::PlaylistLayoutEditDialog::PlaylistLayoutEditDialog( QWidget *parent )
0032     : QDialog( parent )
0033 {
0034     setupUi( this );
0035 
0036     // -- add tokens to the token pool
0037     Column tokenValues[] = {
0038         Album,
0039         AlbumArtist,
0040         Artist,
0041         Bitrate,
0042         Bpm,
0043         Comment,
0044         Composer,
0045         Directory,
0046         DiscNumber,
0047         Divider,
0048         Filename,
0049         Filesize,
0050         Genre,
0051         GroupLength,
0052         GroupTracks,
0053         LastPlayed,
0054         Labels,
0055         Length,
0056         Moodbar,
0057         PlaceHolder,
0058         PlayCount,
0059         Rating,
0060         SampleRate,
0061         Score,
0062         Source,
0063         Title,
0064         TitleWithTrackNum,
0065         TrackNumber,
0066         Type,
0067         Year };
0068 
0069     for( uint i = 0; i < sizeof( tokenValues ) / sizeof( tokenValues[0] ); i++ )
0070         tokenPool->addToken( new Token( columnName( tokenValues[i] ),
0071                                         iconName( tokenValues[i] ),
0072                                         static_cast<qint64>(tokenValues[i]) ) );
0073 
0074     m_firstActiveLayout = LayoutManager::instance()->activeLayoutName();
0075 
0076     //add an editor to each tab
0077     for( int part = 0; part < PlaylistLayout::NumParts; part++ )
0078         m_partsEdit[part] = new Playlist::LayoutEditWidget( this );
0079     m_layoutsMap = new QMap<QString, PlaylistLayout>();
0080 
0081     elementTabs->addTab( m_partsEdit[PlaylistLayout::Head], i18n( "Head" ) );
0082     elementTabs->addTab( m_partsEdit[PlaylistLayout::StandardBody], i18n( "Body" ) );
0083     elementTabs->addTab( m_partsEdit[PlaylistLayout::VariousArtistsBody], i18n( "Body (Various artists)" ) );
0084     elementTabs->addTab( m_partsEdit[PlaylistLayout::Single], i18n( "Single" ) );
0085 
0086     QStringList layoutNames = LayoutManager::instance()->layouts();
0087     foreach( const QString &layoutName, layoutNames )
0088     {
0089         PlaylistLayout layout = LayoutManager::instance()->layout( layoutName );
0090         layout.setDirty( false );
0091         m_layoutsMap->insert( layoutName, layout );
0092     }
0093 
0094     layoutListWidget->addItems( layoutNames );
0095 
0096     layoutListWidget->setCurrentRow( LayoutManager::instance()->layouts().indexOf( LayoutManager::instance()->activeLayoutName() ) );
0097 
0098     setupGroupByCombo();
0099 
0100     if ( layoutListWidget->currentItem() )
0101         setLayout( layoutListWidget->currentItem()->text() );
0102 
0103     connect( previewButton, &QAbstractButton::clicked, this, &PlaylistLayoutEditDialog::preview );
0104     connect( layoutListWidget, &QListWidget::currentTextChanged, this, &PlaylistLayoutEditDialog::setLayout );
0105     connect( layoutListWidget, &QListWidget::currentRowChanged, this, &PlaylistLayoutEditDialog::toggleEditButtons );
0106     connect( layoutListWidget, &QListWidget::currentRowChanged, this, &PlaylistLayoutEditDialog::toggleUpDownButtons );
0107 
0108     connect( moveUpButton, &QAbstractButton::clicked, this, &PlaylistLayoutEditDialog::moveUp );
0109     connect( moveDownButton, &QAbstractButton::clicked, this, &PlaylistLayoutEditDialog::moveDown );
0110 
0111     buttonBox->button(QDialogButtonBox::Apply)->setIcon( QIcon::fromTheme( QStringLiteral("dialog-ok-apply") ) );
0112     buttonBox->button(QDialogButtonBox::Ok)->setIcon( QIcon::fromTheme( QStringLiteral("dialog-ok") ) );
0113     buttonBox->button(QDialogButtonBox::Cancel)->setIcon( QIcon::fromTheme( QStringLiteral("dialog-cancel") ) );
0114     connect( buttonBox->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, this, &PlaylistLayoutEditDialog::apply );
0115 
0116     const QIcon newIcon = QIcon::fromTheme( QStringLiteral("document-new") );
0117     newLayoutButton->setIcon( newIcon );
0118     newLayoutButton->setToolTip( i18n( "New playlist layout" ) );
0119     connect( newLayoutButton, &QAbstractButton::clicked, this, &PlaylistLayoutEditDialog::newLayout );
0120 
0121     const QIcon copyIcon = QIcon::fromTheme( QStringLiteral("edit-copy") );
0122     copyLayoutButton->setIcon( copyIcon );
0123     copyLayoutButton->setToolTip( i18n( "Copy playlist layout" ) );
0124     connect( copyLayoutButton, &QAbstractButton::clicked, this, &PlaylistLayoutEditDialog::copyLayout );
0125 
0126     const QIcon deleteIcon = QIcon::fromTheme( QStringLiteral("edit-delete") );
0127     deleteLayoutButton->setIcon( deleteIcon );
0128     deleteLayoutButton->setToolTip( i18n( "Delete playlist layout" ) );
0129     connect( deleteLayoutButton, &QAbstractButton::clicked, this, &PlaylistLayoutEditDialog::deleteLayout );
0130 
0131     const QIcon renameIcon = QIcon::fromTheme( QStringLiteral("edit-rename") );
0132     renameLayoutButton->setIcon( renameIcon );
0133     renameLayoutButton->setToolTip( i18n( "Rename playlist layout" ) );
0134     connect( renameLayoutButton, &QAbstractButton::clicked, this, &PlaylistLayoutEditDialog::renameLayout );
0135 
0136     toggleEditButtons();
0137     toggleUpDownButtons();
0138 
0139     for( int part = 0; part < PlaylistLayout::NumParts; part++ )
0140         connect( m_partsEdit[part], &Playlist::LayoutEditWidget::changed, this, &PlaylistLayoutEditDialog::setLayoutChanged );
0141 
0142     connect( inlineControlsChekbox, &QCheckBox::stateChanged, this, &PlaylistLayoutEditDialog::setLayoutChanged );
0143     connect( tooltipsCheckbox, &QCheckBox::stateChanged, this, &PlaylistLayoutEditDialog::setLayoutChanged );
0144     connect( groupByComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
0145              this, &PlaylistLayoutEditDialog::setLayoutChanged );
0146 }
0147 
0148 
0149 Playlist::PlaylistLayoutEditDialog::~PlaylistLayoutEditDialog()
0150 {
0151 }
0152 
0153 void
0154 Playlist::PlaylistLayoutEditDialog::newLayout()      //SLOT
0155 {
0156     bool ok;
0157     QString layoutName = QInputDialog::getText( this, i18n( "Choose a name for the new playlist layout" ),
0158                                                 i18n( "Please enter a name for the playlist layout you are about to define:" ),
0159                                                 QLineEdit::Normal, QString(), &ok );
0160     if( !ok )
0161     return;
0162     if( layoutName.isEmpty() )
0163     {
0164         KMessageBox::error( this, i18n( "Cannot create a layout with no name." ), i18n( "Layout name error" ) );
0165         return;
0166     }
0167     if( m_layoutsMap->keys().contains( layoutName ) )
0168     {
0169         KMessageBox::error( this, i18n( "Cannot create a layout with the same name as an existing layout." ), i18n( "Layout name error" ) );
0170         return;
0171     }
0172     if( layoutName.contains( QLatin1Char('/') ) )
0173     {
0174         KMessageBox::error( this, i18n( "Cannot create a layout containing '/'." ), i18n( "Layout name error" ) );
0175         return;
0176     }
0177 
0178     PlaylistLayout layout;
0179     layout.setEditable( true );      //Should I use true, TRUE or 1?
0180     layout.setDirty( true );
0181 
0182     layoutListWidget->addItem( layoutName );
0183     layoutListWidget->setCurrentItem( (layoutListWidget->findItems( layoutName, Qt::MatchExactly ) ).first() );
0184     for( int part = 0; part < PlaylistLayout::NumParts; part++ )
0185     {
0186         m_partsEdit[part]->clear();
0187         layout.setLayoutForPart( (PlaylistLayout::Part)part, m_partsEdit[part]->config() );
0188     }
0189     m_layoutsMap->insert( layoutName, layout );
0190 
0191     LayoutManager::instance()->addUserLayout( layoutName, layout );
0192 
0193     setLayout( layoutName );
0194 }
0195 
0196 void
0197 Playlist::PlaylistLayoutEditDialog::copyLayout()
0198 {
0199     LayoutItemConfig configs[PlaylistLayout::NumParts];
0200     for( int part = 0; part < PlaylistLayout::NumParts; part++ )
0201         configs[part] = m_partsEdit[part]->config();
0202 
0203     QString layoutName = layoutListWidget->currentItem()->text();
0204 
0205     bool ok;
0206     layoutName = QInputDialog::getText( this,
0207                                         i18n( "Choose a name for the new playlist layout" ),
0208                                         i18n( "Please enter a name for the playlist layout you are about to define as copy of the layout '%1':", layoutName ),
0209                                         QLineEdit::Normal, layoutName, &ok );
0210 
0211     if( !ok)
0212         return;
0213     if( layoutName.isEmpty() )
0214     {
0215         KMessageBox::error( this, i18n( "Cannot create a layout with no name." ), i18n( "Layout name error" ) );
0216         return;
0217     }
0218     if( m_layoutsMap->keys().contains( layoutName ) )
0219     {
0220         KMessageBox::error( this, i18n( "Cannot create a layout with the same name as an existing layout." ), i18n( "Layout name error" ) );
0221         return;
0222     }
0223     //layoutListWidget->addItem( layoutName );
0224     PlaylistLayout layout;
0225     layout.setEditable( true );      //Should I use true, TRUE or 1?
0226     layout.setDirty( true );
0227 
0228     configs[PlaylistLayout::Head].setActiveIndicatorRow( -1 );
0229     for( int part = 0; part < PlaylistLayout::NumParts; part++ )
0230         layout.setLayoutForPart( (PlaylistLayout::Part)part, configs[part] );
0231 
0232     layout.setInlineControls( inlineControlsChekbox->isChecked() );
0233     layout.setTooltips( tooltipsCheckbox->isChecked() );
0234     layout.setGroupBy( groupByComboBox->itemData( groupByComboBox->currentIndex() ).toString() );
0235 
0236     LayoutManager::instance()->addUserLayout( layoutName, layout );
0237 
0238     //reload from manager:
0239     layoutListWidget->clear();
0240     layoutListWidget->addItems( LayoutManager::instance()->layouts() );
0241 
0242     m_layoutsMap->insert( layoutName, layout );
0243     layoutListWidget->setCurrentItem( ( layoutListWidget->findItems( layoutName, Qt::MatchExactly ) ).first() );
0244     setLayout( layoutName );
0245 }
0246 
0247 void
0248 Playlist::PlaylistLayoutEditDialog::deleteLayout()   //SLOT
0249 {
0250     m_layoutsMap->remove( layoutListWidget->currentItem()->text() );
0251     if( LayoutManager::instance()->layouts().contains( layoutListWidget->currentItem()->text() ) )  //if the layout is already saved in the LayoutManager
0252         LayoutManager::instance()->deleteLayout( layoutListWidget->currentItem()->text() );         //delete it
0253     delete layoutListWidget->currentItem();
0254 }
0255 
0256 void
0257 Playlist::PlaylistLayoutEditDialog::renameLayout()
0258 {
0259     PlaylistLayout layout = m_layoutsMap->value( layoutListWidget->currentItem()->text() );
0260 
0261     QString layoutName;
0262     while( layoutName.isEmpty() || m_layoutsMap->keys().contains( layoutName ) )
0263     {
0264         bool ok;
0265         layoutName = QInputDialog::getText( this,
0266                                             i18n( "Choose a new name for the playlist layout" ),
0267                                             i18n( "Please enter a new name for the playlist layout you are about to rename:" ),
0268                                             QLineEdit::Normal, layoutListWidget->currentItem()->text(), &ok );
0269         if ( !ok )
0270         {
0271             //Cancelled so just return
0272             return;
0273         }
0274         if( layoutName.isEmpty() )
0275             KMessageBox::error( this, i18n( "Cannot rename a layout to have no name." ), i18n( "Layout name error" ) );
0276         if( m_layoutsMap->keys().contains( layoutName ) )
0277             KMessageBox::error( this, i18n( "Cannot rename a layout to have the same name as an existing layout." ), i18n( "Layout name error" ) );
0278     }
0279     m_layoutsMap->remove( layoutListWidget->currentItem()->text() );
0280     if( LayoutManager::instance()->layouts().contains( layoutListWidget->currentItem()->text() ) )  //if the layout is already saved in the LayoutManager
0281         LayoutManager::instance()->deleteLayout( layoutListWidget->currentItem()->text() );         //delete it
0282     LayoutManager::instance()->addUserLayout( layoutName, layout );
0283     m_layoutsMap->insert( layoutName, layout );
0284     layoutListWidget->currentItem()->setText( layoutName );
0285 
0286     setLayout( layoutName );
0287 }
0288 
0289 void
0290 Playlist::PlaylistLayoutEditDialog::setLayout( const QString &layoutName )   //SLOT
0291 {
0292     DEBUG_BLOCK
0293     m_layoutName = layoutName;
0294 
0295     if( m_layoutsMap->keys().contains( layoutName ) )   //is the layout exists in the list of loaded layouts
0296     {
0297         debug() << "loaded layout";
0298         PlaylistLayout layout = m_layoutsMap->value( layoutName );
0299         for( int part = 0; part < PlaylistLayout::NumParts; part++ )
0300             m_partsEdit[part]->readLayout( layout.layoutForPart( (PlaylistLayout::Part)part ) );
0301         inlineControlsChekbox->setChecked( layout.inlineControls() );
0302         tooltipsCheckbox->setChecked( layout.tooltips() );
0303         groupByComboBox->setCurrentIndex( groupByComboBox->findData( layout.groupBy() ) );
0304 
0305         setEnabledTabs();
0306         //make sure that it is not marked dirty (it will be because of the changed signal triggering when loading it)
0307         //unless it is actually changed
0308         debug() << "not dirty anyway!!";
0309         (*m_layoutsMap)[m_layoutName].setDirty( false );
0310     }
0311     else
0312     {
0313         for( int part = 0; part < PlaylistLayout::NumParts; part++ )
0314             m_partsEdit[part]->clear();
0315     }
0316 }
0317 
0318 void
0319 Playlist::PlaylistLayoutEditDialog::preview()
0320 {
0321     PlaylistLayout layout;
0322 
0323     for( int part = 0; part < PlaylistLayout::NumParts; part++ )
0324     {
0325         LayoutItemConfig config = m_partsEdit[part]->config();
0326         if( part == PlaylistLayout::Head )
0327             config.setActiveIndicatorRow( -1 );
0328         layout.setLayoutForPart( (PlaylistLayout::Part)part, config );
0329     }
0330 
0331     layout.setInlineControls( inlineControlsChekbox->isChecked() );
0332     layout.setTooltips( tooltipsCheckbox->isChecked() );
0333     layout.setGroupBy( groupByComboBox->itemData( groupByComboBox->currentIndex() ).toString() );
0334 
0335     LayoutManager::instance()->setPreviewLayout( layout );
0336 }
0337 
0338 void
0339 Playlist::PlaylistLayoutEditDialog::toggleEditButtons() //SLOT
0340 {
0341     if ( !layoutListWidget->currentItem() ) {
0342         deleteLayoutButton->setEnabled( 0 );
0343         renameLayoutButton->setEnabled( 0 );
0344     } else if( LayoutManager::instance()->isDefaultLayout( layoutListWidget->currentItem()->text() ) ) {
0345         deleteLayoutButton->setEnabled( 0 );
0346         renameLayoutButton->setEnabled( 0 );
0347     } else {
0348         deleteLayoutButton->setEnabled( 1 );
0349         renameLayoutButton->setEnabled( 1 );
0350     }
0351 }
0352 
0353 void
0354 Playlist::PlaylistLayoutEditDialog::toggleUpDownButtons()
0355 {
0356     if ( !layoutListWidget->currentItem() )
0357     {
0358         moveUpButton->setEnabled( 0 );
0359         moveDownButton->setEnabled( 0 );
0360     }
0361     else if ( layoutListWidget->currentRow() == 0 )
0362     {
0363         moveUpButton->setEnabled( 0 );
0364         if ( layoutListWidget->currentRow() >= m_layoutsMap->size() -1 )
0365             moveDownButton->setEnabled( 0 );
0366         else
0367             moveDownButton->setEnabled( 1 );
0368     }
0369     else if ( layoutListWidget->currentRow() >= m_layoutsMap->size() -1 )
0370     {
0371         moveDownButton->setEnabled( 0 );
0372         moveUpButton->setEnabled( 1 ); //we already checked that this is not row 0
0373     }
0374     else
0375     {
0376         moveDownButton->setEnabled( 1 );
0377         moveUpButton->setEnabled( 1 );
0378     }
0379 
0380 
0381 }
0382 
0383 void
0384 Playlist::PlaylistLayoutEditDialog::apply()  //SLOT
0385 {
0386     foreach( const QString &layoutName, m_layoutsMap->keys() )
0387     {
0388         PlaylistLayout layout = m_layoutsMap->value( layoutName );
0389 
0390         if( layout.isDirty() )
0391         {
0392             // search a new name for changed default layouts
0393             if( LayoutManager::instance()->isDefaultLayout( layoutName ) )
0394             {
0395                 QString newLayoutName = i18n( "copy of %1", layoutName );
0396                 QString orgCopyName = newLayoutName;
0397 
0398                 int copyNumber = 1;
0399                 QStringList existingLayouts = LayoutManager::instance()->layouts();
0400                 while( existingLayouts.contains( newLayoutName ) )
0401                 {
0402                     copyNumber++;
0403                     newLayoutName = i18nc( "adds a copy number to a generated name if the name already exists, for instance 'copy of Foo 2' if 'copy of Foo' is taken", "%1 %2", orgCopyName, copyNumber );
0404                 }
0405 
0406                 const QString msg = i18n( "The layout '%1' you modified is one of the default layouts and cannot be overwritten. "
0407                                           "Saved as new layout '%2'", layoutName, newLayoutName );
0408                 KMessageBox::error( this, msg, i18n( "Default Layout" ) );
0409 
0410 
0411                 layout.setDirty( false );
0412                 m_layoutsMap->insert( newLayoutName, layout );
0413                 LayoutManager::instance()->addUserLayout( newLayoutName, layout );
0414                 layoutListWidget->addItem( newLayoutName );
0415 
0416                 if( layoutName == m_layoutName )
0417                     layoutListWidget->setCurrentItem( ( layoutListWidget->findItems( newLayoutName, Qt::MatchExactly ) ).first() );
0418 
0419                 // restore the default layout
0420                 m_layoutsMap->insert( layoutName, LayoutManager::instance()->layout( layoutName ) );
0421             }
0422             else
0423             {
0424                 layout.setDirty( false );
0425 
0426                 m_layoutsMap->insert( layoutName, layout );
0427                 LayoutManager::instance()->addUserLayout( layoutName, layout );
0428             }
0429         }
0430     }
0431     LayoutManager::instance()->setActiveLayout( layoutListWidget->currentItem()->text() );  //important to override the previewed layout if preview is used
0432 }
0433 
0434 void
0435 Playlist::PlaylistLayoutEditDialog::accept()     //SLOT
0436 {
0437     apply();
0438     QDialog::accept();
0439 }
0440 
0441 void
0442 Playlist::PlaylistLayoutEditDialog::reject()     //SLOT
0443 {
0444     DEBUG_BLOCK
0445 
0446     debug() << "Applying initial layout: " << m_firstActiveLayout;
0447     if( layoutListWidget->findItems( m_firstActiveLayout, Qt::MatchExactly ).isEmpty() )
0448         LayoutManager::instance()->setActiveLayout( QStringLiteral("Default") );
0449     else
0450         LayoutManager::instance()->setActiveLayout( m_firstActiveLayout );
0451 
0452     QDialog::reject();
0453 }
0454 
0455 void
0456 Playlist::PlaylistLayoutEditDialog::moveUp()
0457 {
0458     int newRow = LayoutManager::instance()->moveUp( m_layoutName );
0459 
0460     layoutListWidget->clear();
0461     layoutListWidget->addItems( LayoutManager::instance()->layouts() );
0462 
0463     layoutListWidget->setCurrentRow( newRow );
0464 }
0465 
0466 void
0467 Playlist::PlaylistLayoutEditDialog::moveDown()
0468 {
0469     int newRow = LayoutManager::instance()->moveDown( m_layoutName );
0470 
0471     layoutListWidget->clear();
0472     layoutListWidget->addItems( LayoutManager::instance()->layouts() );
0473 
0474     layoutListWidget->setCurrentRow( newRow );
0475 }
0476 
0477 void
0478 Playlist::PlaylistLayoutEditDialog::setEnabledTabs()
0479 {
0480     DEBUG_BLOCK
0481 
0482     //Enable or disable tabs depending on whether grouping is allowed.
0483     QString grouping = groupByComboBox->itemData( groupByComboBox->currentIndex() ).toString();
0484     bool groupingEnabled = ( !grouping.isEmpty() && grouping != QLatin1String("None") );
0485 
0486     if ( !groupingEnabled )
0487         elementTabs->setCurrentWidget( m_partsEdit[PlaylistLayout::Single] );
0488 
0489     debug() << groupByComboBox->itemData( groupByComboBox->currentIndex() ).toString();
0490     debug() << groupingEnabled;
0491 
0492     elementTabs->setTabEnabled( elementTabs->indexOf( m_partsEdit[PlaylistLayout::Head] ), groupingEnabled );
0493     elementTabs->setTabEnabled( elementTabs->indexOf( m_partsEdit[PlaylistLayout::StandardBody] ), groupingEnabled );
0494     elementTabs->setTabEnabled( elementTabs->indexOf( m_partsEdit[PlaylistLayout::VariousArtistsBody] ), groupingEnabled );
0495 }
0496 
0497 //Sets up a combo box that presents the possible grouping categories, as well as the option
0498 //to perform no grouping.
0499 //We'll use the "user data" to store the un-i18n-ized category name for internal use.
0500 void
0501 Playlist::PlaylistLayoutEditDialog::setupGroupByCombo()
0502 {
0503     foreach( const Playlist::Column &col, Playlist::groupableCategories() )
0504     {
0505         groupByComboBox->addItem( QIcon::fromTheme( iconName( col ) ),
0506                                   columnName( col ),
0507                                   QVariant( internalColumnName( col ) ) );
0508     }
0509 
0510     //Add the option to not perform grouping
0511     //Use a null string to specify "no grouping"
0512     groupByComboBox->addItem( i18n( "No Grouping" ), QVariant( QStringLiteral("None") ) );
0513 }
0514 
0515 void
0516 Playlist::PlaylistLayoutEditDialog::setLayoutChanged()
0517 {
0518     DEBUG_BLOCK
0519 
0520     setEnabledTabs();
0521 
0522     for( int part = 0; part < PlaylistLayout::NumParts; part++ )
0523         (*m_layoutsMap)[m_layoutName].setLayoutForPart( (PlaylistLayout::Part)part, m_partsEdit[part]->config() );
0524 
0525     (*m_layoutsMap)[m_layoutName].setInlineControls( inlineControlsChekbox->isChecked() );
0526     (*m_layoutsMap)[m_layoutName].setTooltips( tooltipsCheckbox->isChecked() );
0527     (*m_layoutsMap)[m_layoutName].setGroupBy( groupByComboBox->itemData( groupByComboBox->currentIndex() ).toString() );
0528     (*m_layoutsMap)[m_layoutName].setDirty( true );
0529 }
0530 
0531