コード例 #1
0
LayoutConfigAction::LayoutConfigAction( QWidget * parent )
    : KAction( parent )
{
    KIcon actionIcon( "configure" );    //TEMPORARY ICON
    setIcon( actionIcon );
    m_layoutMenu = new KMenu( parent );
    setMenu( m_layoutMenu );
    setText( i18n( "Playlist layouts" ) );
    m_configAction = new KAction( m_layoutMenu );
    
    m_layoutMenu->addAction( m_configAction );
    m_layoutMenu->addSeparator();
    m_layoutActions = new QActionGroup( m_layoutMenu );
    m_layoutActions->setExclusive( true );

    QStringList layoutsList( LayoutManager::instance()->layouts() );
    foreach( QString iterator, layoutsList )
    {
        m_layoutActions->addAction( iterator )->setCheckable( true );
    }
コード例 #2
0
LayoutConfigAction::LayoutConfigAction( QWidget * parent )
    : KAction( parent )
    , m_layoutDialog( 0 )
{
    KIcon actionIcon( QPixmap( KStandardDirs::locate( "data", "amarok/images/playlist-layouts-22.png") ) );    //TEMPORARY ICON
    setIcon( actionIcon );
    m_layoutMenu = new KMenu( parent );
    setMenu( m_layoutMenu );
    setText( i18n( "Playlist Layouts" ) );
    m_configAction = new KAction( m_layoutMenu );
    
    m_layoutMenu->addAction( m_configAction );
    m_layoutMenu->addSeparator();
    m_layoutActions = new QActionGroup( m_layoutMenu );
    m_layoutActions->setExclusive( true );

    QStringList layoutsList( LayoutManager::instance()->layouts() );
    foreach( const QString &iterator, layoutsList )
    {
        m_layoutActions->addAction( iterator )->setCheckable( true );
    }