mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-30 19:15:08 +01:00
parent
dd59aaada0
commit
7f2c17a0b7
@ -1049,6 +1049,16 @@ void Song::ToLastFM(lastfm::Track* track, bool prefer_album_artist) const {
|
||||
}
|
||||
#endif // HAVE_LIBLASTFM
|
||||
|
||||
QString Song::PrettyRating() const {
|
||||
float rating = d->rating_;
|
||||
|
||||
if (rating == -1.0f)
|
||||
return "0";
|
||||
|
||||
return QString::number(static_cast<int>(rating * 100));
|
||||
}
|
||||
|
||||
|
||||
QString Song::PrettyTitle() const {
|
||||
QString title(d->title_);
|
||||
|
||||
|
@ -216,6 +216,7 @@ class Song {
|
||||
const QImage& image() const;
|
||||
|
||||
// Pretty accessors
|
||||
QString PrettyRating() const;
|
||||
QString PrettyTitle() const;
|
||||
QString PrettyTitleWithArtist() const;
|
||||
QString PrettyLength() const;
|
||||
|
@ -55,6 +55,8 @@ NotificationsSettingsPage::NotificationsSettingsPage(SettingsDialog* dialog)
|
||||
menu->addAction(ui_->action_playcount);
|
||||
menu->addAction(ui_->action_skipcount);
|
||||
menu->addAction(ui_->action_filename);
|
||||
menu->addAction(ui_->action_rating);
|
||||
menu->addAction(ui_->action_score);
|
||||
menu->addSeparator();
|
||||
menu->addAction(ui_->action_newline);
|
||||
ui_->notifications_exp_chooser1->setMenu(menu);
|
||||
|
@ -426,6 +426,22 @@
|
||||
<string>Add song skip count</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_rating">
|
||||
<property name="text">
|
||||
<string notr="true">%rating%</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Add song rating</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_score">
|
||||
<property name="text">
|
||||
<string notr="true">%score%</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Add song auto score</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_newline">
|
||||
<property name="text">
|
||||
<string notr="true">%newline%</string>
|
||||
|
@ -320,6 +320,10 @@ QString OSD::ReplaceVariable(const QString& variable, const Song& song) {
|
||||
return return_value.setNum(song.skipcount());
|
||||
} else if (variable == "%filename%") {
|
||||
return song.basefilename();
|
||||
} else if (variable == "%rating%") {
|
||||
return song.PrettyRating();
|
||||
} else if (variable == "%score%") {
|
||||
return QString::number(song.score());
|
||||
} else if (variable == "%newline%") {
|
||||
// We need different strings depending on notification type
|
||||
switch (behaviour_) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user