summaryrefslogtreecommitdiffstats
path: root/app/Dialer.qml
diff options
context:
space:
mode:
authorMatt Porter <mporter@konsulko.com>2017-11-11 23:36:34 -0500
committerMatt Porter <mporter@konsulko.com>2017-11-11 23:36:34 -0500
commitb79d2e9c18ffcaaa73df03ff908a62fc7603bba5 (patch)
tree46fd6bd6b253a51a95a6ce19d964c7051cde419a /app/Dialer.qml
parent202a1402f1e59c73e631ef9495c22fee30bafac2 (diff)
Move call timer functionality from QML into the C++ Phone class
Removes the QML call timer implementation in favor of a C++ implementation in the Phone class. This allows the call timer to be started even if the QML application is in the background (QSG RenderThread not scheduled). Bug-AGL: SPEC-1083 Change-Id: I0cb9087d73862992d25b105f97b830eef5c83ef0 Signed-off-by: Matt Porter <mporter@konsulko.com>
Diffstat (limited to 'app/Dialer.qml')
-rw-r--r--app/Dialer.qml25
1 files changed, 5 insertions, 20 deletions
diff --git a/app/Dialer.qml b/app/Dialer.qml
index afeea18..0bf51cf 100644
--- a/app/Dialer.qml
+++ b/app/Dialer.qml
@@ -25,24 +25,12 @@ import 'models'
Item {
id: root
- function getTime() {
- return new Date().getTime()
- }
-
- // Elapsed time in hh:mm:ss format
- function getElapsedTimeString(startTime) {
- var seconds = Math.floor((getTime() - startTime) / 1000);
- var time = new Date(null);
- time.setSeconds(seconds);
- return time.toISOString().substr(11, 8);
- }
+ Connections {
+ target: phone
- Timer {
- id: callTimer
- interval: 1000
- repeat: true
- property var startTime
- onTriggered: callStateLabel.text = getElapsedTimeString(startTime)
+ onElapsedTimeChanged: {
+ callStateLabel.text = phone.elapsedTime
+ }
}
Connections {
@@ -60,12 +48,9 @@ Item {
callStateLabel.text = "Dialing " + telephony.callColp
} else if (telephony.callState == "active") {
rejectButton.active = false
- callTimer.startTime = getTime()
- callTimer.restart()
} else if (telephony.callState == "disconnected") {
rejectButton.active = false
callButton.checked = false
- callTimer.stop()
callStateLabel.text = ""
}
}