diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp index 82dc3d4c5..f1d9640bb 100644 --- a/linphone-app/src/components/call/CallModel.cpp +++ b/linphone-app/src/components/call/CallModel.cpp @@ -769,6 +769,10 @@ bool CallModel::getRecording () const { return mRecording; } +bool CallModel::getSnapshotEnabled() const{ + return getVideoEnabled() && getConferenceVideoLayout() != LinphoneEnums::ConferenceLayout::ConferenceLayoutGrid; +} + // ----------------------------------------------------------------------------- void CallModel::sendDtmf (const QString &dtmf) { @@ -891,6 +895,7 @@ void CallModel::setConferenceVideoLayout(LinphoneEnums::ConferenceLayout layout) if( mConferenceVideoLayout != layout){ mConferenceVideoLayout = layout; emit conferenceVideoLayoutChanged(); + emit snapshotEnabledChanged(); } } diff --git a/linphone-app/src/components/call/CallModel.hpp b/linphone-app/src/components/call/CallModel.hpp index 1b721d500..aae73dcc9 100644 --- a/linphone-app/src/components/call/CallModel.hpp +++ b/linphone-app/src/components/call/CallModel.hpp @@ -70,6 +70,8 @@ class CallModel : public QObject { Q_PROPERTY(bool updating READ getUpdating NOTIFY statusChanged) Q_PROPERTY(bool recording READ getRecording NOTIFY recordingChanged) + + Q_PROPERTY(bool snapshotEnabled READ getSnapshotEnabled NOTIFY snapshotEnabledChanged) // Grid doesn't enable snapshot Q_PROPERTY(QVariantList audioStats READ getAudioStats NOTIFY statsUpdated) Q_PROPERTY(QVariantList videoStats READ getVideoStats NOTIFY statsUpdated) @@ -191,6 +193,7 @@ signals: void microMutedChanged (bool status); void cameraEnabledChanged(); void recordingChanged (bool status); + void snapshotEnabledChanged(); void statsUpdated (); void statusChanged (CallStatus status); void videoRequested (); @@ -204,6 +207,7 @@ signals: void transferAddressChanged (const QString &transferAddress); void conferenceVideoLayoutChanged(); + public: void handleCallEncryptionChanged (const std::shared_ptr &call); @@ -249,6 +253,7 @@ public: bool getUpdating () const; bool getRecording () const; + bool getSnapshotEnabled() const; CallEncryption getEncryption () const; bool isSecured () const; diff --git a/linphone-app/ui/views/App/Calls/Incall.qml b/linphone-app/ui/views/App/Calls/Incall.qml index cfcfc09c3..5e1838dcf 100644 --- a/linphone-app/ui/views/App/Calls/Incall.qml +++ b/linphone-app/ui/views/App/Calls/Incall.qml @@ -193,23 +193,17 @@ Rectangle { isCustom: true backgroundRadius: 90 - colorSet: incall.call.recording ? CallStyle.buttons.recordOn : CallStyle.buttons.recordOff + colorSet: CallStyle.buttons.record visible: SettingsModel.callRecorderEnabled + toggled: incall.call.recording onClicked: { var call = incall.call - return !incall.call.recording + return !toggled ? call.startRecording() : call.stopRecording() } - - onVisibleChanged: { - if (!visible) { - call.stopRecording() - } - } - - tooltipText: !incall.call.recording + tooltipText: !toggled ? qsTr('startRecordingLabel') : qsTr('stopRecordingLabel') } diff --git a/linphone-app/ui/views/App/Calls/IncallFullscreenWindow.qml b/linphone-app/ui/views/App/Calls/IncallFullscreenWindow.qml index 55aaad0dc..5d7fbc113 100644 --- a/linphone-app/ui/views/App/Calls/IncallFullscreenWindow.qml +++ b/linphone-app/ui/views/App/Calls/IncallFullscreenWindow.qml @@ -261,17 +261,17 @@ Window { ActionButton { id: recordingSwitch - property bool recording : call && call.recording + toggled: call && call.recording isCustom: true backgroundRadius: 90 - colorSet: recording ? CallFullscreenStyle.buttons.recordOn : CallFullscreenStyle.buttons.recordOff + colorSet: CallFullscreenStyle.buttons.record visible: SettingsModel.callRecorderEnabled - - onClicked: !recording + + onClicked: !toggled ? call.startRecording() : call.stopRecording() - tooltipText: !recordingSwitch.recording + tooltipText: !toggled ? qsTr('startRecordingLabel') : qsTr('stopRecordingLabel') } diff --git a/linphone-app/ui/views/App/Calls/VideoConference.qml b/linphone-app/ui/views/App/Calls/VideoConference.qml index f04eb1dd2..7f9b900be 100644 --- a/linphone-app/ui/views/App/Calls/VideoConference.qml +++ b/linphone-app/ui/views/App/Calls/VideoConference.qml @@ -142,17 +142,30 @@ Rectangle { colorSet: VideoConferenceStyle.buttons.screenSharing visible: false //TODO } - ActionButton{ + ActionButton { + id: recordingSwitch isCustom: true backgroundRadius: width/2 - colorSet: VideoConferenceStyle.buttons.recordOff - visible: false //TODO + colorSet: VideoConferenceStyle.buttons.record + property CallModel callModel: conference.callModel + onCallModelChanged: if(!callModel) callModel.stopRecording() + visible: SettingsModel.callRecorderEnabled && callModel + toggled: callModel.recording + + onClicked: { + return !toggled + ? callModel.startRecording() + : callModel.stopRecording() + } + tooltipText: !toggled ? 'Start Recording' : 'Stop Recording' } ActionButton{ isCustom: true backgroundRadius: width/2 colorSet: VideoConferenceStyle.buttons.screenshot - visible: false //TODO + visible: conference.callModel.snapshotEnabled + onClicked: conference.callModel.takeSnapshot() + tooltipText:'take Snapshot' } ActionButton{ isCustom: true diff --git a/linphone-app/ui/views/App/Calls/VideoConferenceFullscreen.qml b/linphone-app/ui/views/App/Calls/VideoConferenceFullscreen.qml index 5b2bf80af..f9248d82d 100644 --- a/linphone-app/ui/views/App/Calls/VideoConferenceFullscreen.qml +++ b/linphone-app/ui/views/App/Calls/VideoConferenceFullscreen.qml @@ -182,17 +182,30 @@ Window { colorSet: VideoConferenceStyle.buttons.screenSharing visible: false //TODO } - ActionButton{ + ActionButton { + id: recordingSwitch isCustom: true backgroundRadius: width/2 - colorSet: VideoConferenceStyle.buttons.recordOff - visible: false //TODO + colorSet: VideoConferenceStyle.buttons.record + property CallModel callModel: conference.callModel + onCallModelChanged: if(!callModel) callModel.stopRecording() + visible: SettingsModel.callRecorderEnabled && callModel + toggled: callModel.recording + + onClicked: { + return !toggled + ? callModel.startRecording() + : callModel.stopRecording() + } + tooltipText: !toggled? 'Start Recording' : 'Stop Recording' } ActionButton{ isCustom: true backgroundRadius: width/2 colorSet: VideoConferenceStyle.buttons.screenshot - visible: false //TODO + visible: conference.callModel.snapshotEnabled + onClicked: conference.callModel.takeSnapshot() + tooltipText:'take Snapshot' } ActionButton{ isCustom: true diff --git a/linphone-app/ui/views/App/Styles/Calls/CallFullscreenStyle.qml b/linphone-app/ui/views/App/Styles/Calls/CallFullscreenStyle.qml index afb562202..429fbef4b 100644 --- a/linphone-app/ui/views/App/Styles/Calls/CallFullscreenStyle.qml +++ b/linphone-app/ui/views/App/Styles/Calls/CallFullscreenStyle.qml @@ -167,27 +167,18 @@ QtObject { property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'sc_h_b_fg').color property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'sc_p_b_fg').color } - property QtObject recordOn: QtObject { + property QtObject record: QtObject { property int iconSize: 40 property string icon : 'record_custom' - property string name : 'recordOn' - property color backgroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_n', icon, 'sc_p_b_bg').color - property color backgroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_h', icon, 'sc_h_b_bg').color - property color backgroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_p', icon, 'sc_p_b_bg').color - property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, 'sc_p_b_fg').color - property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'sc_h_b_fg').color - property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'sc_p_b_fg').color - } - property QtObject recordOff: QtObject { - property int iconSize: 40 - property string icon : 'record_custom' - property string name : 'recordOff' + property string name : 'record' property color backgroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_n', icon, 'sc_n_b_bg').color property color backgroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_h', icon, 'sc_h_b_bg').color property color backgroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_p', icon, 'sc_p_b_bg').color + property color backgroundUpdatingColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_c', icon, 'sc_p_b_bg').color property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, 'sc_n_b_fg').color property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'sc_h_b_fg').color property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'sc_p_b_fg').color + property color foregroundUpdatingColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_c', icon, 'sc_p_b_fg').color } property QtObject fullscreen: QtObject { property int iconSize: 40 diff --git a/linphone-app/ui/views/App/Styles/Calls/CallStyle.qml b/linphone-app/ui/views/App/Styles/Calls/CallStyle.qml index 8d50ff8b9..1fc8f003d 100644 --- a/linphone-app/ui/views/App/Styles/Calls/CallStyle.qml +++ b/linphone-app/ui/views/App/Styles/Calls/CallStyle.qml @@ -167,27 +167,18 @@ QtObject { property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'me_h_b_fg').color property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'me_p_b_fg').color } - property QtObject recordOn: QtObject { + property QtObject record: QtObject { property int iconSize: 40 property string icon : 'record_custom' - property string name : 'recordOn' - property color backgroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_n', icon, 'me_p_b_bg').color - property color backgroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_h', icon, 'me_h_b_bg').color - property color backgroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_p', icon, 'me_p_b_bg').color - property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, 'me_p_b_fg').color - property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'me_h_b_fg').color - property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'me_p_b_fg').color - } - property QtObject recordOff: QtObject { - property int iconSize: 40 - property string icon : 'record_custom' - property string name : 'recordOff' + property string name : 'record' property color backgroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_n', icon, 'me_n_b_bg').color property color backgroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_h', icon, 'me_h_b_bg').color property color backgroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_p', icon, 'me_p_b_bg').color + property color backgroundUpdatingColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_c', icon, 'me_p_b_bg').color property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, 'me_n_b_fg').color property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'me_h_b_fg').color property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'me_p_b_fg').color + property color foregroundUpdatingColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_c', icon, 'me_p_b_fg').color } property QtObject fullscreen: QtObject { property int iconSize: 40 diff --git a/linphone-app/ui/views/App/Styles/Calls/VideoConferenceStyle.qml b/linphone-app/ui/views/App/Styles/Calls/VideoConferenceStyle.qml index a6599176c..a3bfb13f4 100644 --- a/linphone-app/ui/views/App/Styles/Calls/VideoConferenceStyle.qml +++ b/linphone-app/ui/views/App/Styles/Calls/VideoConferenceStyle.qml @@ -182,27 +182,18 @@ QtObject { property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'sc_h_b_fg').color property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'sc_p_b_fg').color } - property QtObject recordOn: QtObject { + property QtObject record: QtObject { property int iconSize: 40 property string icon : 'record_custom' - property string name : 'recordOn' - property color backgroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_n', icon, 'sc_n_b_bg').color - property color backgroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_h', icon, 'sc_h_b_bg').color - property color backgroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_p', icon, 'sc_p_b_bg').color - property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, 'sc_n_b_fg').color - property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'sc_h_b_fg').color - property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'sc_p_b_fg').color - } - property QtObject recordOff: QtObject { - property int iconSize: 40 - property string icon : 'record_custom' - property string name : 'recordOff' + property string name : 'record' property color backgroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_n', icon, 'sc_n_b_bg').color property color backgroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_h', icon, 'sc_h_b_bg').color property color backgroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_p', icon, 'sc_p_b_bg').color + property color backgroundUpdatingColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_c', icon, 'sc_p_b_bg').color property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, 'sc_n_b_fg').color property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'sc_h_b_fg').color property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'sc_p_b_fg').color + property color foregroundUpdatingColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_c', icon, 'sc_p_b_fg').color } property QtObject screenshot: QtObject { property int iconSize: 40