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
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

View file

@ -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

View file

@ -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

View file

@ -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 lenregistrement 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 lenregistrement 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
}
}
}

View file

@ -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

View file

@ -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

View file

@ -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