Skip to content
Snippets Groups Projects
Commit 9d6fe53f authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Sébastien Blin
Browse files

callpages: consume currentconversation observables

Change-Id: Ib8a1cf6fe3ba90c973c89e4806cfd3d6da1aa390
parent 2ee3ec07
No related branches found
No related tags found
No related merge requests found
...@@ -93,7 +93,6 @@ Rectangle { ...@@ -93,7 +93,6 @@ Rectangle {
} else { } else {
callStackMainView.pop(itemToFind, StackView.Immediate) callStackMainView.pop(itemToFind, StackView.Immediate)
} }
initialCallPage.accountConvPair = [responsibleAccountId, responsibleConvUid]
initialCallPage.callStatus = callState initialCallPage.callStatus = callState
initialCallPage.isAudioOnly = isAudioOnly initialCallPage.isAudioOnly = isAudioOnly
if (initialCallPage.callStatus === Call.Status.INCOMING_RINGING) if (initialCallPage.callStatus === Call.Status.INCOMING_RINGING)
......
...@@ -34,9 +34,7 @@ Rectangle { ...@@ -34,9 +34,7 @@ Rectangle {
property bool isIncoming: false property bool isIncoming: false
property bool isAudioOnly: false property bool isAudioOnly: false
property var accountConvPair: ["", ""]
property int callStatus: 0 property int callStatus: 0
property string bestName: ""
signal callCanceled signal callCanceled
signal callAccepted signal callAccepted
...@@ -58,13 +56,6 @@ Rectangle { ...@@ -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. // Prevent right click propagate to VideoCallPage.
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
...@@ -78,14 +69,13 @@ Rectangle { ...@@ -78,14 +69,13 @@ Rectangle {
anchors.verticalCenter: root.verticalCenter anchors.verticalCenter: root.verticalCenter
ConversationAvatar { ConversationAvatar {
id: contactImg
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.avatarSizeInCall Layout.preferredWidth: JamiTheme.avatarSizeInCall
Layout.preferredHeight: JamiTheme.avatarSizeInCall Layout.preferredHeight: JamiTheme.avatarSizeInCall
showPresenceIndicator: false showPresenceIndicator: false
animationMode: SpinningAnimation.Mode.Radial animationMode: SpinningAnimation.Mode.Radial
imageId: CurrentConversation.id
} }
Text { Text {
...@@ -98,11 +88,15 @@ Rectangle { ...@@ -98,11 +88,15 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
property string title: CurrentConversation.title
text: { text: {
if (root.isIncoming) 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 else
return root.bestName return title
} }
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
elide: Text.ElideRight elide: Text.ElideRight
...@@ -188,6 +182,7 @@ Rectangle { ...@@ -188,6 +182,7 @@ Rectangle {
font.kerning: true font.kerning: true
color: actionButton.hovered ? JamiTheme.whiteColor : JamiTheme.whiteColorTransparent color: actionButton.hovered ? JamiTheme.whiteColor : JamiTheme.whiteColorTransparent
text: { text: {
if (type === "refuse") if (type === "refuse")
return JamiStrings.refuse return JamiStrings.refuse
...@@ -212,16 +207,16 @@ Rectangle { ...@@ -212,16 +207,16 @@ Rectangle {
Shortcut { Shortcut {
sequence: "Ctrl+Y" sequence: "Ctrl+Y"
context: Qt.ApplicationShortcut context: Qt.ApplicationShortcut
onActivated: CallAdapter.acceptACall(root.accountConvPair[0], onActivated: CallAdapter.acceptACall(CurrentAccount.id,
root.accountConvPair[1]) CurrentConversation.id)
} }
Shortcut { Shortcut {
sequence: "Ctrl+Shift+D" sequence: "Ctrl+Shift+D"
context: Qt.ApplicationShortcut context: Qt.ApplicationShortcut
onActivated: { onActivated: {
CallAdapter.hangUpACall(root.accountConvPair[0], CallAdapter.hangUpACall(CurrentAccount.id,
root.accountConvPair[1]) CurrentConversation.id)
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment