mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 06:36:55 +02:00
Add Menu Entry to start playlist sync
This commit is contained in:
@@ -243,14 +243,24 @@ SourceTreeView::setupMenus()
|
|||||||
QAction* exportPlaylist = m_playlistMenu.addAction( tr( "&Export Playlist") );
|
QAction* exportPlaylist = m_playlistMenu.addAction( tr( "&Export Playlist") );
|
||||||
connect( exportPlaylist, SIGNAL( triggered() ), this, SLOT( exportPlaylist() ) );
|
connect( exportPlaylist, SIGNAL( triggered() ), this, SLOT( exportPlaylist() ) );
|
||||||
|
|
||||||
|
const PlaylistItem* item = itemFromIndex< PlaylistItem >( m_contextMenuIndex );
|
||||||
|
const playlist_ptr playlist = item->playlist();
|
||||||
|
if ( playlist )
|
||||||
|
{
|
||||||
QMenu* playlistSyncMenu = m_playlistMenu.addMenu( tr( "Sync with .." ) );
|
QMenu* playlistSyncMenu = m_playlistMenu.addMenu( tr( "Sync with .." ) );
|
||||||
|
|
||||||
foreach ( const QPointer<ExternalResolver>& resolver, Tomahawk::Pipeline::instance()->scriptResolvers() )
|
foreach ( const QPointer<ExternalResolver>& resolver, Tomahawk::Pipeline::instance()->scriptResolvers() )
|
||||||
{
|
{
|
||||||
if ( resolver->capabilities().testFlag( ExternalResolver::PlaylistSync ) )
|
if ( resolver->capabilities().testFlag( ExternalResolver::PlaylistSync ) )
|
||||||
{
|
{
|
||||||
// TODO: Add a checkmark to the service that syncs this playlist
|
// TODO: Add a checkmark to the service that syncs this playlist
|
||||||
// TODO: Actually add an action to sync
|
// TODO: Actually add an action to sync
|
||||||
playlistSyncMenu->addAction( resolver->icon(), resolver->name() );
|
QAction* plSync = playlistSyncMenu->addAction( resolver->icon(), resolver->name() );
|
||||||
|
NewClosure( plSync, SIGNAL( triggered() ),
|
||||||
|
Pipeline::instance(),
|
||||||
|
SLOT( startPlaylistSync( ExternalResolver* , playlist_ptr ) ),
|
||||||
|
resolver, playlist );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user