Added a preference to disable the pause notification. Fixes #2450.
This commit is contained in:
parent
f3ec15cda3
commit
38c51508f2
|
@ -154,6 +154,8 @@ void NotificationsSettingsPage::Load() {
|
||||||
s.value("ShowOnVolumeChange", false).toBool());
|
s.value("ShowOnVolumeChange", false).toBool());
|
||||||
ui_->notifications_play_mode->setChecked(
|
ui_->notifications_play_mode->setChecked(
|
||||||
s.value("ShowOnPlayModeChange", true).toBool());
|
s.value("ShowOnPlayModeChange", true).toBool());
|
||||||
|
ui_->notifications_pause->setChecked(
|
||||||
|
s.value("ShowOnPausePlayback", true).toBool());
|
||||||
ui_->notifications_art->setChecked(s.value("ShowArt", true).toBool());
|
ui_->notifications_art->setChecked(s.value("ShowArt", true).toBool());
|
||||||
ui_->notifications_custom_text_enabled->setChecked(
|
ui_->notifications_custom_text_enabled->setChecked(
|
||||||
s.value("CustomTextEnabled", false).toBool());
|
s.value("CustomTextEnabled", false).toBool());
|
||||||
|
@ -203,6 +205,7 @@ void NotificationsSettingsPage::Save() {
|
||||||
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("ShowOnPlayModeChange", ui_->notifications_play_mode->isChecked());
|
s.setValue("ShowOnPlayModeChange", ui_->notifications_play_mode->isChecked());
|
||||||
|
s.setValue("ShowOnPausePlayback", ui_->notifications_pause->isChecked());
|
||||||
s.setValue("ShowArt", ui_->notifications_art->isChecked());
|
s.setValue("ShowArt", ui_->notifications_art->isChecked());
|
||||||
s.setValue("CustomTextEnabled",
|
s.setValue("CustomTextEnabled",
|
||||||
ui_->notifications_custom_text_enabled->isChecked());
|
ui_->notifications_custom_text_enabled->isChecked());
|
||||||
|
|
|
@ -117,6 +117,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="notifications_pause">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show a notification when I pause playback</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="notifications_art">
|
<widget class="QCheckBox" name="notifications_art">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
|
@ -42,6 +42,7 @@ OSD::OSD(SystemTrayIcon* tray_icon, Application* app, QObject* parent)
|
||||||
show_on_volume_change_(false),
|
show_on_volume_change_(false),
|
||||||
show_art_(true),
|
show_art_(true),
|
||||||
show_on_play_mode_change_(true),
|
show_on_play_mode_change_(true),
|
||||||
|
show_on_pause_(true),
|
||||||
use_custom_text_(false),
|
use_custom_text_(false),
|
||||||
custom_text1_(QString()),
|
custom_text1_(QString()),
|
||||||
custom_text2_(QString()),
|
custom_text2_(QString()),
|
||||||
|
@ -67,6 +68,7 @@ void OSD::ReloadSettings() {
|
||||||
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();
|
show_art_ = s.value("ShowArt", true).toBool();
|
||||||
show_on_play_mode_change_ = s.value("ShowOnPlayModeChange", true).toBool();
|
show_on_play_mode_change_ = s.value("ShowOnPlayModeChange", true).toBool();
|
||||||
|
show_on_pause_ = s.value("ShowOnPausePlayback", true).toBool();
|
||||||
use_custom_text_ = s.value(("CustomTextEnabled"), false).toBool();
|
use_custom_text_ = s.value(("CustomTextEnabled"), false).toBool();
|
||||||
custom_text1_ = s.value("CustomText1").toString();
|
custom_text1_ = s.value("CustomText1").toString();
|
||||||
custom_text2_ = s.value("CustomText2").toString();
|
custom_text2_ = s.value("CustomText2").toString();
|
||||||
|
@ -150,7 +152,9 @@ void OSD::AlbumArtLoaded(const Song& song, const QString& uri,
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSD::Paused() {
|
void OSD::Paused() {
|
||||||
ShowMessage(QCoreApplication::applicationName(), tr("Paused"));
|
if (show_on_pause_) {
|
||||||
|
ShowMessage(QCoreApplication::applicationName(), tr("Paused"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSD::Stopped() {
|
void OSD::Stopped() {
|
||||||
|
|
|
@ -52,7 +52,12 @@ class OSD : public QObject {
|
||||||
|
|
||||||
static const char* kSettingsGroup;
|
static const char* kSettingsGroup;
|
||||||
|
|
||||||
enum Behaviour { Disabled = 0, Native, TrayPopup, Pretty, };
|
enum Behaviour {
|
||||||
|
Disabled = 0,
|
||||||
|
Native,
|
||||||
|
TrayPopup,
|
||||||
|
Pretty,
|
||||||
|
};
|
||||||
|
|
||||||
// Implemented in the OS-specific files
|
// Implemented in the OS-specific files
|
||||||
static bool SupportsNativeNotifications();
|
static bool SupportsNativeNotifications();
|
||||||
|
@ -113,6 +118,7 @@ class OSD : public QObject {
|
||||||
bool show_on_volume_change_;
|
bool show_on_volume_change_;
|
||||||
bool show_art_;
|
bool show_art_;
|
||||||
bool show_on_play_mode_change_;
|
bool show_on_play_mode_change_;
|
||||||
|
bool show_on_pause_;
|
||||||
bool use_custom_text_;
|
bool use_custom_text_;
|
||||||
QString custom_text1_;
|
QString custom_text1_;
|
||||||
QString custom_text2_;
|
QString custom_text2_;
|
||||||
|
|
Loading…
Reference in New Issue