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