mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-03 14:25:38 +02:00
multistream: accept only audio in incoming call
GitLab: #392 Change-Id: Ifcd29af849c11166158e7f8d39b65a33325b8d4a
This commit is contained in:
parent
a2858a883b
commit
7d0f4e00ff
8 changed files with 43 additions and 10 deletions
|
@ -295,6 +295,19 @@ CallAdapter::hangUpACall(const QString& accountId, const QString& convUid)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
CallAdapter::setCallMedia(const QString& accountId, const QString& convUid, bool video)
|
||||
{
|
||||
const auto& convInfo = lrcInstance_->getConversationFromConvUid(convUid, accountId);
|
||||
if (convInfo.uid.isEmpty())
|
||||
return;
|
||||
try {
|
||||
lrcInstance_->getAccountInfo(accountId).callModel->updateCallMediaList(convInfo.callId,
|
||||
video);
|
||||
} catch (...) {
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CallAdapter::acceptACall(const QString& accountId, const QString& convUid)
|
||||
{
|
||||
|
|
|
@ -51,6 +51,7 @@ public:
|
|||
Q_INVOKABLE void placeAudioOnlyCall();
|
||||
Q_INVOKABLE void placeCall();
|
||||
Q_INVOKABLE void hangUpACall(const QString& accountId, const QString& convUid);
|
||||
Q_INVOKABLE void setCallMedia(const QString& accountId, const QString& convUid, bool video);
|
||||
Q_INVOKABLE void acceptACall(const QString& accountId, const QString& convUid);
|
||||
|
||||
Q_INVOKABLE void connectCallModel(const QString& accountId);
|
||||
|
|
|
@ -28,6 +28,8 @@ Item {
|
|||
|
||||
// Misc
|
||||
property string accept: qsTr("Accept")
|
||||
property string acceptAudio: qsTr("Accept in audio")
|
||||
property string acceptVideo: qsTr("Accept in video")
|
||||
property string refuse: qsTr("Refuse")
|
||||
property string endCall: qsTr("End call")
|
||||
property string incomingAudioCallFrom: qsTr("Incoming audio call from {}")
|
||||
|
|
|
@ -197,7 +197,7 @@ Rectangle {
|
|||
CallAdapter.updateCall(convId, LRCInstance.currentAccountId)
|
||||
callStackView.showOngoingCallPage()
|
||||
} else {
|
||||
callStackView.showInitialCallPage(item.callState)
|
||||
callStackView.showInitialCallPage(item.callState, item.isAudioOnly)
|
||||
}
|
||||
pushCallStackView()
|
||||
|
||||
|
|
|
@ -56,6 +56,8 @@ Item {
|
|||
|
||||
ParticipantsLayer {
|
||||
id: __participantsLayer
|
||||
isAudioOnly: root.isAudioOnly
|
||||
isVideoMuted: root.isVideoMuted
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ Rectangle {
|
|||
})
|
||||
}
|
||||
|
||||
function showInitialCallPage(callState) {
|
||||
function showInitialCallPage(callState, isAudioOnly) {
|
||||
var itemToFind = getItemFromStack(CallStackView.InitialPageStack)
|
||||
if (!itemToFind) {
|
||||
callStackMainView.push(initialCallPage, StackView.Immediate)
|
||||
|
@ -96,6 +96,7 @@ Rectangle {
|
|||
}
|
||||
initialCallPage.accountConvPair = [responsibleAccountId, responsibleConvUid]
|
||||
initialCallPage.callStatus = callState
|
||||
initialCallPage.isAudioOnly = isAudioOnly
|
||||
if (initialCallPage.callStatus === Call.Status.INCOMING_RINGING)
|
||||
initialCallPage.isIncoming = true
|
||||
else
|
||||
|
|
|
@ -46,7 +46,8 @@ Rectangle {
|
|||
ListModel {
|
||||
id: incomingControlsModel
|
||||
ListElement { type: "refuse"; image: "qrc:/images/icons/round-close-24px.svg"}
|
||||
ListElement { type: "accept"; image: "qrc:/images/icons/check-24px.svg"}
|
||||
ListElement { type: "cam"; image: "qrc:/images/icons/videocam-24px.svg"}
|
||||
ListElement { type: "mic"; image: "qrc:/images/icons/place_audiocall-24px.svg"}
|
||||
}
|
||||
ListModel {
|
||||
id: outgoingControlsModel
|
||||
|
@ -130,6 +131,8 @@ Rectangle {
|
|||
model: root.isIncoming ? incomingControlsModel : outgoingControlsModel
|
||||
|
||||
delegate: ColumnLayout {
|
||||
visible: (type === "cam" && root.isAudioOnly) ? false : true;
|
||||
|
||||
PushButton {
|
||||
id: actionButton
|
||||
Layout.leftMargin: 10
|
||||
|
@ -139,17 +142,17 @@ Rectangle {
|
|||
implicitHeight: JamiTheme.callButtonPreferredSize
|
||||
|
||||
pressedColor: {
|
||||
if (type === "accept" )
|
||||
if ( type === "cam" || type === "mic")
|
||||
return JamiTheme.acceptGreen
|
||||
return JamiTheme.refuseRed
|
||||
}
|
||||
hoveredColor: {
|
||||
if (type === "accept" )
|
||||
if ( type === "cam" || type === "mic")
|
||||
return JamiTheme.acceptGreen
|
||||
return JamiTheme.refuseRed
|
||||
}
|
||||
normalColor: {
|
||||
if (type === "accept" )
|
||||
if ( type === "cam" || type === "mic")
|
||||
return JamiTheme.acceptGreenTransparency
|
||||
return JamiTheme.refuseRedTransparent
|
||||
}
|
||||
|
@ -158,10 +161,17 @@ Rectangle {
|
|||
imageColor: JamiTheme.whiteColor
|
||||
|
||||
onClicked: {
|
||||
if (type === "accept")
|
||||
if ( type === "cam" || type === "mic") {
|
||||
var acceptVideoMedia = true
|
||||
if (type === "cam")
|
||||
acceptVideoMedia = true
|
||||
else if ( type === "mic" )
|
||||
acceptVideoMedia = false
|
||||
CallAdapter.setCallMedia(responsibleAccountId, responsibleConvUid, acceptVideoMedia)
|
||||
callAccepted()
|
||||
else
|
||||
} else {
|
||||
callCanceled()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,8 +188,10 @@ Rectangle {
|
|||
text: {
|
||||
if (type === "refuse")
|
||||
return JamiStrings.refuse
|
||||
else if (type === "accept")
|
||||
return JamiStrings.accept
|
||||
else if (type === "cam")
|
||||
return JamiStrings.acceptVideo
|
||||
else if (type === "mic")
|
||||
return root.isAudioOnly ? JamiStrings.accept : JamiStrings.acceptAudio
|
||||
else if (type === "cancel")
|
||||
return JamiStrings.endCall
|
||||
return ""
|
||||
|
|
|
@ -22,6 +22,8 @@ import QtQml 2.14
|
|||
Item {
|
||||
id: root
|
||||
|
||||
property bool isAudioOnly
|
||||
property bool isVideoMuted
|
||||
property var participantOverlays: []
|
||||
property var participantComponent: Qt.createComponent("ParticipantOverlay.qml")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue