diff --git a/linphone-desktop/assets/images/camera_off_updating.svg b/linphone-desktop/assets/images/camera_off_updating.svg new file mode 100644 index 000000000..61dcaf619 --- /dev/null +++ b/linphone-desktop/assets/images/camera_off_updating.svg @@ -0,0 +1,14 @@ + + + + camera_off + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/linphone-desktop/assets/images/camera_on_updating.svg b/linphone-desktop/assets/images/camera_on_updating.svg new file mode 100644 index 000000000..6b2835676 --- /dev/null +++ b/linphone-desktop/assets/images/camera_on_updating.svg @@ -0,0 +1,13 @@ + + + + camera_on + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/linphone-desktop/assets/images/pause_off_updating.svg b/linphone-desktop/assets/images/pause_off_updating.svg new file mode 100644 index 000000000..e0ca25744 --- /dev/null +++ b/linphone-desktop/assets/images/pause_off_updating.svg @@ -0,0 +1,13 @@ + + + + play_default + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/linphone-desktop/assets/images/pause_on_updating.svg b/linphone-desktop/assets/images/pause_on_updating.svg new file mode 100644 index 000000000..a2fde79f5 --- /dev/null +++ b/linphone-desktop/assets/images/pause_on_updating.svg @@ -0,0 +1,13 @@ + + + + pause_default + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/linphone-desktop/resources.qrc b/linphone-desktop/resources.qrc index 8eb83eb52..68f22694d 100644 --- a/linphone-desktop/resources.qrc +++ b/linphone-desktop/resources.qrc @@ -33,9 +33,11 @@ assets/images/camera_off_hovered.svg assets/images/camera_off_normal.svg assets/images/camera_off_pressed.svg + assets/images/camera_off_updating.svg assets/images/camera_on_hovered.svg assets/images/camera_on_normal.svg assets/images/camera_on_pressed.svg + assets/images/camera_on_updating.svg assets/images/chat_amount.svg assets/images/chat_count.svg assets/images/chat_error.svg @@ -120,9 +122,11 @@ assets/images/pause_off_hovered.svg assets/images/pause_off_normal.svg assets/images/pause_off_pressed.svg + assets/images/pause_off_updating.svg assets/images/pause_on_hovered.svg assets/images/pause_on_normal.svg assets/images/pause_on_pressed.svg + assets/images/pause_on_updating.svg assets/images/record_hovered.svg assets/images/record_normal.svg assets/images/record_pressed.svg diff --git a/linphone-desktop/src/components/call/CallModel.cpp b/linphone-desktop/src/components/call/CallModel.cpp index b670ce4c9..344080f1e 100644 --- a/linphone-desktop/src/components/call/CallModel.cpp +++ b/linphone-desktop/src/components/call/CallModel.cpp @@ -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; +} diff --git a/linphone-desktop/src/components/call/CallModel.hpp b/linphone-desktop/src/components/call/CallModel.hpp index 6af866b95..056c584db 100644 --- a/linphone-desktop/src/components/call/CallModel.hpp +++ b/linphone-desktop/src/components/call/CallModel.hpp @@ -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; diff --git a/linphone-desktop/ui/modules/Common/Animations/BusyIndicator.qml b/linphone-desktop/ui/modules/Common/Animations/BusyIndicator.qml index a62fe70a3..52f8a37ff 100644 --- a/linphone-desktop/ui/modules/Common/Animations/BusyIndicator.qml +++ b/linphone-desktop/ui/modules/Common/Animations/BusyIndicator.qml @@ -17,6 +17,8 @@ BusyIndicator { // --------------------------------------------------------------------------- + visible: running + contentItem: Item { x: parent.width / 2 - width / 2 y: parent.height / 2 - height / 2 diff --git a/linphone-desktop/ui/modules/Common/Form/ActionButton.qml b/linphone-desktop/ui/modules/Common/Form/ActionButton.qml index 59c5f4b19..c6019a0e5 100644 --- a/linphone-desktop/ui/modules/Common/Form/ActionButton.qml +++ b/linphone-desktop/ui/modules/Common/Form/ActionButton.qml @@ -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 diff --git a/linphone-desktop/ui/modules/Common/Form/ActionSwitch.qml b/linphone-desktop/ui/modules/Common/Form/ActionSwitch.qml index 9a9c19d0c..4d59685ec 100644 --- a/linphone-desktop/ui/modules/Common/Form/ActionSwitch.qml +++ b/linphone-desktop/ui/modules/Common/Form/ActionSwitch.qml @@ -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 diff --git a/linphone-desktop/ui/views/App/Calls/Incall.qml b/linphone-desktop/ui/views/App/Calls/Incall.qml index 37079d30f..3d905c4c6 100644 --- a/linphone-desktop/ui/views/App/Calls/Incall.qml +++ b/linphone-desktop/ui/views/App/Calls/Incall.qml @@ -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 } diff --git a/submodules/linphone b/submodules/linphone index c6c13b260..bced2b353 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit c6c13b2606a2914b743404435afd4a8d920065c0 +Subproject commit bced2b35342e86447bd304737b2aecf1e2dacaa7