Esempio n. 1
0
void LibraryUI::setupActions()
{
    burn_act = new QAction( QIcon(":/library/pics/Image-Burner.png") , tr("Burn Image") , this );
    mount_act = new QAction( SMasterIcons::icon( QSize(48,48) , "emblem-mounted.png" ) , tr("Mount") , this );
    delete_act = new QAction( SMasterIcons::icon( QSize(48,48) , "edit-delete.png" ) , tr("Delete From Library") , this );
    edit_tags_act = new QAction( tr("Edit Tags") , this );
    rename_act = new QAction( SMasterIcons::icon( QSize(48,48) , "edit-rename.png" ) , tr("Rename") , this );

    add_to_library_action = new QAction( SMasterIcons::icon( QSize(48,48) , "list-add.png" ) , tr("Add to Library") , this );
    reload_action = new QAction( SMasterIcons::icon( QSize(48,48) , "view-refresh.png" ) , tr("Reload") , this );

    toolbar->addAction( add_to_library_action );
    toolbar->addAction( reload_action );

    this->menuPanel()->addAction( add_to_library_action );
    this->menuPanel()->addAction( reload_action );

    menu = new QMenu( this );
        menu->addAction( burn_act );
        menu->addAction( mount_act );
        menu->addSeparator();
        menu->addAction( delete_act );
        menu->addAction( edit_tags_act );
        menu->addAction( rename_act );


    QObject::connect( item_list , SIGNAL(customContextMenuRequested(QPoint)) , this , SLOT(showMenu(QPoint)) );
    QObject::connect( burn_act , SIGNAL(triggered()) , this , SLOT(burnCurrentItem()) );
    QObject::connect( mount_act , SIGNAL(triggered()) , this , SLOT(mountCurrentItem()) );
    QObject::connect( delete_act , SIGNAL(triggered()) , this , SLOT(deleteCurrentItem()) );
    QObject::connect( edit_tags_act , SIGNAL(triggered()) , this , SLOT(editCurrentItemTags()) );
    QObject::connect( rename_act , SIGNAL(triggered()) , this , SLOT(renameCurrentItem()) );
    QObject::connect( reload_action , SIGNAL(triggered()) , this , SLOT(reload()) );
    QObject::connect( add_to_library_action , SIGNAL(triggered()) , this , SLOT(addToLibrary()) );
}
Esempio n. 2
0
void Playlist::createMenus()
{
    m_localsMenu = new QMenu(tr("Add to list"));
    m_listMenu = new QMenu(m_listWidget);

    /* Popup Track actions */

    // Add to Queue
    QAction *toQueueA = new QAction(tr("Add to queue"), this);
    toQueueA->setShortcut(QKeySequence("Q"));
    m_listMenu->addAction(toQueueA);
    connect(toQueueA, SIGNAL(triggered()), this, SLOT(addToQueue()));


    // Add to library
    m_toLibraryA = new QAction(tr("Add to Library"), this);
    m_listMenu->addAction(m_toLibraryA);
    connect(m_toLibraryA, SIGNAL(triggered()), this, SLOT(addToLibrary()));

    // Download track
    QAction *downloadA = new QAction(tr("Download"), this);;
//    downloadA->setShortcut(QKeySequence("D"));
    m_listMenu->addAction(downloadA);
    connect(downloadA, SIGNAL(triggered()), this, SLOT(downloadTrack()));

    // Remove track
    QAction *removeA = new QAction(tr("Remove"), this);;
    removeA->setShortcut(QKeySequence::Delete);
    m_listMenu->addAction(removeA);
    connect(removeA, SIGNAL(triggered()), this, SLOT(removeTrack()));


    // Set 'add to local list' menu for all lists except local list
    if(m_listType != PlaylistWidget::LocalList)
        m_listMenu->addMenu(m_localsMenu);

    m_listWidget->setMenu(m_listMenu);
}
Esempio n. 3
0
void LibraryUI::addToLibrary()
{
    SDialogTools::getOpenFileNames( this , this , SLOT(addToLibrary(QStringList)) , tr("Select Files to add to Library") );
}