add setting to disable notification sounds
This commit is contained in:
parent
6946b0db9f
commit
22b4d50ce3
|
@ -19,8 +19,9 @@
|
||||||
#include "notification/notification_p.h"
|
#include "notification/notification_p.h"
|
||||||
#include "notification/icon.h"
|
#include "notification/icon.h"
|
||||||
#include "../hint.h"
|
#include "../hint.h"
|
||||||
#include "../log.h"
|
#include "libsnore/log.h"
|
||||||
#include "../plugins/plugins.h"
|
#include "libsnore/plugins/plugins.h"
|
||||||
|
#include "libsnore/snore.h"
|
||||||
|
|
||||||
#include <QSharedData>
|
#include <QSharedData>
|
||||||
|
|
||||||
|
@ -91,6 +92,6 @@ void NotificationData::setTimeoutTimer(QTimer *timer)
|
||||||
|
|
||||||
void NotificationData::initHints()
|
void NotificationData::initHints()
|
||||||
{
|
{
|
||||||
m_hints.setValue("silent", QVariant::fromValue(false));
|
m_hints.setValue("silent", SnoreCore::instance().value("Silent", LOCAL_SETTING));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,7 @@ void SettingsDialog::load()
|
||||||
ui->primaryBackendLabel->setVisible(false);
|
ui->primaryBackendLabel->setVisible(false);
|
||||||
}
|
}
|
||||||
ui->timeoutSpinBox->setValue(SnoreCore::instance().value("Timeout", LOCAL_SETTING).toInt());
|
ui->timeoutSpinBox->setValue(SnoreCore::instance().value("Timeout", LOCAL_SETTING).toInt());
|
||||||
|
ui->disableNotificationSoundCheckBox->setChecked(SnoreCore::instance().value("Silent", LOCAL_SETTING).toBool());
|
||||||
for (auto widget : m_tabs) {
|
for (auto widget : m_tabs) {
|
||||||
widget->loadSettings();
|
widget->loadSettings();
|
||||||
}
|
}
|
||||||
|
@ -113,8 +114,11 @@ void SettingsDialog::save()
|
||||||
}
|
}
|
||||||
dirty |= SnoreCore::instance().value("PrimaryBackend", LOCAL_SETTING).toString() != ui->primaryBackendComboBox->currentText();
|
dirty |= SnoreCore::instance().value("PrimaryBackend", LOCAL_SETTING).toString() != ui->primaryBackendComboBox->currentText();
|
||||||
dirty |= SnoreCore::instance().value("Timeout", LOCAL_SETTING).toInt() != ui->timeoutSpinBox->value();
|
dirty |= SnoreCore::instance().value("Timeout", LOCAL_SETTING).toInt() != ui->timeoutSpinBox->value();
|
||||||
|
dirty |= SnoreCore::instance().value("Silent", LOCAL_SETTING).toBool() != ui->disableNotificationSoundCheckBox->isChecked();
|
||||||
|
|
||||||
SnoreCore::instance().setValue("PrimaryBackend", ui->primaryBackendComboBox->currentText(), LOCAL_SETTING);
|
SnoreCore::instance().setValue("PrimaryBackend", ui->primaryBackendComboBox->currentText(), LOCAL_SETTING);
|
||||||
SnoreCore::instance().setValue("Timeout", ui->timeoutSpinBox->value(), LOCAL_SETTING);
|
SnoreCore::instance().setValue("Timeout", ui->timeoutSpinBox->value(), LOCAL_SETTING);
|
||||||
|
SnoreCore::instance().setValue("Silent", ui->disableNotificationSoundCheckBox->isChecked(), LOCAL_SETTING);
|
||||||
|
|
||||||
if (dirty) {
|
if (dirty) {
|
||||||
SnoreCorePrivate::instance()->syncSettings();
|
SnoreCorePrivate::instance()->syncSettings();
|
||||||
|
|
|
@ -63,6 +63,16 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="disableNotificationSoundLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable Notification Sound:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QCheckBox" name="disableNotificationSoundCheckBox"/>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
@ -140,6 +140,7 @@ void SnoreCorePrivate::init()
|
||||||
{
|
{
|
||||||
Q_Q(SnoreCore);
|
Q_Q(SnoreCore);
|
||||||
q->setDefaultValue("Timeout", 10, LOCAL_SETTING);
|
q->setDefaultValue("Timeout", 10, LOCAL_SETTING);
|
||||||
|
q->setDefaultValue("Silent", false, LOCAL_SETTING);
|
||||||
q->setDefaultApplication(Application("SnoreNotify", Icon(":/root/snore.png")));
|
q->setDefaultApplication(Application("SnoreNotify", Icon(":/root/snore.png")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue