From d9fcdf6af6e306da8b97ace354dea982698dd070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABlle=20Braud?= Date: Thu, 27 Feb 2025 18:02:34 +0000 Subject: [PATCH] fix call proxy connect already connected to call list model when model changes... --- Linphone/core/call/CallProxy.cpp | 2 - Linphone/view/Page/Main/Call/CallPage.qml | 158 +++++++++--------- .../view/Page/Window/Call/CallsWindow.qml | 2 +- 3 files changed, 80 insertions(+), 82 deletions(-) diff --git a/Linphone/core/call/CallProxy.cpp b/Linphone/core/call/CallProxy.cpp index 6f9a5b238..a6db32f38 100644 --- a/Linphone/core/call/CallProxy.cpp +++ b/Linphone/core/call/CallProxy.cpp @@ -26,8 +26,6 @@ DEFINE_ABSTRACT_OBJECT(CallProxy) CallProxy::CallProxy(QObject *parent) : LimitProxy(parent) { - connect(this, &CallProxy::sourceModelChanged, this, &CallProxy::resetCurrentCall); - connect(this, &CallProxy::sourceModelChanged, this, &CallProxy::haveCallChanged); } CallProxy::~CallProxy() { diff --git a/Linphone/view/Page/Main/Call/CallPage.qml b/Linphone/view/Page/Main/Call/CallPage.qml index e1ba8c623..67467ca8f 100644 --- a/Linphone/view/Page/Main/Call/CallPage.qml +++ b/Linphone/view/Page/Main/Call/CallPage.qml @@ -486,8 +486,8 @@ ConferenceInfoGui{ Component { id: contactDetailComp FocusScope { - width: parent?.width - height: parent?.height + // width: parent?.width + // height: parent?.height CallHistoryLayout { id: contactDetail anchors.fill: parent @@ -605,102 +605,102 @@ ConferenceInfoGui{ } } } - detailContent: RoundedPane { - id: detailControl + detailContent: Item { Layout.preferredWidth: 360 * DefaultStyle.dp Layout.fillHeight: true - - // height: Math.min(430 * DefaultStyle.dp, detailListView.contentHeight) + topPadding + bottomPadding - background: Rectangle { - id: detailListBackground - anchors.fill: parent - color: DefaultStyle.grey_0 - radius: 15 * DefaultStyle.dp - } - - contentItem: CallHistoryListView { - id: detailListView - Layout.fillWidth: true - Layout.fillHeight: true - spacing: 14 * DefaultStyle.dp - clip: true - searchText: mainItem.selectedRowHistoryGui ? mainItem.selectedRowHistoryGui.core.remoteAddress : "" - busyIndicatorSize: 40 * DefaultStyle.dp - - BusyIndicator { - anchors.horizontalCenter: detailListView.horizontalCenter - visible: detailListView.loading - && detailListView.count === 0 - height: visible ? detailListView.busyIndicatorSize : 0 - width: detailListView.busyIndicatorSize - indicatorHeight: detailListView.busyIndicatorSize - indicatorWidth: detailListView.busyIndicatorSize - indicatorColor: DefaultStyle.main1_500_main + RoundedPane { + id: detailControl + width: parent.width + height: Math.min( + parent.height, + detailListView.contentHeight) + topPadding + bottomPadding + background: Rectangle { + id: detailListBackground + anchors.fill: parent + color: DefaultStyle.grey_0 + radius: 15 * DefaultStyle.dp } - delegate: Item { - width: detailListView.width - height: 56 * DefaultStyle.dp - RowLayout { - anchors.fill: parent - anchors.leftMargin: 20 * DefaultStyle.dp - anchors.rightMargin: 20 * DefaultStyle.dp - anchors.verticalCenter: parent.verticalCenter - ColumnLayout { - Layout.alignment: Qt.AlignVCenter - RowLayout { - EffectImage { - id: statusIcon - imageSource: modelData.core.status - === LinphoneEnums.CallStatus.Declined - || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere - || modelData.core.status - === LinphoneEnums.CallStatus.Aborted - || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted ? AppIcons.arrowElbow : modelData.core.isOutgoing ? AppIcons.arrowUpRight : AppIcons.arrowDownLeft - colorizationColor: modelData.core.status === LinphoneEnums.CallStatus.Declined || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere || modelData.core.status === LinphoneEnums.CallStatus.Aborted || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted || modelData.core.status === LinphoneEnums.CallStatus.Missed ? DefaultStyle.danger_500main : modelData.core.isOutgoing ? DefaultStyle.info_500_main : DefaultStyle.success_500main - Layout.preferredWidth: 16 * DefaultStyle.dp - Layout.preferredHeight: 16 * DefaultStyle.dp - transform: Rotation { - angle: modelData.core.isOutgoing - && (modelData.core.status - === LinphoneEnums.CallStatus.Declined - || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere || modelData.core.status === LinphoneEnums.CallStatus.Aborted || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted) ? 180 : 0 - origin { - x: statusIcon.width / 2 - y: statusIcon.height / 2 + contentItem: CallHistoryListView { + id: detailListView + Layout.fillWidth: true + Layout.fillHeight: true + spacing: 14 * DefaultStyle.dp + clip: true + searchText: mainItem.selectedRowHistoryGui ? mainItem.selectedRowHistoryGui.core.remoteAddress : "" + busyIndicatorSize: 40 * DefaultStyle.dp + + BusyIndicator { + anchors.horizontalCenter: detailListView.horizontalCenter + visible: detailListView.loading + && detailListView.count === 0 + height: visible ? detailListView.busyIndicatorSize : 0 + width: detailListView.busyIndicatorSize + indicatorHeight: detailListView.busyIndicatorSize + indicatorWidth: detailListView.busyIndicatorSize + indicatorColor: DefaultStyle.main1_500_main + } + + delegate: Item { + width: detailListView.width + height: 56 * DefaultStyle.dp + RowLayout { + anchors.fill: parent + anchors.leftMargin: 20 * DefaultStyle.dp + anchors.rightMargin: 20 * DefaultStyle.dp + anchors.verticalCenter: parent.verticalCenter + ColumnLayout { + Layout.alignment: Qt.AlignVCenter + RowLayout { + EffectImage { + id: statusIcon + imageSource: modelData.core.status + === LinphoneEnums.CallStatus.Declined + || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere || modelData.core.status === LinphoneEnums.CallStatus.Aborted || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted ? AppIcons.arrowElbow : modelData.core.isOutgoing ? AppIcons.arrowUpRight : AppIcons.arrowDownLeft + colorizationColor: modelData.core.status === LinphoneEnums.CallStatus.Declined || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere || modelData.core.status === LinphoneEnums.CallStatus.Aborted || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted || modelData.core.status === LinphoneEnums.CallStatus.Missed ? DefaultStyle.danger_500main : modelData.core.isOutgoing ? DefaultStyle.info_500_main : DefaultStyle.success_500main + Layout.preferredWidth: 16 * DefaultStyle.dp + Layout.preferredHeight: 16 * DefaultStyle.dp + transform: Rotation { + angle: modelData.core.isOutgoing + && (modelData.core.status === LinphoneEnums.CallStatus.Declined || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere || modelData.core.status === LinphoneEnums.CallStatus.Aborted || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted) ? 180 : 0 + origin { + x: statusIcon.width / 2 + y: statusIcon.height / 2 + } + } + } + Text { + text: modelData.core.status === LinphoneEnums.CallStatus.Missed ? qsTr("Appel manqué") : modelData.core.isOutgoing ? qsTr("Appel sortant") : qsTr("Appel entrant") + font { + pixelSize: 14 * DefaultStyle.dp + weight: 400 * DefaultStyle.dp } } } Text { - text: modelData.core.status === LinphoneEnums.CallStatus.Missed ? qsTr("Appel manqué") : modelData.core.isOutgoing ? qsTr("Appel sortant") : qsTr("Appel entrant") + text: UtilsCpp.formatDate( + modelData.core.date) + color: modelData.core.status === LinphoneEnums.CallStatus.Missed ? DefaultStyle.danger_500main : DefaultStyle.main2_500main font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: 12 * DefaultStyle.dp + weight: 300 * DefaultStyle.dp } } } + Item { + Layout.fillHeight: true + Layout.fillWidth: true + } Text { - text: UtilsCpp.formatDate( - modelData.core.date) - color: modelData.core.status === LinphoneEnums.CallStatus.Missed ? DefaultStyle.danger_500main : DefaultStyle.main2_500main + text: UtilsCpp.formatElapsedTime( + modelData.core.duration, + false) font { pixelSize: 12 * DefaultStyle.dp weight: 300 * DefaultStyle.dp } } } - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } - Text { - text: UtilsCpp.formatElapsedTime( - modelData.core.duration, false) - font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp - } - } } } } diff --git a/Linphone/view/Page/Window/Call/CallsWindow.qml b/Linphone/view/Page/Window/Call/CallsWindow.qml index 847396666..ea16c66fc 100644 --- a/Linphone/view/Page/Window/Call/CallsWindow.qml +++ b/Linphone/view/Page/Window/Call/CallsWindow.qml @@ -104,7 +104,7 @@ AbstractWindow { // mainWin.goToCallHistory() } function callEnded(call) { - if (call.core.state === LinphoneEnums.CallState.Error) { + if (call && call.core.state === LinphoneEnums.CallState.Error) { middleItemStackView.replace(inCallItem) } if (!callsModel.haveCall) {