Commit 7096eb69 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(app): calls in progress

parent 2e8929f6
......@@ -260,8 +260,8 @@
<file>ui/views/App/MainWindow/MainWindow.qml</file>
<file>ui/views/App/ManageAccounts.qml</file>
<file>ui/views/App/qmldir</file>
<file>ui/views/App/Styles/Calls/CallStyle.qml</file>
<file>ui/views/App/Styles/Calls/CallsWindowStyle.qml</file>
<file>ui/views/App/Styles/Calls/StartingCallStyle.qml</file>
<file>ui/views/App/Styles/MainWindow/ContactEditStyle.qml</file>
<file>ui/views/App/Styles/MainWindow/ContactsStyle.qml</file>
<file>ui/views/App/Styles/MainWindow/ConversationStyle.qml</file>
......
......@@ -110,18 +110,23 @@ void CallModel::setPausedByUser (bool status) {
bool paused = getPausedByUser();
if (status) {
if (!paused) {
if (!paused)
CoreManager::getInstance()->getCore()->pauseCall(m_linphone_call);
emit pausedByUserChanged(true);
}
return;
}
if (paused) {
if (paused)
CoreManager::getInstance()->getCore()->resumeCall(m_linphone_call);
emit pausedByUserChanged(false);
}
}
bool CallModel::getVideoInputEnabled () const {
// TODO
return false;
}
void CallModel::setVideoInputEnabled (bool status) {
// TODO
}
bool CallModel::getVideoOutputEnabled () const {
......
......@@ -13,7 +13,8 @@ class CallModel : public QObject {
Q_PROPERTY(CallStatus status READ getStatus NOTIFY statusChanged);
Q_PROPERTY(bool isOutgoing READ isOutgoing CONSTANT);
Q_PROPERTY(bool microMuted READ getMicroMuted WRITE setMicroMuted NOTIFY microMutedChanged);
Q_PROPERTY(bool pausedByUser READ getPausedByUser WRITE setPausedByUser NOTIFY pausedByUserChanged);
Q_PROPERTY(bool pausedByUser READ getPausedByUser WRITE setPausedByUser NOTIFY statusChanged);
Q_PROPERTY(bool videoInputEnabled READ getVideoInputEnabled WRITE setVideoInputEnabled NOTIFY videoInputEnabled);
Q_PROPERTY(bool videoOutputEnabled READ getVideoOutputEnabled WRITE setVideoOutputEnabled NOTIFY videoOutputEnabled);
public:
......@@ -38,8 +39,8 @@ public:
signals:
void statusChanged (CallStatus status);
void pausedByUserChanged (bool status);
void microMutedChanged (bool status);
void videoInputEnabled (bool status);
void videoOutputEnabled (bool status);
private:
......@@ -56,6 +57,9 @@ private:
bool getPausedByUser () const;
void setPausedByUser (bool status);
bool getVideoInputEnabled () const;
void setVideoInputEnabled (bool status);
bool getVideoOutputEnabled () const;
void setVideoOutputEnabled (bool status);
......
......@@ -43,7 +43,6 @@ Rectangle {
Layout.fillHeight: true
Layout.fillWidth: true
anchors.fill: parent
displayUnreadMessagesCount: true
......@@ -55,7 +54,10 @@ Rectangle {
Item {
id: content
Layout.fillHeight: true
Component.onCompleted: Layout.preferredWidth = data[0].width
}
}
......
......@@ -112,8 +112,6 @@ ListView {
}
}
// ---------------------------------------------------------------------------
Component {
id: callActions
......@@ -187,7 +185,7 @@ ListView {
id: _callControls
function useColorStatus () {
return calls.currentIndex === index && $call.status !== CallModel.CallStatusEnded
return calls.currentIndex === index && $call && $call.status !== CallModel.CallStatusEnded
}
color: useColorStatus()
......
......@@ -7,7 +7,7 @@ import Common 1.0
QtObject {
property QtObject entry: QtObject {
property int iconActionSize: 30
property int iconActionSize: 35
property int iconMenuSize: 17
property int height: 30
property int width: 200
......
......@@ -10,24 +10,19 @@ import App.Styles 1.0
// =============================================================================
Rectangle {
id: abstractCall
// ---------------------------------------------------------------------------
property var call
default property alias _actionArea: actionArea.data
property var _contactObserver: SipAddressesModel.getContactObserver(sipAddress)
// ---------------------------------------------------------------------------
color: StartingCallStyle.backgroundColor
color: CallStyle.backgroundColor
ColumnLayout {
anchors {
fill: parent
topMargin: StartingCallStyle.header.topMargin
topMargin: CallStyle.header.topMargin
}
spacing: 0
......@@ -38,12 +33,12 @@ Rectangle {
Column {
Layout.fillWidth: true
spacing: StartingCallStyle.header.spacing
spacing: CallStyle.header.spacing
ContactDescription {
id: contactDescription
height: StartingCallStyle.contactDescriptionHeight
height: CallStyle.contactDescriptionHeight
horizontalTextAlignment: Text.AlignHCenter
sipAddress: call.sipAddress
username: LinphoneUtils.getContactUsername(_contactObserver.contact || call.sipAddress)
......@@ -52,9 +47,9 @@ Rectangle {
BusyIndicator {
anchors.horizontalCenter: parent.horizontalCenter
color: StartingCallStyle.busyIndicator.color
height: StartingCallStyle.busyIndicator.height
width: StartingCallStyle.busyIndicator.width
color: CallStyle.busyIndicator.color
height: CallStyle.busyIndicator.height
width: CallStyle.busyIndicator.width
visible: call.isOutgoing
}
......@@ -69,7 +64,7 @@ Rectangle {
Layout.fillHeight: true
Layout.fillWidth: true
Layout.margins: StartingCallStyle.containerMargins
Layout.margins: CallStyle.containerMargins
Avatar {
id: avatar
......@@ -78,14 +73,14 @@ Rectangle {
var height = container.height
var width = container.width
var size = height < StartingCallStyle.avatar.maxSize && height > 0
var size = height < CallStyle.avatar.maxSize && height > 0
? height
: StartingCallStyle.avatar.maxSize
: CallStyle.avatar.maxSize
return size < width ? size : width
}
anchors.centerIn: parent
backgroundColor: StartingCallStyle.avatar.backgroundColor
backgroundColor: CallStyle.avatar.backgroundColor
image: _contactObserver.contact && _contactObserver.contact.avatar
username: contactDescription.username
......@@ -102,7 +97,7 @@ Rectangle {
id: actionArea
Layout.fillWidth: true
Layout.preferredHeight: StartingCallStyle.actionAreaHeight
Layout.preferredHeight: CallStyle.actionAreaHeight
}
}
}
......@@ -41,9 +41,9 @@ Window {
Paned {
anchors.fill: parent
defaultChildAWidth: 250
maximumLeftLimit: 250
minimumLeftLimit: 110
defaultChildAWidth: CallsWindowStyle.callsList.defaultWidth
maximumLeftLimit: CallsWindowStyle.callsList.maximumWidth
minimumLeftLimit: CallsWindowStyle.callsList.minimumWidth
// -------------------------------------------------------------------------
// Calls list.
......@@ -76,18 +76,20 @@ Window {
ActionBar {
anchors {
left: parent.left
leftMargin: 10
leftMargin: CallsWindowStyle.callsList.header.leftMargin
verticalCenter: parent.verticalCenter
}
iconSize: 40
iconSize: CallsWindowStyle.callsList.header.iconSize
ActionButton {
icon: 'new_call'
// TODO: launch new call
}
ActionButton {
icon: 'new_conference'
// TODO: launch new conference
}
}
}
......@@ -113,8 +115,8 @@ Window {
anchors.fill: parent
closingEdge: Qt.RightEdge
defaultClosed: true
minimumLeftLimit: 395
minimumRightLimit: 300
minimumLeftLimit: CallsWindowStyle.call.minimumWidth
minimumRightLimit: CallsWindowStyle.chat.minimumWidth
resizeAInPriority: true
// -----------------------------------------------------------------------
......@@ -178,9 +180,9 @@ Window {
}
childB: Loader {
active: Boolean(window.call)
active: Boolean(window.sipAddress)
anchors.fill: parent
sourceComponent: window.call ? chat : null
sourceComponent: window.sipAddress ? chat : null
}
}
}
......
......@@ -21,12 +21,12 @@ Rectangle {
// ---------------------------------------------------------------------------
color: StartingCallStyle.backgroundColor
color: CallStyle.backgroundColor
ColumnLayout {
anchors {
fill: parent
topMargin: StartingCallStyle.header.topMargin
topMargin: CallStyle.header.topMargin
}
spacing: 0
......@@ -39,9 +39,9 @@ Rectangle {
id: info
Layout.fillWidth: true
Layout.leftMargin: 20
Layout.leftMargin: CallStyle.info.leftMargin
Layout.rightMargin: 20
Layout.preferredHeight: StartingCallStyle.contactDescriptionHeight
Layout.preferredHeight: CallStyle.contactDescriptionHeight
Icon {
id: callQuality
......@@ -92,7 +92,7 @@ Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: StartingCallStyle.containerMargins
Layout.margins: CallStyle.containerMargins
Component {
id: avatar
......@@ -102,13 +102,13 @@ Rectangle {
var height = container.height
var width = container.width
var size = height < StartingCallStyle.avatar.maxSize && height > 0
var size = height < CallStyle.avatar.maxSize && height > 0
? height
: StartingCallStyle.avatar.maxSize
: CallStyle.avatar.maxSize
return size < width ? size : width
}
backgroundColor: StartingCallStyle.avatar.backgroundColor
backgroundColor: CallStyle.avatar.backgroundColor
image: _contactObserver.contact ? _contactObserver.contact.vcard.avatar : ''
username: contactDescription.username
......@@ -128,7 +128,7 @@ Rectangle {
Loader {
anchors.centerIn: parent
sourceComponent: isVideoCall ? camera : avatar
sourceComponent: call.videoInputEnabled ? camera : avatar
}
}
......@@ -138,12 +138,12 @@ Rectangle {
Item {
Layout.fillWidth: true
Layout.preferredHeight: StartingCallStyle.actionAreaHeight
Layout.preferredHeight: CallStyle.actionAreaHeight
GridLayout {
anchors {
left: parent.left
leftMargin: StartingCallStyle.leftButtonsGroupMargin
leftMargin: CallStyle.leftButtonsGroupMargin
verticalCenter: parent.verticalCenter
}
......@@ -152,55 +152,57 @@ Rectangle {
ActionSwitch {
icon: 'micro'
iconSize: StartingCallStyle.iconSize
iconSize: CallStyle.iconSize
onClicked: enabled = !enabled
}
ActionSwitch {
icon: 'speaker'
iconSize: StartingCallStyle.iconSize
iconSize: CallStyle.iconSize
onClicked: enabled = !enabled
}
ActionSwitch {
icon: 'camera'
iconSize: StartingCallStyle.iconSize
iconSize: CallStyle.iconSize
onClicked: enabled = !enabled
}
ActionButton {
Layout.preferredHeight: StartingCallStyle.iconSize
Layout.preferredWidth: StartingCallStyle.iconSize
Layout.preferredHeight: CallStyle.iconSize
Layout.preferredWidth: CallStyle.iconSize
icon: 'options'
iconSize: StartingCallStyle.iconSize
iconSize: CallStyle.iconSize
}
}
Rectangle {
anchors.centerIn: parent
color: 'red'
height: StartingCallStyle.userVideo.height
visible: call.width >= 550
width: StartingCallStyle.userVideo.width
height: CallStyle.userVideo.height
visible: incall.width >= 650
width: CallStyle.userVideo.width
}
ActionBar {
anchors {
right: parent.right
rightMargin: StartingCallStyle.rightButtonsGroupMargin
rightMargin: CallStyle.rightButtonsGroupMargin
verticalCenter: parent.verticalCenter
}
iconSize: StartingCallStyle.iconSize
iconSize: CallStyle.iconSize
ActionSwitch {
enabled: !call.pausedByUser
icon: 'pause'
onClicked: enabled = !enabled
onClicked: call.pausedByUser = enabled
}
ActionButton {
icon: 'hangup'
onClicked: Call.terminate()
onClicked: call.terminate()
}
ActionSwitch {
......
......@@ -7,7 +7,7 @@ import App.Styles 1.0
AbstractStartingCall {
ActionBar {
anchors.centerIn: parent
iconSize: StartingCallStyle.iconSize
iconSize: CallStyle.iconSize
ActionButton {
icon: 'video_call_accept'
......@@ -25,10 +25,10 @@ AbstractStartingCall {
ActionBar {
anchors {
right: parent.right
rightMargin: StartingCallStyle.rightButtonsGroupMargin
rightMargin: CallStyle.rightButtonsGroupMargin
verticalCenter: parent.verticalCenter
}
iconSize: StartingCallStyle.iconSize
iconSize: CallStyle.iconSize
ActionButton {
icon: 'hangup'
......
......@@ -10,26 +10,26 @@ import App.Styles 1.0
AbstractStartingCall {
GridLayout {
columns: parent.width < StartingCallStyle.low && call.videoOutputEnabled ? 1 : 2
columns: parent.width < CallStyle.lowWidth && call.videoOutputEnabled ? 1 : 2
rowSpacing: ActionBarStyle.spacing
anchors {
left: parent.left
leftMargin: StartingCallStyle.leftButtonsGroupMargin
leftMargin: CallStyle.leftButtonsGroupMargin
verticalCenter: parent.verticalCenter
}
ActionSwitch {
enabled: !call.microMuted
icon: 'micro'
iconSize: StartingCallStyle.iconSize
iconSize: CallStyle.iconSize
onClicked: call.microMuted = enabled
}
ActionSwitch {
icon: 'speaker'
iconSize: StartingCallStyle.iconSize
iconSize: CallStyle.iconSize
onClicked: enabled = !enabled
}
......@@ -37,8 +37,8 @@ AbstractStartingCall {
Item {
anchors.centerIn: parent
height: StartingCallStyle.userVideo.height
width: StartingCallStyle.userVideo.width
height: CallStyle.userVideo.height
width: CallStyle.userVideo.width
visible: call.videoOutputEnabled
}
......@@ -46,10 +46,10 @@ AbstractStartingCall {
ActionBar {
anchors {
right: parent.right
rightMargin: StartingCallStyle.rightButtonsGroupMargin
rightMargin: CallStyle.rightButtonsGroupMargin
verticalCenter: parent.verticalCenter
}
iconSize: StartingCallStyle.iconSize
iconSize: CallStyle.iconSize
ActionButton {
icon: 'hangup'
......
......@@ -10,13 +10,26 @@ QtObject {
property int minimumWidth: 960
property string title: 'Linphone'
property QtObject callsList: QtObject {
property color color: Colors.k
property QtObject call: QtObject {
property int minimumWidth: 395
}
property QtObject header: QtObject {
property int height: 60
property color color1: Colors.k
property color color2: Colors.v
}
}
property QtObject callsList: QtObject {
property color color: Colors.k
property int defaultWidth: 250
property int maximumWidth: 250
property int minimumWidth: 110
property QtObject header: QtObject {
property color color1: Colors.k
property color color2: Colors.v
property int height: 60
property int iconSize: 40
property int leftMargin: 10
}
}
property QtObject chat: QtObject {
property int minimumWidth: 300
}
}
......@@ -4,8 +4,8 @@ module App.Styles
# Views styles -----------------------------------------------------------------
singleton CallStyle 1.0 Calls/CallStyle.qml
singleton CallsWindowStyle 1.0 Calls/CallsWindowStyle.qml
singleton StartingCallStyle 1.0 Calls/StartingCallStyle.qml
singleton ContactEditStyle 1.0 MainWindow/ContactEditStyle.qml
singleton ContactsStyle 1.0 MainWindow/ContactsStyle.qml
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment