Add an option to turn off album art in the OSD
This commit is contained in:
parent
6436c53705
commit
4d8636874e
@ -11,7 +11,8 @@ OSD::OSD(QSystemTrayIcon* tray_icon, QObject* parent)
|
|||||||
tray_icon_(tray_icon),
|
tray_icon_(tray_icon),
|
||||||
timeout_(5000),
|
timeout_(5000),
|
||||||
behaviour_(Native),
|
behaviour_(Native),
|
||||||
show_on_volume_change_(false)
|
show_on_volume_change_(false),
|
||||||
|
show_art_(true)
|
||||||
{
|
{
|
||||||
ReloadSettings();
|
ReloadSettings();
|
||||||
Init();
|
Init();
|
||||||
@ -23,6 +24,7 @@ void OSD::ReloadSettings() {
|
|||||||
behaviour_ = OSD::Behaviour(s.value("Behaviour", Native).toInt());
|
behaviour_ = OSD::Behaviour(s.value("Behaviour", Native).toInt());
|
||||||
timeout_ = s.value("Timeout", 5000).toInt();
|
timeout_ = s.value("Timeout", 5000).toInt();
|
||||||
show_on_volume_change_ = s.value("ShowOnVolumeChange", false).toBool();
|
show_on_volume_change_ = s.value("ShowOnVolumeChange", false).toBool();
|
||||||
|
show_art_ = s.value("ShowArt", true).toBool();
|
||||||
|
|
||||||
if (!SupportsNativeNotifications() && behaviour_ == Native)
|
if (!SupportsNativeNotifications() && behaviour_ == Native)
|
||||||
behaviour_ = TrayPopup;
|
behaviour_ = TrayPopup;
|
||||||
@ -44,7 +46,8 @@ void OSD::SongChanged(const Song &song) {
|
|||||||
if (song.track() > 0)
|
if (song.track() > 0)
|
||||||
message_parts << QString("track %1").arg(song.track());
|
message_parts << QString("track %1").arg(song.track());
|
||||||
|
|
||||||
ShowMessage(summary, message_parts.join(", "), "notification-audio-play", song.GetBestImage());
|
ShowMessage(summary, message_parts.join(", "), "notification-audio-play",
|
||||||
|
show_art_ ? song.GetBestImage() : QImage());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSD::Paused() {
|
void OSD::Paused() {
|
||||||
|
@ -61,6 +61,7 @@ class OSD : public QObject {
|
|||||||
int timeout_;
|
int timeout_;
|
||||||
Behaviour behaviour_;
|
Behaviour behaviour_;
|
||||||
bool show_on_volume_change_;
|
bool show_on_volume_change_;
|
||||||
|
bool show_art_;
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
NotifyNotification* notification_;
|
NotifyNotification* notification_;
|
||||||
|
@ -69,6 +69,7 @@ void SettingsDialog::accept() {
|
|||||||
s.setValue("Behaviour", int(osd_behaviour));
|
s.setValue("Behaviour", int(osd_behaviour));
|
||||||
s.setValue("Timeout", ui_.notifications_duration->value() * 1000);
|
s.setValue("Timeout", ui_.notifications_duration->value() * 1000);
|
||||||
s.setValue("ShowOnVolumeChange", ui_.notifications_volume->isChecked());
|
s.setValue("ShowOnVolumeChange", ui_.notifications_volume->isChecked());
|
||||||
|
s.setValue("ShowArt", ui_.notifications_art->isChecked());
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
@ -114,6 +115,7 @@ void SettingsDialog::showEvent(QShowEvent*) {
|
|||||||
}
|
}
|
||||||
ui_.notifications_duration->setValue(s.value("Timeout", 5000).toInt() / 1000);
|
ui_.notifications_duration->setValue(s.value("Timeout", 5000).toInt() / 1000);
|
||||||
ui_.notifications_volume->setChecked(s.value("ShowOnVolumeChange", false).toBool());
|
ui_.notifications_volume->setChecked(s.value("ShowOnVolumeChange", false).toBool());
|
||||||
|
ui_.notifications_art->setChecked(s.value("ShowArt", true).toBool());
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,6 +280,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="notifications_art">
|
||||||
|
<property name="text">
|
||||||
|
<string>Include album art in the notification</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_3">
|
<spacer name="verticalSpacer_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user