parent
126ed1a551
commit
32ed8ebba4
@ -56,6 +56,8 @@ FileView::FileView(QWidget* parent)
|
|||||||
connect(ui_->up, SIGNAL(clicked()), SLOT(FileUp()));
|
connect(ui_->up, SIGNAL(clicked()), SLOT(FileUp()));
|
||||||
connect(ui_->path, SIGNAL(textChanged(QString)),
|
connect(ui_->path, SIGNAL(textChanged(QString)),
|
||||||
SLOT(ChangeFilePath(QString)));
|
SLOT(ChangeFilePath(QString)));
|
||||||
|
connect(ui_->list, SIGNAL(Back()), undo_stack_, SLOT(undo()));
|
||||||
|
connect(ui_->list, SIGNAL(Forward()), undo_stack_, SLOT(redo()));
|
||||||
|
|
||||||
connect(undo_stack_, SIGNAL(canUndoChanged(bool)), ui_->back,
|
connect(undo_stack_, SIGNAL(canUndoChanged(bool)), ui_->back,
|
||||||
SLOT(setEnabled(bool)));
|
SLOT(setEnabled(bool)));
|
||||||
|
@ -132,17 +132,29 @@ void FileViewList::DeleteSlot() { emit Delete(FilenamesFromSelection()); }
|
|||||||
void FileViewList::EditTagsSlot() { emit EditTags(UrlListFromSelection()); }
|
void FileViewList::EditTagsSlot() { emit EditTags(UrlListFromSelection()); }
|
||||||
|
|
||||||
void FileViewList::mousePressEvent(QMouseEvent* e) {
|
void FileViewList::mousePressEvent(QMouseEvent* e) {
|
||||||
QListView::mousePressEvent(e);
|
switch (e->button()) {
|
||||||
|
case Qt::XButton1:
|
||||||
|
emit Back();
|
||||||
|
break;
|
||||||
|
case Qt::XButton2:
|
||||||
|
emit Forward();
|
||||||
|
break;
|
||||||
|
// enqueue to playlist with middleClick
|
||||||
|
case Qt::MidButton: {
|
||||||
|
QListView::mousePressEvent(e);
|
||||||
|
|
||||||
// enqueue to playlist with middleClick
|
// we need to update the menu selection
|
||||||
if (e->button() == Qt::MidButton) {
|
menu_selection_ = selectionModel()->selection();
|
||||||
// we need to update the menu selection
|
|
||||||
menu_selection_ = selectionModel()->selection();
|
|
||||||
|
|
||||||
MimeData* data = new MimeData;
|
MimeData* data = new MimeData;
|
||||||
data->setUrls(UrlListFromSelection());
|
data->setUrls(UrlListFromSelection());
|
||||||
data->enqueue_now_ = true;
|
data->enqueue_now_ = true;
|
||||||
emit AddToPlaylist(data);
|
emit AddToPlaylist(data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
QListView::mousePressEvent(e);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +38,8 @@ signals:
|
|||||||
void CopyToDevice(const QList<QUrl>& urls);
|
void CopyToDevice(const QList<QUrl>& urls);
|
||||||
void Delete(const QStringList& filenames);
|
void Delete(const QStringList& filenames);
|
||||||
void EditTags(const QList<QUrl>& urls);
|
void EditTags(const QList<QUrl>& urls);
|
||||||
|
void Back();
|
||||||
|
void Forward();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void contextMenuEvent(QContextMenuEvent* e);
|
void contextMenuEvent(QContextMenuEvent* e);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user