~ps-jenkins/dialer-app/trusty-proposed

« back to all changes in this revision

Viewing changes to src/qml/LiveCallPage/LiveCall.qml

  • Committer: CI bot
  • Author(s): Gustavo Pichorim Boiko
  • Date: 2014-04-11 12:49:06 UTC
  • mfrom: (117.1.4 dialer-app-make_second_call)
  • Revision ID: ps-jenkins@lists.canonical.com-20140411124906-o27282z108y90smg
Make it possible to start a new call while already in a call. Fixes: 1306203

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import QtGraphicalEffects 1.0
21
21
import Ubuntu.Components 0.1
22
22
import Ubuntu.Components.ListItems 0.1 as ListItems
 
23
import Ubuntu.Components.Popups 0.1
23
24
import Ubuntu.Telephony 0.1
24
25
import Ubuntu.Contacts 0.1
25
26
import QtContacts 5.0
60
61
        dtmfVisible = (call && call.voicemail);
61
62
    }
62
63
 
 
64
    Component {
 
65
        id: makeNewCallComponent
 
66
        DefaultSheet {
 
67
            // FIXME: workaround to set the contact list
 
68
            // background to black
 
69
            Rectangle {
 
70
                anchors.fill: parent
 
71
                anchors.margins: -units.gu(1)
 
72
                color: "#221e1c"
 
73
            }
 
74
            id: sheet
 
75
            title: i18n.tr("New call")
 
76
            doneButton: false
 
77
            modal: true
 
78
            contentsHeight: parent.height
 
79
            contentsWidth: parent.width
 
80
            ContactListView {
 
81
                anchors.fill: parent
 
82
                detailToPick: ContactDetail.PhoneNumber
 
83
                onContactClicked: {
 
84
                    // FIXME: search for favorite number
 
85
                    callManager.startCall(contact.phoneNumber.number);
 
86
                    PopupUtils.close(sheet)
 
87
                }
 
88
                onDetailClicked: {
 
89
                    callManager.startCall(detail.number)
 
90
                    PopupUtils.close(sheet)
 
91
                }
 
92
            }
 
93
            onDoneClicked: PopupUtils.close(sheet)
 
94
        }
 
95
    }
 
96
 
63
97
    Timer {
64
98
        id: callWatcher
65
99
        interval: 10000
439
473
            iconSource: "contact"
440
474
            iconWidth: units.gu(4)
441
475
            iconHeight: units.gu(4)
442
 
            // this button is fully disabled for now, but when it gets enabled again, we need to remember
443
 
            // to still disable it while calling the voicemail
444
 
            enabled: false //!isVoicemail
 
476
            enabled: (callManager.hasCalls && !callManager.backgroundCall && !callManager.foregroundCall.dialing)
445
477
 
446
478
            anchors {
447
479
                verticalCenter: hangupButton.verticalCenter
448
480
                right: hangupButton.left
449
481
                rightMargin: units.gu(1)
450
482
            }
 
483
 
 
484
            onClicked: {
 
485
                PopupUtils.open(makeNewCallComponent);
 
486
            }
451
487
        }
452
488
 
453
489
        HangupButton {