mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-06 07:19:51 +01:00
Make the rating widget work
This commit is contained in:
parent
31005e5943
commit
c2bd0bbb05
@ -106,6 +106,8 @@ EditTagDialog::EditTagDialog(QWidget* parent)
|
||||
SLOT(SelectionChanged()));
|
||||
connect(ui_->button_box, SIGNAL(clicked(QAbstractButton*)),
|
||||
SLOT(ButtonClicked(QAbstractButton*)));
|
||||
connect(ui_->rating, SIGNAL(RatingChanged(float)),
|
||||
SLOT(SongRated(float)));
|
||||
|
||||
// Set up the album cover menu
|
||||
cover_menu_ = new QMenu(this);
|
||||
@ -612,3 +614,15 @@ void EditTagDialog::showEvent(QShowEvent* e) {
|
||||
|
||||
QDialog::showEvent(e);
|
||||
}
|
||||
|
||||
void EditTagDialog::SongRated(float rating) {
|
||||
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
|
||||
if (sel.isEmpty())
|
||||
return;
|
||||
Song& song = data_[sel.first().row()].original_;
|
||||
if (!song.is_valid() || song.id() == -1)
|
||||
return;
|
||||
|
||||
song.set_rating(rating);
|
||||
backend_->UpdateSongRatingAsync(song.id(), rating);
|
||||
}
|
||||
|
@ -68,6 +68,7 @@ private slots:
|
||||
void FieldValueEdited();
|
||||
void ResetField();
|
||||
void ButtonClicked(QAbstractButton* button);
|
||||
void SongRated(float rating);
|
||||
|
||||
void ArtLoaded(quint64 id, const QImage& image);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user