mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-17 20:09:50 +01:00
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());
|
||||
ui_->notifications_play_mode->setChecked(
|
||||
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_custom_text_enabled->setChecked(
|
||||
s.value("CustomTextEnabled", false).toBool());
|
||||
@ -203,6 +205,7 @@ void NotificationsSettingsPage::Save() {
|
||||
s.setValue("Timeout", ui_->notifications_duration->value() * 1000);
|
||||
s.setValue("ShowOnVolumeChange", ui_->notifications_volume->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("CustomTextEnabled",
|
||||
ui_->notifications_custom_text_enabled->isChecked());
|
||||
|
@ -117,6 +117,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="notifications_pause">
|
||||
<property name="text">
|
||||
<string>Show a notification when I pause playback</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="notifications_art">
|
||||
<property name="text">
|
||||
|
@ -42,6 +42,7 @@ OSD::OSD(SystemTrayIcon* tray_icon, Application* app, QObject* parent)
|
||||
show_on_volume_change_(false),
|
||||
show_art_(true),
|
||||
show_on_play_mode_change_(true),
|
||||
show_on_pause_(true),
|
||||
use_custom_text_(false),
|
||||
custom_text1_(QString()),
|
||||
custom_text2_(QString()),
|
||||
@ -67,6 +68,7 @@ void OSD::ReloadSettings() {
|
||||
show_on_volume_change_ = s.value("ShowOnVolumeChange", false).toBool();
|
||||
show_art_ = s.value("ShowArt", 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();
|
||||
custom_text1_ = s.value("CustomText1").toString();
|
||||
custom_text2_ = s.value("CustomText2").toString();
|
||||
@ -150,7 +152,9 @@ void OSD::AlbumArtLoaded(const Song& song, const QString& uri,
|
||||
}
|
||||
|
||||
void OSD::Paused() {
|
||||
ShowMessage(QCoreApplication::applicationName(), tr("Paused"));
|
||||
if (show_on_pause_) {
|
||||
ShowMessage(QCoreApplication::applicationName(), tr("Paused"));
|
||||
}
|
||||
}
|
||||
|
||||
void OSD::Stopped() {
|
||||
|
@ -52,7 +52,12 @@ class OSD : public QObject {
|
||||
|
||||
static const char* kSettingsGroup;
|
||||
|
||||
enum Behaviour { Disabled = 0, Native, TrayPopup, Pretty, };
|
||||
enum Behaviour {
|
||||
Disabled = 0,
|
||||
Native,
|
||||
TrayPopup,
|
||||
Pretty,
|
||||
};
|
||||
|
||||
// Implemented in the OS-specific files
|
||||
static bool SupportsNativeNotifications();
|
||||
@ -113,6 +118,7 @@ class OSD : public QObject {
|
||||
bool show_on_volume_change_;
|
||||
bool show_art_;
|
||||
bool show_on_play_mode_change_;
|
||||
bool show_on_pause_;
|
||||
bool use_custom_text_;
|
||||
QString custom_text1_;
|
||||
QString custom_text2_;
|
||||
|
Loading…
Reference in New Issue
Block a user