Commit 222f8810 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Calls/Incall): disable actions when call is updating

parent 1e784c44
<?xml version="1.0" encoding="UTF-8"?>
<svg width="40px" height="41px" viewBox="0 0 40 41" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 41 (35326) - http://www.bohemiancoding.com/sketch -->
<title>camera_off</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="camera_off">
<path d="M20,40.3145406 C31.045695,40.3145406 40,31.3602356 40,20.3145406 C40,9.26884559 31.045695,0.314540582 20,0.314540582 C8.954305,0.314540582 0,9.26884559 0,20.3145406 C0,31.3602356 8.954305,40.3145406 20,40.3145406 Z" fill="#D0D8DE"></path>
<path d="M9,30.2917175 L28.1397841,11.3145406 L9,30.2917175 Z" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
<polygon stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" points="24.8941594 26.3145406 24.8941594 21.6287855 30.7045152 25.9910443 30.7045152 14.6377075 24.8941594 19.0006251 24.8941594 14.3145406 9 14.3145406 9 26.167946 9.17456154 26.3145406"></polygon>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="40px" height="40px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 41 (35326) - http://www.bohemiancoding.com/sketch -->
<title>camera_on</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="camera_on">
<path d="M20,40 C31.045695,40 40,31.045695 40,20 C40,8.954305 31.045695,0 20,0 C8.954305,0 0,8.954305 0,20 C0,31.045695 8.954305,40 20,40 Z" fill="#4B5964"></path>
<polygon stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" points="24.8941594 26 24.8941594 21.3142449 30.7045152 25.6765037 30.7045152 14.3231669 24.8941594 18.6860845 24.8941594 14 9 14 9 25.8534054 9.17456154 26"></polygon>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="40px" height="40px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 41 (35326) - http://www.bohemiancoding.com/sketch -->
<title>play_default</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="play_default">
<path d="M20,40 C31.045695,40 40,31.045695 40,20 C40,8.954305 31.045695,0 20,0 C8.954305,0 0,8.954305 0,20 C0,31.045695 8.954305,40 20,40 Z" fill="#96A6B1"></path>
<polygon stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" points="16 11 16 29 28.5805664 20"></polygon>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="40px" height="40px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 41 (35326) - http://www.bohemiancoding.com/sketch -->
<title>pause_default</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="pause_default">
<path d="M20,40 C31.045695,40 40,31.045695 40,20 C40,8.954305 31.045695,0 20,0 C8.954305,0 0,8.954305 0,20 C0,31.045695 8.954305,40 20,40 Z" fill="#96A6B1"></path>
<path d="M17,13 L17,26.9571245 M22.6,13 L22.6,26.9571245" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
</g>
</g>
</svg>
\ No newline at end of file
......@@ -33,9 +33,11 @@
<file>assets/images/camera_off_hovered.svg</file>
<file>assets/images/camera_off_normal.svg</file>
<file>assets/images/camera_off_pressed.svg</file>
<file>assets/images/camera_off_updating.svg</file>
<file>assets/images/camera_on_hovered.svg</file>
<file>assets/images/camera_on_normal.svg</file>
<file>assets/images/camera_on_pressed.svg</file>
<file>assets/images/camera_on_updating.svg</file>
<file>assets/images/chat_amount.svg</file>
<file>assets/images/chat_count.svg</file>
<file>assets/images/chat_error.svg</file>
......@@ -120,9 +122,11 @@
<file>assets/images/pause_off_hovered.svg</file>
<file>assets/images/pause_off_normal.svg</file>
<file>assets/images/pause_off_pressed.svg</file>
<file>assets/images/pause_off_updating.svg</file>
<file>assets/images/pause_on_hovered.svg</file>
<file>assets/images/pause_on_normal.svg</file>
<file>assets/images/pause_on_pressed.svg</file>
<file>assets/images/pause_on_updating.svg</file>
<file>assets/images/record_hovered.svg</file>
<file>assets/images/record_normal.svg</file>
<file>assets/images/record_pressed.svg</file>
......
......@@ -200,3 +200,18 @@ void CallModel::setVideoEnabled (bool status) {
CoreManager::getInstance()->getCore()->updateCall(m_linphone_call, params);
}
bool CallModel::getUpdating () const {
switch (m_linphone_call->getState()) {
case linphone::CallStateConnected:
case linphone::CallStateStreamsRunning:
case linphone::CallStatePaused:
case linphone::CallStatePausedByRemote:
return false;
default:
break;
}
return true;
}
......@@ -11,12 +11,15 @@ class CallModel : public QObject {
Q_PROPERTY(QString sipAddress READ getSipAddress CONSTANT);
Q_PROPERTY(CallStatus status READ getStatus NOTIFY statusChanged);
Q_PROPERTY(bool isOutgoing READ isOutgoing CONSTANT);
Q_PROPERTY(int duration READ getDuration CONSTANT); // Constant but called with a timer in qml.
Q_PROPERTY(float quality READ getQuality CONSTANT); // Same idea.
Q_PROPERTY(bool microMuted READ getMicroMuted WRITE setMicroMuted NOTIFY microMutedChanged);
Q_PROPERTY(bool pausedByUser READ getPausedByUser WRITE setPausedByUser NOTIFY statusChanged);
Q_PROPERTY(bool videoEnabled READ getVideoEnabled WRITE setVideoEnabled NOTIFY statusChanged);
Q_PROPERTY(bool updating READ getUpdating NOTIFY statusChanged)
public:
enum CallStatus {
......@@ -70,6 +73,8 @@ private:
bool getVideoEnabled () const;
void setVideoEnabled (bool status);
bool getUpdating () const;
bool m_micro_muted = false;
bool m_paused_by_remote = false;
bool m_paused_by_user = false;
......
......@@ -17,6 +17,8 @@ BusyIndicator {
// ---------------------------------------------------------------------------
visible: running
contentItem: Item {
x: parent.width / 2 - width / 2
y: parent.height / 2 - height / 2
......
......@@ -13,6 +13,7 @@ Item {
// ---------------------------------------------------------------------------
property bool enabled: true
property bool updating: false
property bool useStates: true
property int iconSize // Optionnal.
readonly property alias hovered: button.hovered
......@@ -28,6 +29,10 @@ Item {
// ---------------------------------------------------------------------------
function _getIcon () {
if (wrappedButton.updating) {
return wrappedButton.icon + '_updating'
}
if (!useStates) {
return wrappedButton.icon
}
......@@ -55,9 +60,9 @@ Item {
background: Rectangle {
color: 'transparent'
}
hoverEnabled: true
hoverEnabled: !wrappedButton.updating
onClicked: wrappedButton.enabled && wrappedButton.clicked()
onClicked: !wrappedButton.updating && wrappedButton.enabled && wrappedButton.clicked()
Icon {
id: icon
......
......@@ -5,6 +5,7 @@ import QtQuick 2.7
Item {
property alias useStates: actionButton.useStates
property bool enabled: true
property alias updating: actionButton.updating
property int iconSize // Optionnal.
property string icon
......
......@@ -31,9 +31,23 @@ Rectangle {
SmartConnect {
Component.onCompleted: this.connect(call, 'videoRequested', function () {
Utils.openConfirmDialog(window, {
var dialog
// Close window if call is ended.
var endedHandler = function (status) {
if (status === CallModel.CallStatusEnded) {
dialog.close()
call.statusChanged.disconnect(endedHandler)
}
}
call.statusChanged.connect(endedHandler)
dialog = Utils.openConfirmDialog(window, {
descriptionText: qsTr('acceptVideoDescription'),
exitHandler: function (status) {
call.statusChanged.disconnect(endedHandler)
if (status) {
call.acceptVideoRequest()
} else {
......@@ -267,6 +281,7 @@ Rectangle {
enabled: call.videoEnabled
icon: 'camera'
iconSize: CallStyle.actionArea.iconSize
updating: call.updating
onClicked: call.videoEnabled = !enabled
}
......@@ -301,6 +316,7 @@ Rectangle {
ActionSwitch {
enabled: !call.pausedByUser
icon: 'pause'
updating: call.updating
onClicked: call.pausedByUser = enabled
}
......
linphone @ bced2b35
Subproject commit c6c13b2606a2914b743404435afd4a8d920065c0
Subproject commit bced2b35342e86447bd304737b2aecf1e2dacaa7
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