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

feat(app): calls in progress

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