Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
9d8b2632
Commit
9d8b2632
authored
Apr 27, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ui/modules/Linphone/Calls/Calls): handle calls correctly
parent
63e4132d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
32 deletions
+27
-32
Calls.js
linphone-desktop/ui/modules/Linphone/Calls/Calls.js
+19
-27
Calls.qml
linphone-desktop/ui/modules/Linphone/Calls/Calls.qml
+6
-3
Timeline.js
linphone-desktop/ui/modules/Linphone/Timeline/Timeline.js
+1
-1
Timeline.qml
linphone-desktop/ui/modules/Linphone/Timeline/Timeline.qml
+1
-1
No files found.
linphone-desktop/ui/modules/Linphone/Calls/Calls.js
View file @
9d8b2632
...
...
@@ -97,39 +97,29 @@ function handleCallRunning (index, call) {
calls
.
_selectedCall
=
call
}
function
handleRowsAboutToBeRemoved
(
_
,
first
,
last
)
{
function
handleCountChanged
(
count
)
{
if
(
count
===
0
)
{
return
0
}
var
index
=
calls
.
currentIndex
if
(
index
!==
-
1
)
{
return
}
if
(
index
>=
first
&&
index
<=
last
)
{
// Remove current call.
var
model
=
calls
.
model
var
model
=
calls
.
model
index
=
count
-
1
if
(
model
.
rowCount
()
-
(
last
-
first
+
1
)
<=
0
)
{
calls
.
_selectedCall
=
null
}
else
{
if
(
first
===
0
)
{
calls
.
_selectedCall
=
model
.
data
(
model
.
index
(
last
+
1
,
0
))
}
else
{
calls
.
_selectedCall
=
model
.
data
(
model
.
index
(
0
,
0
))
}
}
}
calls
.
currentIndex
=
index
calls
.
_selectedCall
=
model
.
data
(
model
.
index
(
index
,
0
))
}
function
handleRowsRemoved
(
_
,
first
,
last
)
{
function
handleRows
AboutToBe
Removed
(
_
,
first
,
last
)
{
var
index
=
calls
.
currentIndex
// The current call has been removed.
if
(
index
>=
first
&&
index
<=
last
)
{
if
(
calls
.
model
.
rowCount
()
===
0
)
{
calls
.
currentIndex
=
-
1
// No calls.
}
else
{
calls
.
currentIndex
=
0
// The first call becomes the selected call.
}
}
// Update the current index of the selected call if it was after the removed calls.
else
if
(
last
<
index
)
{
calls
.
currentIndex
=
index
-
(
last
-
first
+
1
)
calls
.
currentIndex
=
-
1
calls
.
_selectedCall
=
null
}
}
...
...
@@ -141,8 +131,10 @@ function handleRowsInserted (_, first, last) {
var
call
=
model
.
data
(
model
.
index
(
index
,
0
))
if
(
call
.
isOutgoing
)
{
calls
.
currentIndex
=
first
calls
.
_selectedCall
=
model
.
data
(
model
.
index
(
first
,
0
))
calls
.
currentIndex
=
-
1
calls
.
_selectedCall
=
null
return
}
}
}
linphone-desktop/ui/modules/Linphone/Calls/Calls.qml
View file @
9d8b2632
...
...
@@ -25,13 +25,14 @@ ListView {
// ---------------------------------------------------------------------------
onCountChanged
:
Logic
.
handleCountChanged
(
count
)
Connections
{
target
:
model
onCallRunning
:
Logic
.
handleCallRunning
(
index
,
call
)
onRowsAboutToBeRemoved
:
Logic
.
handleRowsAboutToBeRemoved
(
parent
,
first
,
last
)
onRowsInserted
:
Logic
.
handleRowsInserted
(
parent
,
first
,
last
)
onRowsRemoved
:
Logic
.
handleRowsRemoved
(
parent
,
first
,
last
)
}
// ---------------------------------------------------------------------------
...
...
@@ -123,8 +124,10 @@ ListView {
width
:
parent
.
width
onClicked
:
{
_selectedCall
=
$call
calls
.
currentIndex
=
index
if
(
$call
.
status
!==
CallModel
.
CallStatusEnded
)
{
_selectedCall
=
$call
calls
.
currentIndex
=
index
}
}
// -------------------------------------------------------------------------
...
...
linphone-desktop/ui/modules/Linphone/Timeline/Timeline.js
View file @
9d8b2632
...
...
@@ -43,7 +43,7 @@ function handleRowsAboutToBeRemoved (parent, first, last) {
}
}
function
handleCountChanged
()
{
function
handleCountChanged
(
_
)
{
var
sipAddress
=
timeline
.
_selectedSipAddress
if
(
sipAddress
.
length
>
0
)
{
setSelectedEntry
(
sipAddress
)
...
...
linphone-desktop/ui/modules/Linphone/Timeline/Timeline.qml
View file @
9d8b2632
...
...
@@ -139,6 +139,6 @@ ColumnLayout {
}
}
onCountChanged
:
Logic
.
handleCountChanged
()
onCountChanged
:
Logic
.
handleCountChanged
(
count
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment