From b2d20b72e9e394f68772199e00f0285543ec92e5 Mon Sep 17 00:00:00 2001 From: gaelle Date: Mon, 3 Mar 2025 16:34:39 +0100 Subject: [PATCH] fix #LINQT-1675 enable video switch in settings --- .../Container/Call/CallHistoryLayout.qml | 28 +++--- .../Display/Contact/ContactListItem.qml | 1 + .../Form/Settings/MultimediaSettings.qml | 39 ++++---- .../Layout/Settings/CallSettingsLayout.qml | 54 ++++++----- Linphone/view/Page/Main/Call/WaitingRoom.qml | 91 ++++++++++--------- .../view/Page/Main/Contact/ContactPage.qml | 1 + .../view/Page/Window/Call/CallsWindow.qml | 1 + 7 files changed, 113 insertions(+), 102 deletions(-) diff --git a/Linphone/view/Control/Container/Call/CallHistoryLayout.qml b/Linphone/view/Control/Container/Call/CallHistoryLayout.qml index 4db78a73f..b393a25e5 100644 --- a/Linphone/view/Control/Container/Call/CallHistoryLayout.qml +++ b/Linphone/view/Control/Container/Call/CallHistoryLayout.qml @@ -187,20 +187,20 @@ ColumnLayout { button.icon.source: AppIcons.chatTeardropText label: qsTr("Message") button.onClicked: console.debug("[ContactLayout.qml] TODO : open conversation") - } - LabelButton { - visible: !mainItem.isConference - width: 56 * DefaultStyle.dp - height: 56 * DefaultStyle.dp - button.icon.width: 24 * DefaultStyle.dp - button.icon.height: 24 * DefaultStyle.dp - button.icon.source: AppIcons.videoCamera - label: qsTr("Appel Video") - button.onClicked: { - if (mainItem.specificAddress === "") mainWindow.startCallWithContact(mainItem.contact, true, mainItem) - else UtilsCpp.createCall(mainItem.specificAddress, {'localVideoEnabled': true}) - } - } + } + LabelButton { + visible: !mainItem.isConference && SettingsCpp.videoEnabled + width: 56 * DefaultStyle.dp + height: 56 * DefaultStyle.dp + button.icon.width: 24 * DefaultStyle.dp + button.icon.height: 24 * DefaultStyle.dp + button.icon.source: AppIcons.videoCamera + label: qsTr("Appel Video") + button.onClicked: { + if (mainItem.specificAddress === "") mainWindow.startCallWithContact(mainItem.contact, true, mainItem) + else UtilsCpp.createCall(mainItem.specificAddress, {'localVideoEnabled': true}) + } + } } ColumnLayout { id: detailControl diff --git a/Linphone/view/Control/Display/Contact/ContactListItem.qml b/Linphone/view/Control/Display/Contact/ContactListItem.qml index f5bb3fbb9..3fc22d3bf 100644 --- a/Linphone/view/Control/Display/Contact/ContactListItem.qml +++ b/Linphone/view/Control/Display/Contact/ContactListItem.qml @@ -149,6 +149,7 @@ FocusScope { } IconButton { id: videoCallButton + visible: SettingsCpp.videoEnabled Layout.preferredWidth: 45 * DefaultStyle.dp Layout.preferredHeight: 45 * DefaultStyle.dp icon.width: 24 * DefaultStyle.dp diff --git a/Linphone/view/Control/Form/Settings/MultimediaSettings.qml b/Linphone/view/Control/Form/Settings/MultimediaSettings.qml index 629ac673e..b45b89c8a 100644 --- a/Linphone/view/Control/Form/Settings/MultimediaSettings.qml +++ b/Linphone/view/Control/Form/Settings/MultimediaSettings.qml @@ -2,7 +2,7 @@ import QtQuick import QtQuick.Controls.Basic as Control import QtQuick.Layouts import Linphone -import SettingsCpp 1.0 +import SettingsCpp ColumnLayout { id: mainItem @@ -191,24 +191,25 @@ ColumnLayout { handle: Item {visible: false} } } - ColumnLayout { - spacing: 12 * DefaultStyle.dp - RowLayout { - spacing: 8 * DefaultStyle.dp - EffectImage { - imageSource: AppIcons.videoCamera - colorizationColor: DefaultStyle.main1_500_main - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - imageWidth: 24 * DefaultStyle.dp - imageHeight: 24 * DefaultStyle.dp - } - Text { - text: qsTr("Caméra") - font: Typography.p2l - Layout.fillWidth: true - } - } + ColumnLayout { + spacing: 12 * DefaultStyle.dp + visible: SettingsCpp.videoEnabled + RowLayout { + spacing: 8 * DefaultStyle.dp + EffectImage { + imageSource: AppIcons.videoCamera + colorizationColor: DefaultStyle.main1_500_main + Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: 24 * DefaultStyle.dp + imageWidth: 24 * DefaultStyle.dp + imageHeight: 24 * DefaultStyle.dp + } + Text { + text: qsTr("Caméra") + font: Typography.p2l + Layout.fillWidth: true + } + } ComboSetting { id: videoDevicesCbox Layout.fillWidth: true diff --git a/Linphone/view/Page/Layout/Settings/CallSettingsLayout.qml b/Linphone/view/Page/Layout/Settings/CallSettingsLayout.qml index dffca951a..1536600a9 100644 --- a/Linphone/view/Page/Layout/Settings/CallSettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/CallSettingsLayout.qml @@ -32,30 +32,36 @@ AbstractSettingsLayout { // Generic call parameters ////////////////////////// - Component { - id: genericParametersComponent - ColumnLayout { - spacing: 20 * DefaultStyle.dp - SwitchSetting { - titleText: qsTr("Annulateur d'écho") - subTitleText: qsTr("Évite que de l'écho soit entendu par votre correspondant") - propertyName: "echoCancellationEnabled" - propertyOwner: SettingsCpp - } - SwitchSetting { - Layout.fillWidth: true - titleText: qsTr("Activer l’enregistrement automatique des appels") - subTitleText: qsTr("Enregistrer tous les appels par défaut") - propertyName: "automaticallyRecordCallsEnabled" - propertyOwner: SettingsCpp - visible: !SettingsCpp.disableCallRecordings - } - SwitchSetting { - titleText: qsTr("Tonalités") - subTitleText: qsTr("Activer les tonalités") - propertyName: "callToneIndicationsEnabled" - propertyOwner: SettingsCpp - } + Component { + id: genericParametersComponent + ColumnLayout { + spacing: 20 * DefaultStyle.dp + SwitchSetting { + titleText: qsTr("Annulateur d'écho") + subTitleText: qsTr("Évite que de l'écho soit entendu par votre correspondant") + propertyName: "echoCancellationEnabled" + propertyOwner: SettingsCpp + } + SwitchSetting { + Layout.fillWidth: true + titleText: qsTr("Activer l’enregistrement automatique des appels") + subTitleText: qsTr("Enregistrer tous les appels par défaut") + propertyName: "automaticallyRecordCallsEnabled" + propertyOwner: SettingsCpp + visible: !SettingsCpp.disableCallRecordings + } + SwitchSetting { + titleText: qsTr("Tonalités") + subTitleText: qsTr("Activer les tonalités") + propertyName: "callToneIndicationsEnabled" + propertyOwner: SettingsCpp + } + SwitchSetting { + titleText: qsTr("Vidéo") + subTitleText: qsTr("Autoriser la vidéo") + propertyName: "videoEnabled" + propertyOwner: SettingsCpp + } } } diff --git a/Linphone/view/Page/Main/Call/WaitingRoom.qml b/Linphone/view/Page/Main/Call/WaitingRoom.qml index 41899205a..a305b87ec 100644 --- a/Linphone/view/Page/Main/Call/WaitingRoom.qml +++ b/Linphone/view/Page/Main/Call/WaitingRoom.qml @@ -37,51 +37,52 @@ RowLayout { } account: accounts.defaultAccount } - RowLayout { - Layout.alignment: Qt.AlignHCenter - spacing: 16 * DefaultStyle.dp - CheckableButton { - id: videoButton - iconUrl: AppIcons.videoCamera - checkedIconUrl: AppIcons.videoCameraSlash - checked: !mainItem.localVideoEnabled - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp - onClicked: mainItem.localVideoEnabled = !mainItem.localVideoEnabled - } - CheckableButton { - id: microButton - iconUrl: AppIcons.microphone - checkedIconUrl: AppIcons.microphoneSlash - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp - onCheckedChanged: mainItem.microEnabled = !mainItem.microEnabled - } - CheckableButton { - id: settingsButton - visible: stackLayout.currentIndex === 0 - icon.source: AppIcons.verticalDots - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp - } - CheckableButton { - id: speakerButton - visible: stackLayout.currentIndex === 1 - iconUrl: AppIcons.speaker - checkedIconUrl: AppIcons.speakerSlash - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp - } - } - } + RowLayout { + Layout.alignment: Qt.AlignHCenter + spacing: 16 * DefaultStyle.dp + CheckableButton { + id: videoButton + visible: SettingsCpp.videoEnabled + iconUrl: AppIcons.videoCamera + checkedIconUrl: AppIcons.videoCameraSlash + checked: !mainItem.localVideoEnabled + Layout.preferredWidth: 55 * DefaultStyle.dp + Layout.preferredHeight: 55 * DefaultStyle.dp + icon.width: 32 * DefaultStyle.dp + icon.height: 32 * DefaultStyle.dp + onClicked: mainItem.localVideoEnabled = !mainItem.localVideoEnabled + } + CheckableButton { + id: microButton + iconUrl: AppIcons.microphone + checkedIconUrl: AppIcons.microphoneSlash + Layout.preferredWidth: 55 * DefaultStyle.dp + Layout.preferredHeight: 55 * DefaultStyle.dp + icon.width: 32 * DefaultStyle.dp + icon.height: 32 * DefaultStyle.dp + onCheckedChanged: mainItem.microEnabled = !mainItem.microEnabled + } + CheckableButton { + id: settingsButton + visible: stackLayout.currentIndex === 0 + icon.source: AppIcons.verticalDots + Layout.preferredWidth: 55 * DefaultStyle.dp + Layout.preferredHeight: 55 * DefaultStyle.dp + icon.width: 24 * DefaultStyle.dp + icon.height: 24 * DefaultStyle.dp + } + CheckableButton { + id: speakerButton + visible: stackLayout.currentIndex === 1 + iconUrl: AppIcons.speaker + checkedIconUrl: AppIcons.speakerSlash + Layout.preferredWidth: 55 * DefaultStyle.dp + Layout.preferredHeight: 55 * DefaultStyle.dp + icon.width: 32 * DefaultStyle.dp + icon.height: 32 * DefaultStyle.dp + } + } + } StackLayout { id: stackLayout currentIndex: 0 diff --git a/Linphone/view/Page/Main/Contact/ContactPage.qml b/Linphone/view/Page/Main/Contact/ContactPage.qml index b98b18a12..a675130e8 100644 --- a/Linphone/view/Page/Main/Contact/ContactPage.qml +++ b/Linphone/view/Page/Main/Contact/ContactPage.qml @@ -409,6 +409,7 @@ FriendGui{ "[ContactLayout.qml] TODO : open conversation") } LabelButton { + visible: SettingsCpp.videoEnabled button.icon.source: AppIcons.videoCamera label: qsTr("Appel vidéo") width: 56 * DefaultStyle.dp diff --git a/Linphone/view/Page/Window/Call/CallsWindow.qml b/Linphone/view/Page/Window/Call/CallsWindow.qml index 192b666ab..d0c8057e0 100644 --- a/Linphone/view/Page/Window/Call/CallsWindow.qml +++ b/Linphone/view/Page/Window/Call/CallsWindow.qml @@ -1200,6 +1200,7 @@ AbstractWindow { spacing: 10 * DefaultStyle.dp CheckableButton { id: videoCameraButton + visible: SettingsCpp.videoEnabled enabled: mainWindow.conferenceInfo || (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState