- /* needed for popupAdd() */
- PLItem *root = model->getItem( QModelIndex() );
- currentRootId = root->id();
-
- locationBar->setIndex( QModelIndex() );
-
- /* enable/disable adding */
- if( currentRootId == THEPL->p_playing->i_id )
- {
- addButton->setEnabled( true );
- addButton->setToolTip( qtr(I_PL_ADDPL) );
- }
- else if( THEPL->p_media_library &&
- currentRootId == THEPL->p_media_library->i_id )
- {
- addButton->setEnabled( true );
- addButton->setToolTip( qtr(I_PL_ADDML) );
- }
- else
- addButton->setEnabled( false );
-}
-
-/* PopupAdd Menu for the Add Menu */
-void StandardPLPanel::popupAdd()
-{
- QMenu popup;
- if( currentRootId == THEPL->p_playing->i_id )
- {
- popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT( simplePLAppendDialog()) );
- popup.addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( PLAppendDir()) );
- popup.addAction( qtr(I_OP_ADVOP), THEDP, SLOT( PLAppendDialog()) );
- }
- else if( THEPL->p_media_library &&
- currentRootId == THEPL->p_media_library->i_id )
- {
- popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT( simpleMLAppendDialog()) );
- popup.addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( MLAppendDir() ) );
- popup.addAction( qtr(I_OP_ADVOP), THEDP, SLOT( MLAppendDialog() ) );
- }
-
- popup.exec( QCursor::pos() - addButton->mapFromGlobal( QCursor::pos() )
- + QPoint( 0, addButton->height() ) );