Commit 41c388e6 authored by Ronan Abhamon's avatar Ronan Abhamon

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

parent 67e51fa5
...@@ -60,8 +60,8 @@ if(NOT WIN32) ...@@ -60,8 +60,8 @@ if(NOT WIN32)
set(CUSTOM_FLAGS "${CUSTOM_FLAGS} -Wsuggest-override -Werror=suggest-override") set(CUSTOM_FLAGS "${CUSTOM_FLAGS} -Wsuggest-override -Werror=suggest-override")
endif() endif()
endif() endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS} -DNDEBUG -DQT_NO_DEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG")
# See: http://stackoverflow.com/a/1372836 # See: http://stackoverflow.com/a/1372836
if(WIN32) if(WIN32)
......
...@@ -90,33 +90,61 @@ function getParams (call) { ...@@ -90,33 +90,61 @@ function getParams (call) {
} }
} }
// -----------------------------------------------------------------------------
// Helpers.
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
function handleCallRunning (index, call) { function updateSelectedCall (call, index) {
calls.currentIndex = index
calls._selectedCall = call calls._selectedCall = call
if (index != null) {
calls.currentIndex = index
}
} }
function handleCountChanged (count) { function resetSelectedCall () {
if (count === 0) { updateSelectedCall(null, -1)
return 0 }
function setIndexWithCall (call) {
var count = calls.count
for (var i = 0; i < count; i++) {
if (call === model.data(model.index(i, 0))) {
updateSelectedCall(call, i)
return
} }
}
}
var index = calls.currentIndex // -----------------------------------------------------------------------------
if (index !== -1) { // View handlers.
// -----------------------------------------------------------------------------
function handleSelectedCall (call) {
setIndexWithCall(call)
}
function handleCountChanged (count) {
if (count === 0) {
return return
} }
var model = calls.model var call = calls._selectedCall
index = count - 1
calls.currentIndex = index if (call == null) {
calls._selectedCall = model.data(model.index(index, 0)) var model = calls.model
var index = count - 1
updateSelectedCall(model.data(model.index(index, 0)), index)
} else {
setIndexWithCall(call)
}
} }
function resetSelectedCall () { // -----------------------------------------------------------------------------
calls.currentIndex = -1 // Model handlers.
calls._selectedCall = null // -----------------------------------------------------------------------------
function handleCallRunning (call) {
updateSelectedCall(call)
} }
function handleRowsAboutToBeRemoved (_, first, last) { function handleRowsAboutToBeRemoved (_, first, last) {
...@@ -134,13 +162,13 @@ function handleRowsInserted (_, first, last) { ...@@ -134,13 +162,13 @@ function handleRowsInserted (_, first, last) {
var call = model.data(model.index(index, 0)) var call = model.data(model.index(index, 0))
if (call.isOutgoing) { if (call.isOutgoing) {
resetSelectedCall() updateSelectedCall(call)
return return
} }
} }
// First received call. // First received call.
if (first === 0 && model.rowCount() === 1) { if (first === 0 && model.rowCount() === 1) {
resetSelectedCall() updateSelectedCall(model.data(model.index(0, 0)))
} }
} }
...@@ -26,11 +26,12 @@ ListView { ...@@ -26,11 +26,12 @@ ListView {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
onCountChanged: Logic.handleCountChanged(count) onCountChanged: Logic.handleCountChanged(count)
onSelectedCall: Logic.handleSelectedCall(call)
Connections { Connections {
target: model target: model
onCallRunning: Logic.handleCallRunning(index, callModel) onCallRunning: Logic.handleCallRunning(callModel)
onRowsAboutToBeRemoved: Logic.handleRowsAboutToBeRemoved(parent, first, last) onRowsAboutToBeRemoved: Logic.handleRowsAboutToBeRemoved(parent, first, last)
onRowsInserted: Logic.handleRowsInserted(parent, first, last) onRowsInserted: Logic.handleRowsInserted(parent, first, last)
} }
...@@ -86,6 +87,8 @@ ListView { ...@@ -86,6 +87,8 @@ ListView {
} }
} }
// ---------------------------------------------------------------------------
// Calls.
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
delegate: CallControls { delegate: CallControls {
...@@ -119,8 +122,7 @@ ListView { ...@@ -119,8 +122,7 @@ ListView {
onClicked: { onClicked: {
if ($call.status !== CallModel.CallStatusEnded) { if ($call.status !== CallModel.CallStatusEnded) {
_selectedCall = $call Logic.updateSelectedCall($call, index)
calls.currentIndex = index
} }
} }
......
...@@ -31,6 +31,9 @@ RowLayout { ...@@ -31,6 +31,9 @@ RowLayout {
} }
var previousEntry = proxyModel.data(proxyModel.index(index - 1, 0)) var previousEntry = proxyModel.data(proxyModel.index(index - 1, 0))
if (!previousEntry) {
return true
}
// 2. Previous entry is a call event. => Visible. // 2. Previous entry is a call event. => Visible.
// 3. I have sent a message before my contact. => Visible. // 3. I have sent a message before my contact. => Visible.
......
...@@ -23,6 +23,7 @@ Window { ...@@ -23,6 +23,7 @@ Window {
isOutgoing: true, isOutgoing: true,
recording: false, recording: false,
sipAddress: '', sipAddress: '',
type: false,
updating: true, updating: true,
videoEnabled: false videoEnabled: false
}) })
......
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