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
10 import com.hfdialer 1.0
12 import 'javascripts/framework.js' as Support
18 width: 1024; height: 600
20 Dialer { id: adapter }
22 Component.onCompleted: {
23 console.log("######## Completed loading component, initializing...");
25 adapter.incomingCall.connect(function()
27 var call = adapter.currentCall;
29 console.log("*** QML *** :: INCOMING CALL:" + call);
30 console.log("*** QML *** :: MSISDN: " + call.msisdn);
31 console.log("*** QML *** :: START: " + call.startedAt);
34 dialpage.activeCall = call
38 if(adapter.currentCall)
40 dialpage.activeCall = call
45 function showErrorMessage(mesg) {
46 mesgDialog.mesg = mesg;
47 mesgDialog.state = 'shown';
50 function dial(msisdn) {
51 if(msisdn.trim().length == 0)
53 console.log("*** QML *** :: You can't dial without a number!");
54 showErrorMessage(qsTr("No number specified!"));
58 if (!adapter.modemOnline)
60 console.log("*** QML *** :: modem is not available or powered down");
61 showErrorMessage(qsTr("modem is not available or powered down!"));
65 console.log("*** QML *** :: Attempting to dial MSISDN: " + msisdn);
67 dialpage.activeCall = {
77 function dialMailbox() {
79 console.log("*** QML *** :: Attempting to call mailbox number: " + adapter.mailbox);
80 main.dial(adapter.mailbox);
82 console.log("*** QML *** :: No mailbox number defined!");
83 showErrorMessage(qsTr("No mailbox number defined."));
87 function dialSpeedDial(index) {
88 if(adapter.speedDial(index))
90 console.log("*** QML *** :: Calling speed dial " + index + ": " + adapter.speedDial(index));
91 main.dial(adapter.speedDial(index));
93 console.log("*** QML *** :: No speed dial number defined for: " + index);
94 showErrorMessage(qsTr("No speed dial for " + (index + 1)));