Skip to content
Snippets Groups Projects
Commit 4a2bf0d6 authored by Aline Gondim Santos's avatar Aline Gondim Santos Committed by Sébastien Blin
Browse files

calls: hide video related features if video disabled

Call controls and features are restrained if video is disabled in account advanced settings.

+ Do not show "accept in video" if there is no video device available

GitLab: #525
Change-Id: Iacc8801c8a302a1b00642a6c31603973ff5f24b6
parent 156b3f6d
No related branches found
No related tags found
No related merge requests found
......@@ -302,6 +302,11 @@ Control {
function onLocalHandRaisedChanged() { reset() }
function onIsConferenceCallChanged() { reset() }
}
Connections {
target: CurrentAccount
function onVideoEnabledVideoChanged() { reset() }
}
function reset() {
CallOverlayModel.clearControls()
......@@ -309,6 +314,8 @@ Control {
// centered controls
CallOverlayModel.addPrimaryControl(muteAudioAction)
CallOverlayModel.addPrimaryControl(hangupAction)
if (CurrentAccount.videoEnabled_Video)
CallOverlayModel.addPrimaryControl(muteVideoAction)
// overflow controls
......@@ -325,7 +332,7 @@ Control {
CallOverlayModel.addSecondaryControl(callTransferAction)
}
CallOverlayModel.addSecondaryControl(chatAction)
if (!isSIP)
if (CurrentAccount.videoEnabled_Video && !isSIP)
CallOverlayModel.addSecondaryControl(shareAction)
CallOverlayModel.addSecondaryControl(recordAction)
CallOverlayModel.addSecondaryControl(pluginsAction)
......
......@@ -113,7 +113,7 @@ ContextMenuAutoLoader {
GeneralMenuItem {
id: shareScreen
canTrigger: AvAdapter.currentRenderingDeviceType !== Video.DeviceType.DISPLAY
canTrigger: CurrentAccount.videoEnabled_Video && AvAdapter.currentRenderingDeviceType !== Video.DeviceType.DISPLAY
&& !isSIP
itemName: JamiStrings.shareScreen
iconSource: JamiResources.share_screen_black_24dp_svg
......@@ -129,7 +129,7 @@ ContextMenuAutoLoader {
GeneralMenuItem {
id: shareScreenArea
canTrigger: AvAdapter.currentRenderingDeviceType !== Video.DeviceType.DISPLAY
canTrigger: CurrentAccount.videoEnabled_Video && AvAdapter.currentRenderingDeviceType !== Video.DeviceType.DISPLAY
&& !isSIP
itemName: JamiStrings.shareScreenArea
iconSource: JamiResources.share_screen_black_24dp_svg
......@@ -145,7 +145,7 @@ ContextMenuAutoLoader {
GeneralMenuItem {
id: shareFile
canTrigger: !isSIP
canTrigger: CurrentAccount.videoEnabled_Video && !isSIP
itemName: JamiStrings.shareFile
iconSource: JamiResources.insert_photo_24dp_svg
onClicked: {
......
......@@ -154,7 +154,7 @@ Rectangle {
PushButton {
id: startAVideoCallButton
visible: interactionButtonsVisibility
visible: CurrentAccount.videoEnabled_Video && interactionButtonsVisibility
source: JamiResources.videocam_24dp_svg
toolTipText: JamiStrings.placeVideoCall
......@@ -162,7 +162,9 @@ Rectangle {
normalColor: JamiTheme.chatviewBgColor
imageColor: JamiTheme.chatviewButtonColor
onClicked: CallAdapter.placeCall()
onClicked: {
CallAdapter.placeCall()
}
}
PushButton {
......
......@@ -157,8 +157,11 @@ ListView {
Shortcut {
sequence: "Ctrl+Shift+X"
context: Qt.ApplicationShortcut
enabled: root.visible
onActivated: CallAdapter.placeCall()
enabled: CurrentAccount.videoEnabled_Video && root.visible
onActivated: {
if (CurrentAccount.videoEnabled_Video)
CallAdapter.placeCall()
}
}
Shortcut {
......
......@@ -44,12 +44,13 @@ ContextMenuAutoLoader {
GeneralMenuItem {
id: startVideoCallItem
canTrigger: !hasCall && !readOnly
canTrigger: CurrentAccount.videoEnabled_Video && !hasCall && !readOnly
itemName: JamiStrings.startVideoCall
iconSource: JamiResources.videocam_24dp_svg
onClicked: {
LRCInstance.selectConversation(responsibleConvUid,
responsibleAccountId)
if (CurrentAccount.videoEnabled_Video)
CallAdapter.placeCall()
}
},
......
......@@ -42,11 +42,34 @@ Rectangle {
ListModel {
id: incomingControlsModel
Component.onCompleted: {
append({"type": "refuse", "image": JamiResources.round_close_24dp_svg})
append({"type": "mic", "image" : JamiResources.place_audiocall_24dp_svg})
append({"type": "cam", "image" : JamiResources.videocam_24dp_svg})
fillIncomingControls()
}
}
Connections {
target: CurrentAccount
function onVideoEnabledVideoChanged() {
fillIncomingControls()
}
}
Connections {
target: VideoDevices
function onListSizeChanged() {
fillIncomingControls()
}
}
function fillIncomingControls() {
incomingControlsModel.clear()
incomingControlsModel.append({"type": "refuse", "image": JamiResources.round_close_24dp_svg})
incomingControlsModel.append({"type": "mic", "image" : JamiResources.place_audiocall_24dp_svg})
if (CurrentAccount.videoEnabled_Video && VideoDevices.listSize !== 0)
incomingControlsModel.append({"type": "cam", "image" : JamiResources.videocam_24dp_svg})
}
ListModel {
id: outgoingControlsModel
Component.onCompleted: {
......
......@@ -158,7 +158,7 @@ ItemDelegate {
onClicked: ListView.view.model.select(index)
onDoubleClicked: {
ListView.view.model.select(index)
if (LRCInstance.currentAccountType === Profile.Type.SIP)
if (LRCInstance.currentAccountType === Profile.Type.SIP || !CurrentAccount.videoEnabled_Video)
CallAdapter.placeAudioOnlyCall()
else {
if (!CurrentConversation.readOnly) {
......
......@@ -66,6 +66,9 @@ ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
enabled: CurrentAccount.videoEnabled_Video
opacity: enabled ? 1.0 : 0.5
mediaType: MediaSettings.VIDEO
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment