mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-13 12:05:22 +02:00
callpages: consume currentconversation observables
Change-Id: Ib8a1cf6fe3ba90c973c89e4806cfd3d6da1aa390
This commit is contained in:
parent
2ee3ec078b
commit
9d6fe53f40
2 changed files with 12 additions and 18 deletions
|
@ -93,7 +93,6 @@ Rectangle {
|
|||
} else {
|
||||
callStackMainView.pop(itemToFind, StackView.Immediate)
|
||||
}
|
||||
initialCallPage.accountConvPair = [responsibleAccountId, responsibleConvUid]
|
||||
initialCallPage.callStatus = callState
|
||||
initialCallPage.isAudioOnly = isAudioOnly
|
||||
if (initialCallPage.callStatus === Call.Status.INCOMING_RINGING)
|
||||
|
|
|
@ -34,9 +34,7 @@ Rectangle {
|
|||
|
||||
property bool isIncoming: false
|
||||
property bool isAudioOnly: false
|
||||
property var accountConvPair: ["", ""]
|
||||
property int callStatus: 0
|
||||
property string bestName: ""
|
||||
|
||||
signal callCanceled
|
||||
signal callAccepted
|
||||
|
@ -58,13 +56,6 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
onAccountConvPairChanged: {
|
||||
if (accountConvPair[1]) {
|
||||
contactImg.imageId = accountConvPair[1]
|
||||
root.bestName = UtilsAdapter.getBestName(accountConvPair[0], accountConvPair[1])
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent right click propagate to VideoCallPage.
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
@ -78,14 +69,13 @@ Rectangle {
|
|||
anchors.verticalCenter: root.verticalCenter
|
||||
|
||||
ConversationAvatar {
|
||||
id: contactImg
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.preferredWidth: JamiTheme.avatarSizeInCall
|
||||
Layout.preferredHeight: JamiTheme.avatarSizeInCall
|
||||
|
||||
showPresenceIndicator: false
|
||||
animationMode: SpinningAnimation.Mode.Radial
|
||||
imageId: CurrentConversation.id
|
||||
}
|
||||
|
||||
Text {
|
||||
|
@ -98,11 +88,15 @@ Rectangle {
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
property string title: CurrentConversation.title
|
||||
|
||||
text: {
|
||||
if (root.isIncoming)
|
||||
return root.isAudioOnly ? JamiStrings.incomingAudioCallFrom.replace("{}", root.bestName) : JamiStrings.incomingVideoCallFrom.replace("{}", root.bestName)
|
||||
return root.isAudioOnly ?
|
||||
JamiStrings.incomingAudioCallFrom.replace("{}", title) :
|
||||
JamiStrings.incomingVideoCallFrom.replace("{}", title)
|
||||
else
|
||||
return root.bestName
|
||||
return title
|
||||
}
|
||||
wrapMode: Text.WordWrap
|
||||
elide: Text.ElideRight
|
||||
|
@ -188,6 +182,7 @@ Rectangle {
|
|||
font.kerning: true
|
||||
color: actionButton.hovered ? JamiTheme.whiteColor : JamiTheme.whiteColorTransparent
|
||||
|
||||
|
||||
text: {
|
||||
if (type === "refuse")
|
||||
return JamiStrings.refuse
|
||||
|
@ -212,16 +207,16 @@ Rectangle {
|
|||
Shortcut {
|
||||
sequence: "Ctrl+Y"
|
||||
context: Qt.ApplicationShortcut
|
||||
onActivated: CallAdapter.acceptACall(root.accountConvPair[0],
|
||||
root.accountConvPair[1])
|
||||
onActivated: CallAdapter.acceptACall(CurrentAccount.id,
|
||||
CurrentConversation.id)
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
sequence: "Ctrl+Shift+D"
|
||||
context: Qt.ApplicationShortcut
|
||||
onActivated: {
|
||||
CallAdapter.hangUpACall(root.accountConvPair[0],
|
||||
root.accountConvPair[1])
|
||||
CallAdapter.hangUpACall(CurrentAccount.id,
|
||||
CurrentConversation.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue