Fix the behaviour of selecting "edit tag ..." when multiple tracks are selected. Fixes issue #139
This commit is contained in:
parent
8027449b8e
commit
1293865fea
@ -195,6 +195,7 @@ MainWindow::MainWindow(QNetworkAccessManager* network, QWidget *parent)
|
||||
connect(playlist_, SIGNAL(CurrentSongChanged(Song)), osd_, SLOT(SongChanged(Song)));
|
||||
connect(playlist_, SIGNAL(CurrentSongChanged(Song)), player_, SLOT(CurrentMetadataChanged(Song)));
|
||||
connect(playlist_, SIGNAL(PlaylistChanged()), player_, SLOT(PlaylistChanged()));
|
||||
connect(playlist_, SIGNAL(EditingFinished(QModelIndex)), SLOT(PlaylistEditFinished(QModelIndex)));
|
||||
|
||||
connect(ui_.playlist, SIGNAL(doubleClicked(QModelIndex)), SLOT(PlayIndex(QModelIndex)));
|
||||
connect(ui_.playlist, SIGNAL(PlayPauseItem(QModelIndex)), SLOT(PlayIndex(QModelIndex)));
|
||||
@ -776,7 +777,6 @@ void MainWindow::SelectionSetValue() {
|
||||
|
||||
void MainWindow::EditValue() {
|
||||
ui_.playlist->edit(playlist_menu_index_);
|
||||
connect(playlist_, SIGNAL(dataChanged(QModelIndex, QModelIndex)), SLOT(SelectionSetValue()));
|
||||
}
|
||||
|
||||
void MainWindow::LibraryScanStarted() {
|
||||
@ -869,3 +869,8 @@ void MainWindow::LibraryGroupingChanged(const Library::Grouping& g) {
|
||||
}
|
||||
ui_.group_by_advanced->setChecked(true);
|
||||
}
|
||||
|
||||
void MainWindow::PlaylistEditFinished(const QModelIndex& index) {
|
||||
if (index == playlist_menu_index_)
|
||||
SelectionSetValue();
|
||||
}
|
||||
|
@ -83,6 +83,7 @@ class MainWindow : public QMainWindow {
|
||||
void PlaylistPlay();
|
||||
void PlaylistStopAfter();
|
||||
void PlaylistRemoveCurrent();
|
||||
void PlaylistEditFinished(const QModelIndex& index);
|
||||
void EditTracks();
|
||||
void RenumberTracks();
|
||||
void SelectionSetValue();
|
||||
|
@ -171,7 +171,7 @@ QVariant Playlist::data(const QModelIndex& index, int role) const {
|
||||
}
|
||||
}
|
||||
|
||||
bool Playlist::setData(const QModelIndex &index, const QVariant &value, int role) {
|
||||
bool Playlist::setData(const QModelIndex &index, const QVariant &value, int) {
|
||||
int row = index.row();
|
||||
Song song = item_at(row)->Metadata();
|
||||
|
||||
@ -181,6 +181,7 @@ bool Playlist::setData(const QModelIndex &index, const QVariant &value, int role
|
||||
song.Save();
|
||||
item_at(row)->Reload();
|
||||
emit dataChanged(index, index);
|
||||
emit EditingFinished(index);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -140,6 +140,7 @@ class Playlist : public QAbstractListModel {
|
||||
|
||||
signals:
|
||||
void CurrentSongChanged(const Song& metadata);
|
||||
void EditingFinished(const QModelIndex& index);
|
||||
|
||||
void PlaylistChanged();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user