Add %filename% as possible custom OSD variable. Fixes issue 2648
This commit is contained in:
parent
5280ddf3d7
commit
04805de5c6
|
@ -54,6 +54,7 @@ NotificationsSettingsPage::NotificationsSettingsPage(SettingsDialog* dialog)
|
|||
menu->addAction(ui_->action_genre);
|
||||
menu->addAction(ui_->action_playcount);
|
||||
menu->addAction(ui_->action_skipcount);
|
||||
menu->addAction(ui_->action_filename);
|
||||
menu->addSeparator();
|
||||
menu->addAction(ui_->action_newline);
|
||||
ui_->notifications_exp_chooser1->setMenu(menu);
|
||||
|
|
|
@ -434,6 +434,14 @@
|
|||
<string>Add a new line if supported by the notification type</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_filename">
|
||||
<property name="text">
|
||||
<string>%filename%</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Add song filename</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
|
@ -339,6 +339,8 @@ QString OSD::ReplaceVariable(const QString& variable, const Song& song) {
|
|||
return return_value.setNum(song.playcount());
|
||||
} else if (variable == "%skipcount%") {
|
||||
return return_value.setNum(song.skipcount());
|
||||
} else if (variable == "%filename%") {
|
||||
return song.basefilename();
|
||||
} else if (variable == "%newline%") {
|
||||
// We need different strings depending on notification type
|
||||
switch (behaviour_) {
|
||||
|
|
Loading…
Reference in New Issue