While pausing in call, pause view is in center and hide preview in active speaking.

Hide calls view in waiting room.
Avoid closing calls window if we are in the waiting room.
After cancelling the join of a conference, come back to the last call view (or the top of the list if last is not connected).
This commit is contained in:
Julien Wadel 2022-08-19 14:49:58 +02:00
parent ddc4143885
commit b648fc03be
8 changed files with 57 additions and 16 deletions

View file

@ -157,7 +157,7 @@ function getParams (call) {
} }
function updateSelectedCall (call, index) { function updateSelectedCall (call, index) {
calls._selectedCall = call calls._selectedCall = call ? call : null
if (index != null) { if (index != null) {
calls.currentIndex = index calls.currentIndex = index
} }

View file

@ -20,6 +20,8 @@ ListView {
property CallModel _selectedCall: null property CallModel _selectedCall: null
property var lastCall
onSelectedCallChanged: if( selectedCall) lastCall = selectedCall
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
@ -27,7 +29,17 @@ ListView {
spacing: 0 spacing: 0
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
function refreshCall(){
Logic.resetSelectedCall()
}
function refreshLastCall(){
if(lastCall && lastCall.status === CallModel.CallStatusConnected)
Logic.setIndexWithCall(lastCall)
else{
var call = model.data(model.index(0, 0))
Logic.updateSelectedCall(model.data(model.index(0, 0)))
}
}
onCountChanged: Logic.handleCountChanged(count) onCountChanged: Logic.handleCountChanged(count)
Connections { Connections {

View file

@ -58,6 +58,7 @@ function openConferenceManager (params, exitHandler) {
} }
function openWaitingRoom(model){ function openWaitingRoom(model){
calls.refreshCall()
if(window.conferenceInfoModel) if(window.conferenceInfoModel)
window.conferenceInfoModel = null; window.conferenceInfoModel = null;
window.conferenceInfoModel = model window.conferenceInfoModel = model
@ -68,18 +69,24 @@ function openWaitingRoom(model){
function getContent (call, conferenceInfoModel) { function getContent (call, conferenceInfoModel) {
console.log("Changing contents") console.log("Changing contents")
if (call == null) { if (call == null) {
if(conferenceInfoModel) if(conferenceInfoModel) {
console.log("waitingRoom")
return waitingRoom return waitingRoom
else }
else{
console.log("null")
return null return null
}
} }
var status = call.status var status = call.status
if (status == null) { if (status == null) {
console.log(calls.conferenceModel.count > 0 ? "conference" : "null")
return calls.conferenceModel.count > 0 ? conference : null return calls.conferenceModel.count > 0 ? conference : null
} }
var CallModel = Linphone.CallModel var CallModel = Linphone.CallModel
if (status === CallModel.CallStatusIncoming) { if (status === CallModel.CallStatusIncoming) {
console.log("incomingCall")
return incomingCall return incomingCall
} }
window.conferenceInfoModel = call.conferenceInfoModel; window.conferenceInfoModel = call.conferenceInfoModel;
@ -88,9 +95,12 @@ function getContent (call, conferenceInfoModel) {
return waitingRoom return waitingRoom
} }
if(call.isConference) if(call.isConference){
console.log("incall")
return incall return incall
}
console.log("incall")
return incall return incall
} }
@ -131,7 +141,7 @@ function handleCallAttendedTransferAsked (call) {
} }
function windowMustBeClosed () { function windowMustBeClosed () {
return Linphone.CallsListModel.rowCount() === 0 && !window.virtualWindowVisible return Linphone.CallsListModel.rowCount() === 0 && !window.virtualWindowVisible && middlePane.sourceComponent != waitingRoom
} }
function tryToCloseWindow () { function tryToCloseWindow () {

View file

@ -52,8 +52,10 @@ Window {
function endOfProcess(exitValue){ function endOfProcess(exitValue){
window.detachVirtualWindow(); window.detachVirtualWindow();
if(exitValue == 0 && calls.count == 0) if(exitValue == 0 && calls.count == 0 && middlePane.sourceComponent != waitingRoom) {
console.log("Closing")
close(); close();
}
} }
function openConferenceManager (params) { function openConferenceManager (params) {
@ -85,7 +87,7 @@ Window {
maximumLeftLimit: CallsWindowStyle.callsList.maximumWidth maximumLeftLimit: CallsWindowStyle.callsList.maximumWidth
minimumLeftLimit: CallsWindowStyle.callsList.minimumWidth minimumLeftLimit: CallsWindowStyle.callsList.minimumWidth
hideSplitter: !window.callsIsOpened && middlePane.sourceComponent == incall hideSplitter: !window.callsIsOpened && middlePane.sourceComponent == incall || middlePane.sourceComponent == waitingRoom
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Calls list. // Calls list.
@ -235,7 +237,11 @@ Window {
id: waitingRoom id: waitingRoom
WaitingRoom{ WaitingRoom{
conferenceInfoModel: window.conferenceInfoModel conferenceInfoModel: window.conferenceInfoModel
onCancel: endOfProcess(0) onCancel: {
endOfProcess(0)
window.conferenceInfoModel = null
calls.refreshLastCall()
}
enabled: window.visible enabled: window.visible
callModel: window.call callModel: window.call
} }
@ -260,6 +266,8 @@ Window {
if( sourceComponent == waitingRoom) if( sourceComponent == waitingRoom)
mainPaned.close() mainPaned.close()
rightPaned.childAItem.update() rightPaned.childAItem.update()
if(!sourceComponent && calls.count == 0)
window.close()
}// Force update when loading a new Content. It's just to be sure }// Force update when loading a new Content. It's just to be sure
active: window.call || window.conferenceInfoModel active: window.call || window.conferenceInfoModel
} }

View file

@ -77,6 +77,7 @@ Rectangle {
color: IncallStyle.pauseArea.title.color color: IncallStyle.pauseArea.title.color
} }
Text{ Text{
Layout.topMargin: 10
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
//: 'Click on play button to join it back.' : Explain what to do when being in pause in conference. //: 'Click on play button to join it back.' : Explain what to do when being in pause in conference.
text: qsTr('incallPauseHint') text: qsTr('incallPauseHint')
@ -86,7 +87,7 @@ Rectangle {
} }
Item{ Item{
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 140 Layout.fillHeight: true
} }
} }
} }

View file

@ -27,15 +27,24 @@ Item {
property bool cameraEnabled: true property bool cameraEnabled: true
property alias showMe : allDevices.showMe property alias showMe : allDevices.showMe
property int participantCount: callModel.isConference ? allDevices.count : 2 property int participantCount: callModel.isConference ? allDevices.count : 2
onParticipantCountChanged: {console.log("Conf count: " +participantCount);allDevices.updateCurrentDevice()} onParticipantCountChanged: {console.log("Conf count: " +participantCount);allDevices.updateCurrentDevice()}
property ParticipantDeviceProxyModel participantDevices : ParticipantDeviceProxyModel { property ParticipantDeviceProxyModel participantDevices : ParticipantDeviceProxyModel {
id: allDevices id: allDevices
callModel: mainItem.callModel callModel: mainItem.callModel
showMe: true showMe: true
function updateShowMe(){
showMe = cameraEnabled && !isPausedByUser
}
onParticipantSpeaking: updateCurrentDevice() onParticipantSpeaking: updateCurrentDevice()
// Do it on changed to ignore hard bindings (that can be override)
property bool cameraEnabled: callModel && callModel.cameraEnabled property bool cameraEnabled: callModel && callModel.cameraEnabled
onCameraEnabledChanged: showMe = cameraEnabled // Do it on changed to ignore hard bindings (that can be override) onCameraEnabledChanged:updateShowMe()
property bool isPausedByUser: callModel && callModel.pausedByUser
onIsPausedByUserChanged: updateShowMe()
//-----
onConferenceCreated: cameraView.resetCamera() onConferenceCreated: cameraView.resetCamera()
function updateCurrentDevice(){ function updateCurrentDevice(){
var device = getLastActiveSpeaking() var device = getLastActiveSpeaking()
@ -81,7 +90,7 @@ Item {
width: 16 * cellHeight / 9 width: 16 * cellHeight / 9
model: mainItem.callModel.isConference model: mainItem.callModel.isConference
? mainItem.participantDevices ? mainItem.participantDevices
: mainItem.callModel.videoEnabled : mainItem.callModel.videoEnabled && !callModel.pausedByUser
? [{videoEnabled:true, isPreview:true}] ? [{videoEnabled:true, isPreview:true}]
: [] : []
onModelChanged: console.log( mainItem.callModel.isConference+"/"+mainItem.callModel.videoEnabled + "/" +mainItem.callModel.cameraEnabled + " / " +count) onModelChanged: console.log( mainItem.callModel.isConference+"/"+mainItem.callModel.videoEnabled + "/" +mainItem.callModel.cameraEnabled + " / " +count)

View file

@ -115,6 +115,7 @@ Window {
color: IncallStyle.pauseArea.title.color color: IncallStyle.pauseArea.title.color
} }
Text{ Text{
Layout.topMargin: 10
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
//: 'Click on play button to join it back.' : Explain what to do when being in pause in conference. //: 'Click on play button to join it back.' : Explain what to do when being in pause in conference.
text: qsTr('incallPauseHint') text: qsTr('incallPauseHint')
@ -124,7 +125,7 @@ Window {
} }
Item{ Item{
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 140 Layout.fillHeight: true
} }
} }
} }

View file

@ -46,7 +46,7 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
ColumnLayout{ ColumnLayout{
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.bottomMargin: (mainItem.conferenceInfoModel && mainItem.callModel ? 10 : 40) Layout.bottomMargin: (mainItem.conferenceInfoModel && mainItem.callModel ? 10 : 30)
spacing: 10 spacing: 10
BusyIndicator { BusyIndicator {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
@ -95,7 +95,7 @@ Rectangle {
} }
Text{ Text{
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.topMargin: mainItem.callModel ? 0 : 50 Layout.topMargin: mainItem.callModel ? 0 : 40
text: mainItem.conferenceInfoModel ? mainItem.conferenceInfoModel.subject text: mainItem.conferenceInfoModel ? mainItem.conferenceInfoModel.subject
: (mainItem._sipAddressObserver ? UtilsCpp.getDisplayName(mainItem._sipAddressObserver.peerAddress) : '') : (mainItem._sipAddressObserver ? UtilsCpp.getDisplayName(mainItem._sipAddressObserver.peerAddress) : '')
color: WaitingRoomStyle.title.color color: WaitingRoomStyle.title.color