Commit 187f082d authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Notifications] Add setting for do not disturb while screen sharing

parent 99983ec1
......@@ -14,6 +14,10 @@
<default>true</default>
</entry>
<entry name="WhenScreenSharing" type="Bool">
<default>true</default>
</entry>
<entry name="NotificationSoundsMuted" type="Bool">
<default>false</default>
</entry>
......
......@@ -594,6 +594,21 @@ void Settings::setScreensMirrored(bool mirrored)
}
}
bool Settings::inhibitNotificationsWhenScreenSharing() const
{
return d->dndSettings.whenScreenSharing();
}
void Settings::setInhibitNotificationsWhenScreenSharing(bool inhibit)
{
if (inhibit == inhibitNotificationsWhenScreenSharing()) {
return;
}
d->dndSettings.setWhenScreenSharing(inhibit);
d->setDirty(true);
}
void Settings::revokeApplicationInhibitions()
{
Server::self().clearInhibitions();
......
......@@ -175,6 +175,13 @@ class NOTIFICATIONMANAGER_EXPORT Settings : public QObject
*/
Q_PROPERTY(bool screensMirrored READ screensMirrored WRITE setScreensMirrored NOTIFY screensMirroredChanged)
/**
* Whether to enable do not disturb mode while screen sharing
*
* @since 5.22
*/
Q_PROPERTY(bool inhibitNotificationsWhenScreenSharing READ inhibitNotificationsWhenScreenSharing WRITE setInhibitNotificationsWhenScreenSharing NOTIFY settingsChanged)
/**
* Whether notification sounds should be disabled
*
......@@ -311,6 +318,9 @@ public:
bool screensMirrored() const;
void setScreensMirrored(bool enable);
bool inhibitNotificationsWhenScreenSharing() const;
void setInhibitNotificationsWhenScreenSharing(bool inhibit);
bool notificationSoundsInhibited() const;
void setNotificationSoundsInhibited(bool inhibited);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment