mirror of
https://code.videolan.org/videolan/vlc
synced 2024-09-28 23:09:59 +02:00
qt: add url context menu
This commit is contained in:
parent
6d486da387
commit
6fdc97a92b
@ -184,6 +184,7 @@ void MainUI::registerQMLTypes()
|
||||
qmlRegisterType<ArtistContextMenu>( "org.videolan.medialib", 0, 1, "ArtistContextMenu" );
|
||||
qmlRegisterType<GenreContextMenu>( "org.videolan.medialib", 0, 1, "GenreContextMenu" );
|
||||
qmlRegisterType<AlbumTrackContextMenu>( "org.videolan.medialib", 0, 1, "AlbumTrackContextMenu" );
|
||||
qmlRegisterType<URLContextMenu>( "org.videolan.medialib", 0, 1, "URLContextMenu" );
|
||||
qmlRegisterType<VideoContextMenu>( "org.videolan.medialib", 0, 1, "VideoContextMenu" );
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "medialibrary/mlartistmodel.hpp"
|
||||
#include "medialibrary/mlgenremodel.hpp"
|
||||
#include "medialibrary/mlalbumtrackmodel.hpp"
|
||||
#include "medialibrary/mlurlmodel.hpp"
|
||||
#include "network/networkmediamodel.hpp"
|
||||
#include "playlist/playlist_controller.hpp"
|
||||
#include "playlist/playlist_model.hpp"
|
||||
@ -158,6 +159,16 @@ void AlbumTrackContextMenu::popup(const QModelIndexList &selected, QPoint pos, Q
|
||||
BaseMedialibMenu::popup(m_model, MLAlbumTrackModel::TRACK_ID, selected, pos, options);
|
||||
}
|
||||
|
||||
URLContextMenu::URLContextMenu(QObject* parent)
|
||||
: BaseMedialibMenu(parent)
|
||||
{}
|
||||
|
||||
void URLContextMenu::popup(const QModelIndexList &selected, QPoint pos, QVariantMap options)
|
||||
{
|
||||
BaseMedialibMenu::popup(m_model, MLUrlModel::URL_ID, selected, pos, options);
|
||||
}
|
||||
|
||||
|
||||
VideoContextMenu::VideoContextMenu(QObject* parent)
|
||||
: QObject(parent)
|
||||
{}
|
||||
|
@ -30,6 +30,7 @@ class MLAlbumModel;
|
||||
class MLGenreModel;
|
||||
class MLArtistModel;
|
||||
class MLAlbumTrackModel;
|
||||
class MLUrlModel;
|
||||
class MLVideoModel;
|
||||
class NetworkMediaModel;
|
||||
class QmlMainContext;
|
||||
@ -126,6 +127,14 @@ public slots:
|
||||
void popup(const QModelIndexList& selected, QPoint pos, QVariantMap options = {});
|
||||
};
|
||||
|
||||
class URLContextMenu : public BaseMedialibMenu {
|
||||
Q_OBJECT
|
||||
SIMPLE_MENU_PROPERTY(MLUrlModel*, model, nullptr)
|
||||
public:
|
||||
URLContextMenu(QObject* parent = nullptr);
|
||||
public slots:
|
||||
void popup(const QModelIndexList& selected, QPoint pos, QVariantMap options = {});
|
||||
};
|
||||
|
||||
class VideoContextMenu : public QObject {
|
||||
Q_OBJECT
|
||||
|
Loading…
Reference in New Issue
Block a user