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
0c1d6929
Commit
0c1d6929
authored
Feb 20, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/modules/Linphone/Timeline): use `Connections` component
parent
92d076ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
33 deletions
+37
-33
Timeline.qml
linphone-desktop/ui/modules/Linphone/Timeline.qml
+37
-33
No files found.
linphone-desktop/ui/modules/Linphone/Timeline.qml
View file @
0c1d6929
...
...
@@ -45,47 +45,51 @@ ColumnLayout {
spacing
:
0
Rectangle
{
anchors.fill
:
parent
color
:
TimelineStyle
.
color
}
// ---------------------------------------------------------------------------
SmartConnect
{
Component.onCompleted
:
{
// Handle if current entry was moved in timeline.
this
.
connect
(
model
,
'
dataChanged
'
,
function
()
{
var
index
=
view
.
currentIndex
if
(
index
!==
-
1
&&
_selectedSipAddress
!==
model
.
data
(
model
.
index
(
index
,
0
)).
sipAddress
)
{
setSelectedEntry
(
_selectedSipAddress
)
}
})
Connections
{
target
:
model
// Handle if current entry was moved in timeline.
onDataChanged
:
{
var
index
=
view
.
currentIndex
if
(
index
!==
-
1
&&
_selectedSipAddress
!==
model
.
data
(
model
.
index
(
index
,
0
)).
sipAddress
)
{
setSelectedEntry
(
_selectedSipAddress
)
}
}
// A timeline entry is removed from timeline if there is no history entry.
this
.
connect
(
model
,
'
rowsAboutToBeRemoved
'
,
function
(
_
,
first
,
last
)
{
var
index
=
view
.
currentIndex
if
(
index
>=
first
&&
index
<=
last
)
{
view
.
currentIndex
=
-
1
}
})
// A timeline entry is removed from timeline if there is no history entry.
onRowsAboutToBeRemoved
:
{
var
index
=
view
.
currentIndex
if
(
index
>=
first
&&
index
<=
last
)
{
view
.
currentIndex
=
-
1
}
}
// A entry is added when history is created.
this
.
connect
(
model
,
'
rowsInserted
'
,
function
(
_
,
first
,
last
)
{
if
(
_selectedSipAddress
.
length
===
0
)
{
return
}
// A entry is added when history is created.
onRowsInserted
:
{
if
(
_selectedSipAddress
.
length
===
0
)
{
return
}
for
(
var
i
=
first
;
i
<=
last
;
i
++
)
{
if
(
_selectedSipAddress
===
model
.
data
(
model
.
index
(
i
,
0
)).
sipAddress
)
{
view
.
currentIndex
=
i
}
for
(
var
i
=
first
;
i
<=
last
;
i
++
)
{
if
(
_selectedSipAddress
===
model
.
data
(
model
.
index
(
i
,
0
)).
sipAddress
)
{
view
.
currentIndex
=
i
}
}
)
}
}
}
// ---------------------------------------------------------------------------
Rectangle
{
anchors.fill
:
parent
color
:
TimelineStyle
.
color
}
// ---------------------------------------------------------------------------
// Legend.
// ---------------------------------------------------------------------------
...
...
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