Commit 1982234f authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Calls/ConferenceManager): in progress

parent d7bd0229
......@@ -364,6 +364,13 @@ Server url not configured.</translation>
<translation>CONFERENCE</translation>
</message>
</context>
<context>
<name>ConferenceControls</name>
<message>
<source>conference</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ConferenceManager</name>
<message>
......
......@@ -364,6 +364,13 @@ Url du serveur non configurée.</translation>
<translation>CONFÉRENCE</translation>
</message>
</context>
<context>
<name>ConferenceControls</name>
<message>
<source>conference</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ConferenceManager</name>
<message>
......
......@@ -297,6 +297,7 @@
<file>ui/modules/Linphone/Calls/Calls.js</file>
<file>ui/modules/Linphone/Calls/Calls.qml</file>
<file>ui/modules/Linphone/Calls/CallStatistics.qml</file>
<file>ui/modules/Linphone/Calls/ConferenceControls.qml</file>
<file>ui/modules/Linphone/Chat/Chat.js</file>
<file>ui/modules/Linphone/Chat/Chat.qml</file>
<file>ui/modules/Linphone/Chat/Event.qml</file>
......
......@@ -27,7 +27,6 @@ Rectangle {
color: CallControlsStyle.color
height: CallControlsStyle.height
width: CallControlsStyle.width
MouseArea {
anchors.fill: parent
......@@ -70,11 +69,7 @@ Rectangle {
id: content
Layout.fillHeight: true
Component.onCompleted: Layout.preferredWidth = data[0].width
Layout.preferredWidth: callControls._content[0].width
}
}
// ---------------------------------------------------------------------------
}
......@@ -113,16 +113,14 @@ function setIndexWithCall (call) {
return
}
}
updateSelectedCall(call, -1)
}
// -----------------------------------------------------------------------------
// View handlers.
// -----------------------------------------------------------------------------
function handleSelectedCall (call) {
setIndexWithCall(call)
}
function handleCountChanged (count) {
if (count === 0) {
return
......@@ -144,7 +142,7 @@ function handleCountChanged (count) {
// -----------------------------------------------------------------------------
function handleCallRunning (call) {
updateSelectedCall(call)
setIndexWithCall(call)
}
function handleRowsAboutToBeRemoved (_, first, last) {
......
......@@ -26,7 +26,6 @@ ListView {
// ---------------------------------------------------------------------------
onCountChanged: Logic.handleCountChanged(count)
onSelectedCall: Logic.handleSelectedCall(call)
Connections {
target: model
......@@ -87,6 +86,14 @@ ListView {
}
}
// ---------------------------------------------------------------------------
// Conference.
// ---------------------------------------------------------------------------
header: ConferenceControls {
width: parent.width
}
// ---------------------------------------------------------------------------
// Calls.
// ---------------------------------------------------------------------------
......
import QtQuick 2.7
import QtQuick.Layouts 1.3
import Common 1.0
import Linphone 1.0
import Linphone.Styles 1.0
// =============================================================================
Rectangle {
id: callControls
// ---------------------------------------------------------------------------
property alias signIcon: signIcon.icon
property alias textColor: text.color
// ---------------------------------------------------------------------------
signal clicked
// ---------------------------------------------------------------------------
color: CallControlsStyle.color
height: CallControlsStyle.height
MouseArea {
anchors.fill: parent
onClicked: callControls.clicked()
}
Icon {
id: signIcon
anchors {
left: parent.left
top: parent.top
}
iconSize: CallControlsStyle.signSize
}
RowLayout {
anchors {
fill: parent
leftMargin: CallControlsStyle.leftMargin
rightMargin: CallControlsStyle.rightMargin
}
spacing: 0
Text {
id: text
Layout.fillHeight: true
Layout.fillWidth: true
text: qsTr('conference')
}
}
}
......@@ -11,5 +11,4 @@ QtObject {
property int leftMargin: 12
property int rightMargin: 12
property int signSize: 40
property int width: 240
}
......@@ -74,8 +74,8 @@ Rectangle {
var width = container.width
var size = height < CallStyle.container.avatar.maxSize && height > 0
? height
: CallStyle.container.avatar.maxSize
? height
: CallStyle.container.avatar.maxSize
return size < width ? size : width
}
......
......@@ -33,6 +33,37 @@ function handleClosing (close) {
close.accepted = false
}
// -----------------------------------------------------------------------------
function openConferenceManager () {
window.attachVirtualWindow(Qt.resolvedUrl('ConferenceManager.qml'))
}
// -----------------------------------------------------------------------------
function getContent () {
var call = window.call
if (call == null) {
return null
}
var status = call.status
if (status == null) {
return null
}
var CallModel = Linphone.CallModel
if (status === CallModel.CallStatusIncoming) {
return incomingCall
}
if (status === CallModel.CallStatusOutgoing) {
return outgoingCall
}
if (status === CallModel.CallStatusEnded) {
return endedCall
}
return incall
}
......@@ -18,7 +18,7 @@ Window {
// ---------------------------------------------------------------------------
// `{}` is a workaround to avoid `TypeError: Cannot read property...`.
property var call: calls.selectedCall || ({
readonly property var call: calls.selectedCall || ({
callError: '',
isOutgoing: true,
recording: false,
......@@ -187,31 +187,7 @@ Window {
childA: Loader {
anchors.fill: parent
sourceComponent: {
if (!window.call) {
return null
}
var status = window.call.status
if (status == null) {
return null
}
if (status === CallModel.CallStatusIncoming) {
return incomingCall
}
if (status === CallModel.CallStatusOutgoing) {
return outgoingCall
}
if (status === CallModel.CallStatusEnded) {
return endedCall
}
return incall
}
sourceComponent: Logic.getContent()
}
childB: Loader {
......
......@@ -11,6 +11,12 @@ import App.Styles 1.0
// =============================================================================
Rectangle {
id: conference
property var conferenceModel
// ---------------------------------------------------------------------------
color: CallStyle.backgroundColor
// ---------------------------------------------------------------------------
......@@ -71,13 +77,13 @@ Rectangle {
iconSize: CallStyle.header.iconSize
ActionSwitch {
enabled: conference.recording
enabled: conference.conferenceModel.recording
icon: 'record'
useStates: false
onClicked: !enabled
? conference.startRecording()
: conference.stopRecording()
? conference.conferenceModel.startRecording()
: conference.conferenceModel.stopRecording()
}
}
}
......@@ -101,9 +107,7 @@ Rectangle {
cellHeight: ConferenceStyle.grid.cell.height
cellWidth: ConferenceStyle.grid.cell.width
model: ConferenceModel {
id: conference
}
model: conference.conferenceModel
delegate: Item {
height: grid.cellHeight
......@@ -187,7 +191,7 @@ Rectangle {
ActionButton {
icon: 'hangup'
onClicked: conference.terminate()
onClicked: conference.conferenceModel.terminate()
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment