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

« back to all changes in this revision

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

Add a better UI (not final yet) for multi-calls and make it possible to create and manage conference calls. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2012-2013 Canonical Ltd.
 
3
 *
 
4
 * This file is part of dialer-app.
 
5
 *
 
6
 * dialer-app is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; version 3.
 
9
 *
 
10
 * dialer-app is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
import QtQuick 2.0
 
20
import Ubuntu.Components 0.1
 
21
import Ubuntu.Components.ListItems 0.1 as ListItem
 
22
import Ubuntu.Telephony 0.1
 
23
 
 
24
Column {
 
25
    id: conferenceCallArea
 
26
 
 
27
    property QtObject conference: null
 
28
 
 
29
    spacing: units.gu(1)
 
30
    visible: opacity > 0
 
31
 
 
32
    Behavior on opacity {
 
33
        UbuntuNumberAnimation { }
 
34
    }
 
35
 
 
36
    Repeater {
 
37
        id: repeater
 
38
        model: conference ? conference.calls : null
 
39
        ListItem.Empty {
 
40
            id: callDelegate
 
41
            property QtObject callEntry: modelData
 
42
 
 
43
            removable: true
 
44
            confirmRemoval: true
 
45
            showDivider: false
 
46
            height: (conferenceCallArea.height - units.gu(repeater.count-1)) / (repeater.count > 0 ? repeater.count : 1)
 
47
 
 
48
            anchors {
 
49
                left: parent.left
 
50
                right: parent.right
 
51
            }
 
52
 
 
53
            backgroundIndicator: Rectangle {
 
54
                id: body
 
55
                anchors.fill: parent
 
56
 
 
57
                color: "red"
 
58
                clip: true
 
59
 
 
60
                Row {
 
61
                    anchors {
 
62
                        top: parent.top
 
63
                        bottom:  parent.bottom
 
64
                        right: parent.right
 
65
                        rightMargin: units.gu(2)
 
66
                    }
 
67
                    spacing: units.gu(2)
 
68
                    Icon {
 
69
                        name: "call-end"
 
70
                        color: "white"
 
71
                        anchors {
 
72
                            verticalCenter: parent.verticalCenter
 
73
                        }
 
74
                        width: units.gu(5)
 
75
                        height: units.gu(5)
 
76
                    }
 
77
                    Label {
 
78
                        text: i18n.tr("Hangup")
 
79
                        verticalAlignment: Text.AlignVCenter
 
80
                        anchors {
 
81
                            verticalCenter: parent.verticalCenter
 
82
                        }
 
83
                        width: units.gu(7)
 
84
                        fontSize: "medium"
 
85
                    }
 
86
                }
 
87
            }
 
88
 
 
89
            onItemRemoved: callEntry.endCall()
 
90
 
 
91
            Rectangle {
 
92
                color: callEntry.held ? "black" : "white"
 
93
                opacity: 0.5
 
94
                anchors.fill: parent
 
95
                radius: units.gu(0.5)
 
96
                antialiasing: true
 
97
 
 
98
                Behavior on color {
 
99
                    ColorAnimation {
 
100
                        duration: 150
 
101
                    }
 
102
                }
 
103
            }
 
104
 
 
105
            ContactWatcher {
 
106
                id: watcher
 
107
                phoneNumber: callEntry.phoneNumber
 
108
            }
 
109
 
 
110
            Label {
 
111
                id: aliasLabel
 
112
                fontSize: "large"
 
113
                anchors {
 
114
                    left: parent.left
 
115
                    top: parent.top
 
116
                    margins: units.gu(1)
 
117
                }
 
118
                text: watcher.alias != "" ? watcher.alias : watcher.phoneNumber;
 
119
            }
 
120
 
 
121
            Label {
 
122
                fontSize: "medium"
 
123
                anchors {
 
124
                    left: parent.left
 
125
                    top: aliasLabel.bottom
 
126
                    margins: units.gu(1)
 
127
                }
 
128
                text: callEntry.held ? i18n.tr("on hold") : i18n.tr("active")
 
129
            }
 
130
 
 
131
            Button {
 
132
                text: i18n.tr("Private")
 
133
                anchors {
 
134
                    verticalCenter: parent.verticalCenter
 
135
                    right: parent.right
 
136
                    rightMargin: units.gu(1)
 
137
                }
 
138
                visible: !callManager.backgroundCall
 
139
                onClicked: callEntry.splitCall()
 
140
            }
 
141
        }
 
142
    }
 
143
}