fix #LINQT-1675 enable video switch in settings

This commit is contained in:
gaelle 2025-03-03 16:34:39 +01:00
parent e620af3f3e
commit b2d20b72e9
7 changed files with 113 additions and 102 deletions

View file

@ -187,20 +187,20 @@ ColumnLayout {
button.icon.source: AppIcons.chatTeardropText button.icon.source: AppIcons.chatTeardropText
label: qsTr("Message") label: qsTr("Message")
button.onClicked: console.debug("[ContactLayout.qml] TODO : open conversation") button.onClicked: console.debug("[ContactLayout.qml] TODO : open conversation")
} }
LabelButton { LabelButton {
visible: !mainItem.isConference visible: !mainItem.isConference && SettingsCpp.videoEnabled
width: 56 * DefaultStyle.dp width: 56 * DefaultStyle.dp
height: 56 * DefaultStyle.dp height: 56 * DefaultStyle.dp
button.icon.width: 24 * DefaultStyle.dp button.icon.width: 24 * DefaultStyle.dp
button.icon.height: 24 * DefaultStyle.dp button.icon.height: 24 * DefaultStyle.dp
button.icon.source: AppIcons.videoCamera button.icon.source: AppIcons.videoCamera
label: qsTr("Appel Video") label: qsTr("Appel Video")
button.onClicked: { button.onClicked: {
if (mainItem.specificAddress === "") mainWindow.startCallWithContact(mainItem.contact, true, mainItem) if (mainItem.specificAddress === "") mainWindow.startCallWithContact(mainItem.contact, true, mainItem)
else UtilsCpp.createCall(mainItem.specificAddress, {'localVideoEnabled': true}) else UtilsCpp.createCall(mainItem.specificAddress, {'localVideoEnabled': true})
} }
} }
} }
ColumnLayout { ColumnLayout {
id: detailControl id: detailControl

View file

@ -149,6 +149,7 @@ FocusScope {
} }
IconButton { IconButton {
id: videoCallButton id: videoCallButton
visible: SettingsCpp.videoEnabled
Layout.preferredWidth: 45 * DefaultStyle.dp Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp Layout.preferredHeight: 45 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp icon.width: 24 * DefaultStyle.dp

View file

@ -2,7 +2,7 @@ import QtQuick
import QtQuick.Controls.Basic as Control import QtQuick.Controls.Basic as Control
import QtQuick.Layouts import QtQuick.Layouts
import Linphone import Linphone
import SettingsCpp 1.0 import SettingsCpp
ColumnLayout { ColumnLayout {
id: mainItem id: mainItem
@ -191,24 +191,25 @@ ColumnLayout {
handle: Item {visible: false} handle: Item {visible: false}
} }
} }
ColumnLayout { ColumnLayout {
spacing: 12 * DefaultStyle.dp spacing: 12 * DefaultStyle.dp
RowLayout { visible: SettingsCpp.videoEnabled
spacing: 8 * DefaultStyle.dp RowLayout {
EffectImage { spacing: 8 * DefaultStyle.dp
imageSource: AppIcons.videoCamera EffectImage {
colorizationColor: DefaultStyle.main1_500_main imageSource: AppIcons.videoCamera
Layout.preferredWidth: 24 * DefaultStyle.dp colorizationColor: DefaultStyle.main1_500_main
Layout.preferredHeight: 24 * DefaultStyle.dp Layout.preferredWidth: 24 * DefaultStyle.dp
imageWidth: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp
imageHeight: 24 * DefaultStyle.dp imageWidth: 24 * DefaultStyle.dp
} imageHeight: 24 * DefaultStyle.dp
Text { }
text: qsTr("Caméra") Text {
font: Typography.p2l text: qsTr("Caméra")
Layout.fillWidth: true font: Typography.p2l
} Layout.fillWidth: true
} }
}
ComboSetting { ComboSetting {
id: videoDevicesCbox id: videoDevicesCbox
Layout.fillWidth: true Layout.fillWidth: true

View file

@ -32,30 +32,36 @@ AbstractSettingsLayout {
// Generic call parameters // Generic call parameters
////////////////////////// //////////////////////////
Component { Component {
id: genericParametersComponent id: genericParametersComponent
ColumnLayout { ColumnLayout {
spacing: 20 * DefaultStyle.dp spacing: 20 * DefaultStyle.dp
SwitchSetting { SwitchSetting {
titleText: qsTr("Annulateur d'écho") titleText: qsTr("Annulateur d'écho")
subTitleText: qsTr("Évite que de l'écho soit entendu par votre correspondant") subTitleText: qsTr("Évite que de l'écho soit entendu par votre correspondant")
propertyName: "echoCancellationEnabled" propertyName: "echoCancellationEnabled"
propertyOwner: SettingsCpp propertyOwner: SettingsCpp
} }
SwitchSetting { SwitchSetting {
Layout.fillWidth: true Layout.fillWidth: true
titleText: qsTr("Activer lenregistrement automatique des appels") titleText: qsTr("Activer lenregistrement automatique des appels")
subTitleText: qsTr("Enregistrer tous les appels par défaut") subTitleText: qsTr("Enregistrer tous les appels par défaut")
propertyName: "automaticallyRecordCallsEnabled" propertyName: "automaticallyRecordCallsEnabled"
propertyOwner: SettingsCpp propertyOwner: SettingsCpp
visible: !SettingsCpp.disableCallRecordings visible: !SettingsCpp.disableCallRecordings
} }
SwitchSetting { SwitchSetting {
titleText: qsTr("Tonalités") titleText: qsTr("Tonalités")
subTitleText: qsTr("Activer les tonalités") subTitleText: qsTr("Activer les tonalités")
propertyName: "callToneIndicationsEnabled" propertyName: "callToneIndicationsEnabled"
propertyOwner: SettingsCpp propertyOwner: SettingsCpp
} }
SwitchSetting {
titleText: qsTr("Vidéo")
subTitleText: qsTr("Autoriser la vidéo")
propertyName: "videoEnabled"
propertyOwner: SettingsCpp
}
} }
} }

View file

@ -37,51 +37,52 @@ RowLayout {
} }
account: accounts.defaultAccount account: accounts.defaultAccount
} }
RowLayout { RowLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
spacing: 16 * DefaultStyle.dp spacing: 16 * DefaultStyle.dp
CheckableButton { CheckableButton {
id: videoButton id: videoButton
iconUrl: AppIcons.videoCamera visible: SettingsCpp.videoEnabled
checkedIconUrl: AppIcons.videoCameraSlash iconUrl: AppIcons.videoCamera
checked: !mainItem.localVideoEnabled checkedIconUrl: AppIcons.videoCameraSlash
Layout.preferredWidth: 55 * DefaultStyle.dp checked: !mainItem.localVideoEnabled
Layout.preferredHeight: 55 * DefaultStyle.dp Layout.preferredWidth: 55 * DefaultStyle.dp
icon.width: 32 * DefaultStyle.dp Layout.preferredHeight: 55 * DefaultStyle.dp
icon.height: 32 * DefaultStyle.dp icon.width: 32 * DefaultStyle.dp
onClicked: mainItem.localVideoEnabled = !mainItem.localVideoEnabled icon.height: 32 * DefaultStyle.dp
} onClicked: mainItem.localVideoEnabled = !mainItem.localVideoEnabled
CheckableButton { }
id: microButton CheckableButton {
iconUrl: AppIcons.microphone id: microButton
checkedIconUrl: AppIcons.microphoneSlash iconUrl: AppIcons.microphone
Layout.preferredWidth: 55 * DefaultStyle.dp checkedIconUrl: AppIcons.microphoneSlash
Layout.preferredHeight: 55 * DefaultStyle.dp Layout.preferredWidth: 55 * DefaultStyle.dp
icon.width: 32 * DefaultStyle.dp Layout.preferredHeight: 55 * DefaultStyle.dp
icon.height: 32 * DefaultStyle.dp icon.width: 32 * DefaultStyle.dp
onCheckedChanged: mainItem.microEnabled = !mainItem.microEnabled icon.height: 32 * DefaultStyle.dp
} onCheckedChanged: mainItem.microEnabled = !mainItem.microEnabled
CheckableButton { }
id: settingsButton CheckableButton {
visible: stackLayout.currentIndex === 0 id: settingsButton
icon.source: AppIcons.verticalDots visible: stackLayout.currentIndex === 0
Layout.preferredWidth: 55 * DefaultStyle.dp icon.source: AppIcons.verticalDots
Layout.preferredHeight: 55 * DefaultStyle.dp Layout.preferredWidth: 55 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp Layout.preferredHeight: 55 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp icon.width: 24 * DefaultStyle.dp
} icon.height: 24 * DefaultStyle.dp
CheckableButton { }
id: speakerButton CheckableButton {
visible: stackLayout.currentIndex === 1 id: speakerButton
iconUrl: AppIcons.speaker visible: stackLayout.currentIndex === 1
checkedIconUrl: AppIcons.speakerSlash iconUrl: AppIcons.speaker
Layout.preferredWidth: 55 * DefaultStyle.dp checkedIconUrl: AppIcons.speakerSlash
Layout.preferredHeight: 55 * DefaultStyle.dp Layout.preferredWidth: 55 * DefaultStyle.dp
icon.width: 32 * DefaultStyle.dp Layout.preferredHeight: 55 * DefaultStyle.dp
icon.height: 32 * DefaultStyle.dp icon.width: 32 * DefaultStyle.dp
} icon.height: 32 * DefaultStyle.dp
} }
} }
}
StackLayout { StackLayout {
id: stackLayout id: stackLayout
currentIndex: 0 currentIndex: 0

View file

@ -409,6 +409,7 @@ FriendGui{
"[ContactLayout.qml] TODO : open conversation") "[ContactLayout.qml] TODO : open conversation")
} }
LabelButton { LabelButton {
visible: SettingsCpp.videoEnabled
button.icon.source: AppIcons.videoCamera button.icon.source: AppIcons.videoCamera
label: qsTr("Appel vidéo") label: qsTr("Appel vidéo")
width: 56 * DefaultStyle.dp width: 56 * DefaultStyle.dp

View file

@ -1200,6 +1200,7 @@ AbstractWindow {
spacing: 10 * DefaultStyle.dp spacing: 10 * DefaultStyle.dp
CheckableButton { CheckableButton {
id: videoCameraButton id: videoCameraButton
visible: SettingsCpp.videoEnabled
enabled: mainWindow.conferenceInfo enabled: mainWindow.conferenceInfo
|| (mainWindow.callState === LinphoneEnums.CallState.Connected || (mainWindow.callState === LinphoneEnums.CallState.Connected
|| mainWindow.callState || mainWindow.callState