2 * Copyright 2012 Intel Corporation.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
11 import 'javascripts/framework.js' as Support
20 property string callDuration: "00:00:00"
21 property string callerLabelText: "Unknown Caller"
22 state : 'disconnected'
25 console.log("*** call changed in large, before if")
26 if(call && call.msisdn) {
27 console.log("*** in calllarge if >> " + call.state );
29 root.state = call.state
31 if (call.msisdn !== undefined && call.msisdn[0]!== undefined)
33 if (call.msisdn.trim().length >= 10)
35 root.callerLabelText = call.msisdn[0] + call.msisdn[1] + call.msisdn[2] + '-' +
36 call.msisdn[3] + call.msisdn[4] + call.msisdn[5] + '-' +
37 call.msisdn[6] + call.msisdn[7] + call.msisdn[8] + call.msisdn[9];
40 root.callerLabelText = call.msisdn;
46 interval: 1000; repeat: true; running: true;
50 if(call.duration && call.duration > 0)
52 callDuration = Support.friendlyInterval(call.duration);
61 PropertyChanges {target: root; callDuration: "00:00:00"}
62 PropertyChanges {target: answerButton; visible: false}
63 PropertyChanges {target: hangupButton; visible: true; width: parent.width}
64 PropertyChanges {target: stateInd; text: qsTr("Active")}
69 PropertyChanges {target: answerButton; visible: false}
70 PropertyChanges {target: hangupButton; visible: true; width: parent.width}
71 PropertyChanges {target: stateInd; text: qsTr("Held")}
76 PropertyChanges {target: root; callDuration: "00:00:00"}
77 PropertyChanges {target: answerButton; visible: false}
78 PropertyChanges {target: hangupButton; visible: true; width: parent.width}
79 PropertyChanges {target: stateInd; text: qsTr("Dialing...")}
84 PropertyChanges {target: answerButton; visible: false}
85 PropertyChanges {target: hangupButton; visible: true; width: parent.width}
86 PropertyChanges {target: stateInd; text: qsTr("Alerting...")}
91 PropertyChanges {target: root; callDuration: "00:00:00"}
92 PropertyChanges {target: answerButton; visible: true}
93 PropertyChanges {target: hangupButton; visible: true; width: parent.width * 0.45}
94 PropertyChanges {target: stateInd; text: qsTr("Incoming...")}
99 PropertyChanges {target: answerButton; visible: false}
100 PropertyChanges {target: hangupButton; visible: true; width: parent.width}
101 PropertyChanges {target: stateInd; text: qsTr("Waiting...")}
106 PropertyChanges {target: callDurationInd; text: "00:00:00"}
107 PropertyChanges {target: answerButton; visible: false}
108 PropertyChanges {target: hangupButton; visible: false}
109 PropertyChanges {target: stateInd; text: qsTr("Disconnected")}
116 anchors {top: parent.top; topMargin: 20; horizontalCenter: parent.horizontalCenter}
119 text: qsTr("Disconnected")
125 anchors {top: stateInd.bottom; topMargin: 20; horizontalCenter: parent.horizontalCenter}
128 text: callerLabelText
134 source: "/usr/share/hfdialer/images/ivi_icon-time.png"
135 anchors { right: callDurationInd.left; rightMargin: 2; bottom: callerInd.top}
144 anchors {bottom: callerInd.top; right: parent.right; topMargin: 10; rightMargin: parent.width * 0.2}
153 anchors {top: callerInd.bottom; topMargin: 15; left: parent.left; leftMargin: parent.width * 0.2; right: parent.right; rightMargin: parent.width * 0.2}
155 width: parent.width * 0.75
162 width: parent.width *0.45
163 anchors {left: parent.left;}
164 source: "/usr/share/hfdialer/images/ivi_btn-incomingcall-accept.png"
168 width: 40; height: width
169 anchors.centerIn: parent
171 source: "/usr/share/hfdialer/images/ivi_icon-call.png"
179 answerButton.source = "/usr/share/hfdialer/images/ivi_btn-incomingcall-accept-active.png"
183 answerButton.source = "/usr/share/hfdialer/images/ivi_btn-incomingcall-accept.png"
187 console.log("*** QML *** :: Answering call");
188 adapter.currentCall.answer();
197 width: parent.width * 0.45
198 anchors {right: parent.right;}
199 source: "/usr/share/hfdialer/images/ivi_btn-incomingcall-decline.png"
203 width: 40; height: width
204 anchors.centerIn: parent
206 source: "/usr/share/hfdialer/images/ivi_icon-endcall.png"
214 hangupButton.source = "/usr/share/hfdialer/images/ivi_btn-incomingcall-decline-active.png"
218 hangupButton.source = "/usr/share/hfdialer/images/ivi_btn-incomingcall-decline.png"
222 console.log("*** QML *** :: Hanging up call");
223 root.parent.state = 'disconnected'
225 root.state = 'disconnected'
226 root.parent.parent.state = 'disconnected'
227 if (root.parent.parent.call)
228 root.parent.parent.call = null