Middle click to append to playlist now works in the other views. Fixes issue #1546
This commit is contained in:
parent
a356c5c425
commit
f62f1a6df8
|
@ -497,14 +497,6 @@ void LibraryView::keyPressEvent(QKeyEvent* e) {
|
|||
QTreeView::keyPressEvent(e);
|
||||
}
|
||||
|
||||
void LibraryView::mousePressEvent(QMouseEvent* e) {
|
||||
QTreeView::mousePressEvent(e);
|
||||
|
||||
//enqueue to playlist with middleClick
|
||||
if (e->button() == Qt::MidButton)
|
||||
AddToPlaylistEnqueue();
|
||||
}
|
||||
|
||||
void LibraryView::DeleteFinished(const SongList& songs_with_errors) {
|
||||
if (songs_with_errors.isEmpty())
|
||||
return;
|
||||
|
|
|
@ -92,7 +92,6 @@ class LibraryView : public AutoExpandingTreeView {
|
|||
void mouseReleaseEvent(QMouseEvent* e);
|
||||
void contextMenuEvent(QContextMenuEvent* e);
|
||||
void keyPressEvent(QKeyEvent* e);
|
||||
void mousePressEvent(QMouseEvent* e);
|
||||
|
||||
private slots:
|
||||
void Load();
|
||||
|
|
|
@ -42,6 +42,7 @@ void SongLoaderInserter::Load(Playlist *destination,
|
|||
destination_ = destination;
|
||||
row_ = row;
|
||||
play_now_ = play_now;
|
||||
enqueue_ = enqueue;
|
||||
|
||||
connect(destination, SIGNAL(destroyed()), SLOT(DestinationDestroyed()));
|
||||
|
||||
|
|
|
@ -102,4 +102,13 @@ void AutoExpandingTreeView::mousePressEvent(QMouseEvent* event) {
|
|||
}
|
||||
|
||||
QTreeView::mousePressEvent(event);
|
||||
|
||||
//enqueue to playlist with middleClick
|
||||
if (event->button() == Qt::MidButton) {
|
||||
QMimeData* data = model()->mimeData(selectedIndexes());
|
||||
if (MimeData* mime_data = qobject_cast<MimeData*>(data)) {
|
||||
mime_data->enqueue_now_ = true;
|
||||
}
|
||||
emit AddToPlaylistSignal(data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,3 +119,18 @@ void FileViewList::CopyToDeviceSlot() {
|
|||
void FileViewList::DeleteSlot() {
|
||||
emit Delete(FilenamesFromSelection());
|
||||
}
|
||||
|
||||
void FileViewList::mousePressEvent(QMouseEvent* e) {
|
||||
QListView::mousePressEvent(e);
|
||||
|
||||
//enqueue to playlist with middleClick
|
||||
if (e->button() == Qt::MidButton) {
|
||||
//we need to update the menu selection
|
||||
menu_selection_ = selectionModel()->selection();
|
||||
|
||||
MimeData* data = new MimeData;
|
||||
data->setUrls(UrlListFromSelection());
|
||||
data->enqueue_now_ = true;
|
||||
emit AddToPlaylist(data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@ class FileViewList : public QListView {
|
|||
public:
|
||||
FileViewList(QWidget* parent = 0);
|
||||
|
||||
void mousePressEvent(QMouseEvent* e);
|
||||
|
||||
signals:
|
||||
void AddToPlaylist(QMimeData* data);
|
||||
void CopyToLibrary(const QList<QUrl>& urls);
|
||||
|
|
Loading…
Reference in New Issue