mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
Populate private listening option in right-click on your source
This commit is contained in:
@@ -128,6 +128,7 @@ SourceTreeView::setupMenus()
|
|||||||
m_playlistMenu.clear();
|
m_playlistMenu.clear();
|
||||||
m_roPlaylistMenu.clear();
|
m_roPlaylistMenu.clear();
|
||||||
m_latchMenu.clear();
|
m_latchMenu.clear();
|
||||||
|
m_privacyMenu.clear();
|
||||||
|
|
||||||
bool readonly = true;
|
bool readonly = true;
|
||||||
SourcesModel::RowType type = ( SourcesModel::RowType )model()->data( m_contextMenuIndex, SourcesModel::SourceTreeItemTypeRole ).toInt();
|
SourcesModel::RowType type = ( SourcesModel::RowType )model()->data( m_contextMenuIndex, SourcesModel::SourceTreeItemTypeRole ).toInt();
|
||||||
@@ -145,6 +146,8 @@ SourceTreeView::setupMenus()
|
|||||||
QAction* latchOnAction = ActionCollection::instance()->getAction( "latchOn" );
|
QAction* latchOnAction = ActionCollection::instance()->getAction( "latchOn" );
|
||||||
m_latchMenu.addAction( latchOnAction );
|
m_latchMenu.addAction( latchOnAction );
|
||||||
|
|
||||||
|
m_privacyMenu.addAction( ActionCollection::instance()->getAction( "togglePrivacy" ) );
|
||||||
|
|
||||||
if ( type == SourcesModel::Collection )
|
if ( type == SourcesModel::Collection )
|
||||||
{
|
{
|
||||||
CollectionItem* item = itemFromIndex< CollectionItem >( m_contextMenuIndex );
|
CollectionItem* item = itemFromIndex< CollectionItem >( m_contextMenuIndex );
|
||||||
@@ -432,6 +435,8 @@ SourceTreeView::onCustomContextMenu( const QPoint& pos )
|
|||||||
CollectionItem* item = itemFromIndex< CollectionItem >( m_contextMenuIndex );
|
CollectionItem* item = itemFromIndex< CollectionItem >( m_contextMenuIndex );
|
||||||
if ( !item->source().isNull() && !item->source()->isLocal() )
|
if ( !item->source().isNull() && !item->source()->isLocal() )
|
||||||
m_latchMenu.exec( mapToGlobal( pos ) );
|
m_latchMenu.exec( mapToGlobal( pos ) );
|
||||||
|
else if ( !item->source().isNull() )
|
||||||
|
m_privacyMenu.exec( mapToGlobal( pos ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -103,6 +103,7 @@ private:
|
|||||||
QMenu m_playlistMenu;
|
QMenu m_playlistMenu;
|
||||||
QMenu m_roPlaylistMenu;
|
QMenu m_roPlaylistMenu;
|
||||||
QMenu m_latchMenu;
|
QMenu m_latchMenu;
|
||||||
|
QMenu m_privacyMenu;
|
||||||
QAction* m_loadPlaylistAction;
|
QAction* m_loadPlaylistAction;
|
||||||
QAction* m_renamePlaylistAction;
|
QAction* m_renamePlaylistAction;
|
||||||
QAction* m_deletePlaylistAction;
|
QAction* m_deletePlaylistAction;
|
||||||
|
Reference in New Issue
Block a user