Add %filename% as possible custom OSD variable. Fixes issue 2648

This commit is contained in:
Alan Briolat 2012-02-02 18:50:19 +00:00 committed by David Sansome
parent 5280ddf3d7
commit 04805de5c6
3 changed files with 11 additions and 0 deletions

View File

@ -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);

View File

@ -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/>

View File

@ -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_) {