diff --git a/src/components/settings/SettingsModel.cpp b/src/components/settings/SettingsModel.cpp index 727cd3b83..df8f211df 100644 --- a/src/components/settings/SettingsModel.cpp +++ b/src/components/settings/SettingsModel.cpp @@ -292,6 +292,17 @@ void SettingsModel::setCallRecorderEnabled (bool status) { // ----------------------------------------------------------------------------- +bool SettingsModel::getMuteMicrophoneEnabled () const { + return !!mConfig->getInt(UiSection, "mute_microphone_enabled", 1); +} + +void SettingsModel::setMuteMicrophoneEnabled (bool status) { + mConfig->setInt(UiSection, "mute_microphone_enabled", status); + emit muteMicrophoneEnabledChanged(status); +} + +// ----------------------------------------------------------------------------- + bool SettingsModel::getChatEnabled () const { return !!mConfig->getInt(UiSection, "chat_enabled", 1); } diff --git a/src/components/settings/SettingsModel.hpp b/src/components/settings/SettingsModel.hpp index 251864d52..8ae4dca95 100644 --- a/src/components/settings/SettingsModel.hpp +++ b/src/components/settings/SettingsModel.hpp @@ -71,6 +71,8 @@ class SettingsModel : public QObject { Q_PROPERTY(bool callRecorderEnabled READ getCallRecorderEnabled WRITE setCallRecorderEnabled NOTIFY callRecorderEnabledChanged); + Q_PROPERTY(bool muteMicrophoneEnabled READ getMuteMicrophoneEnabled WRITE setMuteMicrophoneEnabled NOTIFY muteMicrophoneEnabledChanged); + Q_PROPERTY(bool chatEnabled READ getChatEnabled WRITE setChatEnabled NOTIFY chatEnabledChanged); Q_PROPERTY(bool conferenceEnabled READ getConferenceEnabled WRITE setConferenceEnabled NOTIFY conferenceEnabledChanged); @@ -221,6 +223,9 @@ public: bool getCallRecorderEnabled () const; void setCallRecorderEnabled (bool status); + bool getMuteMicrophoneEnabled () const; + void setMuteMicrophoneEnabled (bool status); + bool getChatEnabled () const; void setChatEnabled (bool status); @@ -388,6 +393,8 @@ signals: void callRecorderEnabledChanged (bool status); + void muteMicrophoneEnabledChanged (bool status); + void chatEnabledChanged (bool status); void conferenceEnabledChanged (bool status); diff --git a/ui/views/App/Calls/Incall.qml b/ui/views/App/Calls/Incall.qml index 6f387af28..39d81806c 100644 --- a/ui/views/App/Calls/Incall.qml +++ b/ui/views/App/Calls/Incall.qml @@ -293,6 +293,7 @@ Rectangle { Row { spacing: CallStyle.actionArea.vu.spacing + visible: SettingsModel.muteMicrophoneEnabled VuMeter { Timer { diff --git a/ui/views/App/Calls/IncallFullscreenWindow.qml b/ui/views/App/Calls/IncallFullscreenWindow.qml index 06ab750aa..bcafba18f 100644 --- a/ui/views/App/Calls/IncallFullscreenWindow.qml +++ b/ui/views/App/Calls/IncallFullscreenWindow.qml @@ -281,6 +281,7 @@ Window { Row { spacing: CallStyle.actionArea.vu.spacing + visible: SettingsModel.muteMicrophoneEnabled VuMeter { Timer { diff --git a/ui/views/App/Settings/SettingsCallsChat.qml b/ui/views/App/Settings/SettingsCallsChat.qml index 6a3615f72..145b86621 100644 --- a/ui/views/App/Settings/SettingsCallsChat.qml +++ b/ui/views/App/Settings/SettingsCallsChat.qml @@ -113,6 +113,16 @@ TabContainer { onClicked: SettingsModel.callRecorderEnabled = !checked } } + + FormGroup { + label: qsTr('muteMicrophoneEnabledLabel') + + Switch { + checked: SettingsModel.muteMicrophoneEnabled + + onClicked: SettingsModel.muteMicrophoneEnabled = !checked + } + } } }