From 68e5eeb817022912ee3df0a65a6cfddcdcfaed83 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 Apr 2018 10:07:17 +0200 Subject: [PATCH] feat(Settings): hide some options when video, chat or call record are not available --- src/components/call/CallModel.cpp | 2 +- ui/views/App/Settings/SettingsCallsChat.qml | 1 + ui/views/App/Settings/SettingsNetwork.qml | 2 ++ ui/views/App/Settings/SettingsUi.qml | 9 +++++++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/call/CallModel.cpp b/src/components/call/CallModel.cpp index a87b067e7..da9f759a5 100644 --- a/src/components/call/CallModel.cpp +++ b/src/components/call/CallModel.cpp @@ -384,7 +384,7 @@ void CallModel::acceptWithAutoAnswerDelay () { // Use auto-answer if activated and it's the only call. if (settingsModel->getAutoAnswerStatus() && coreManager->getCore()->getCallsNb() == 1) { - if (mCall->getRemoteParams()->videoEnabled() && settingsModel->getAutoAnswerVideoStatus()) + if (mCall->getRemoteParams()->videoEnabled() && settingsModel->getAutoAnswerVideoStatus() && settingsModel->getVideoSupported()) acceptWithVideo(); else accept(); diff --git a/ui/views/App/Settings/SettingsCallsChat.qml b/ui/views/App/Settings/SettingsCallsChat.qml index f1dac252d..4916b9004 100644 --- a/ui/views/App/Settings/SettingsCallsChat.qml +++ b/ui/views/App/Settings/SettingsCallsChat.qml @@ -90,6 +90,7 @@ TabContainer { FormLine { FormGroup { label: qsTr('autoAnswerWithVideoLabel') + visible: SettingsModel.videoSupported Switch { checked: SettingsModel.autoAnswerVideoStatus diff --git a/ui/views/App/Settings/SettingsNetwork.qml b/ui/views/App/Settings/SettingsNetwork.qml index fedef2068..9f7041bcd 100644 --- a/ui/views/App/Settings/SettingsNetwork.qml +++ b/ui/views/App/Settings/SettingsNetwork.qml @@ -250,6 +250,7 @@ TabContainer { readonly property int defaultPort: 9078 title: qsTr('videoRtpUdpPortLabel') + visible: SettingsModel.videoSupported FormTableEntry { PortField { @@ -401,6 +402,7 @@ TabContainer { FormGroup { label: qsTr('videoRtpStreamFieldLabel') + visible: SettingsModel.videoSupported HexField { text: SettingsModel.dscpVideo diff --git a/ui/views/App/Settings/SettingsUi.qml b/ui/views/App/Settings/SettingsUi.qml index 78acb9cc4..8244caf74 100644 --- a/ui/views/App/Settings/SettingsUi.qml +++ b/ui/views/App/Settings/SettingsUi.qml @@ -58,9 +58,12 @@ TabContainer { Form { title: qsTr('pathsTitle') + visible: SettingsModel.videoSupported || SettingsModel.callRecorderEnabled || SettingsModel.chatEnabled width: parent.width FormLine { + visible: SettingsModel.videoSupported + FormGroup { label: qsTr('savedScreenshotsLabel') @@ -74,6 +77,8 @@ TabContainer { } FormLine { + visible: SettingsModel.callRecorderEnabled + FormGroup { label: qsTr('savedVideosLabel') @@ -87,6 +92,8 @@ TabContainer { } FormLine { + visible: SettingsModel.chatEnabled + FormGroup { label: qsTr('downloadLabel') @@ -131,8 +138,6 @@ TabContainer { label: qsTr('exitOnCloseLabel') Switch { - id: autoAnswer - checked: SettingsModel.exitOnClose onClicked: SettingsModel.exitOnClose = !checked