diff --git a/images/icons/screen_share-24px.svg b/images/icons/screen_share-24px.svg deleted file mode 100644 index 4b14b7cfd82bb68ef4fb637d4245c09dd00f7e14..0000000000000000000000000000000000000000 --- a/images/icons/screen_share-24px.svg +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - <title>Share</title> - <g id="Icones_Outline" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> - <g id="noun_Share-Screen_1050685" transform="translate(2.000000, 5.000000)"> - <g stroke="#000000" stroke-width="1.75"> - <path d="M17.0041051,1.01578125 C17.295919,1.01578125 17.5601151,1.13409316 17.7513632,1.3253413 C17.9426114,1.51658945 18.0609233,1.78078551 18.0609233,2.07259943 L18.0609233,2.07259943 L18.0609233,11.0072585 C18.0609233,11.2990724 17.9426114,11.5632685 17.7513632,11.7545167 C17.5601151,11.9457648 17.295919,12.0640767 17.0041051,12.0640767 L17.0041051,12.0640767 L2.79703125,12.0640767 C2.50521733,12.0640767 2.24102127,11.9457648 2.04977312,11.7545167 C1.85852497,11.5632685 1.74021307,11.2990724 1.74021307,11.0072585 L1.74021307,11.0072585 L1.74021307,2.07259943 C1.74021307,1.78078551 1.85852497,1.51658945 2.04977312,1.3253413 C2.24102127,1.13409316 2.50521733,1.01578125 2.79703125,1.01578125 L2.79703125,1.01578125 Z" id="Shape" fill-rule="nonzero"></path> - <line x1="0.5" y1="14.5" x2="19.5" y2="14.5" id="Line-2" stroke-linecap="square"></line> - </g> - <g id="Path-4" transform="translate(5.539006, 2.795099)" fill="#000000" fill-rule="nonzero"> - <path d="M5.36852273,1.37352273 L5.36852273,-4.84460956e-15 L8.72336648,2.87164773 L5.36852273,5.74305398 L5.36852273,4.08410511 C1.01106534,4.20460227 1.61486985e-15,7.48990057 1.61486985e-15,7.48990057 C0.0258380682,2.27519886 4.19639205,1.49112216 5.36852273,1.37352273 Z" id="Path"></path> - </g> - </g> - </g> -</svg> \ No newline at end of file diff --git a/images/icons/share_screen_black_24dp.svg b/images/icons/share_screen_black_24dp.svg index de0e6a11b1749dab59038fac2f54bb7ac9231036..a27e4b60ba900f01944bb8825db72c3fa197af66 100644 --- a/images/icons/share_screen_black_24dp.svg +++ b/images/icons/share_screen_black_24dp.svg @@ -2,18 +2,18 @@ <!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve"> -<path id="Path" d="M12.6,8.9V7.8l2.6,2.2l-2.6,2.2V11c-3.4,0.1-4.2,2.6-4.2,2.6C8.5,9.6,11.7,9,12.6,8.9z"/> +<path id="Path" d="M12.6,8.9V7.7l2.6,2.2l-2.6,2.2V11c-3.4,0.1-4.3,2.6-4.3,2.6C8.5,9.6,11.7,9,12.6,8.9z"/> <g id="Icones_Outline"> <g id="Laptop_Black_24dp"> <g transform="translate(2.000000, 5.000000)"> <g id="Shape"> - <path d="M17,12H2.8c-0.5,0-0.9-0.2-1.2-0.5C1.2,11.1,1,10.7,1,10.2V1.3c0-0.5,0.2-0.9,0.5-1.2s0.8-0.5,1.2-0.5H17 - c0.5,0,0.9,0.2,1.2,0.5c0.3,0.3,0.5,0.8,0.5,1.2v8.9c0,0.5-0.2,0.9-0.5,1.2S17.5,12,17,12z M2.8,0.9C2.7,0.9,2.6,1,2.5,1 - c0,0.1-0.1,0.2-0.1,0.3v8.9c0,0.1,0,0.2,0.1,0.3c0,0,0.1,0.1,0.3,0.1H17c0.1,0,0.2-0.1,0.3-0.1c0.1-0.1,0.1-0.2,0.1-0.3V1.3 - c0-0.1,0-0.2-0.1-0.3c0,0-0.1-0.1-0.3-0.1C17,0.9,2.8,0.9,2.8,0.9z"/> + <path d="M17.1,12.1H2.7c-0.5,0-0.9-0.2-1.2-0.5c-0.4-0.4-0.6-0.8-0.6-1.3v-9c0-0.5,0.2-0.9,0.5-1.2s0.8-0.5,1.2-0.5h14.5 + c0.5,0,0.9,0.2,1.2,0.5c0.3,0.3,0.5,0.8,0.5,1.2v9c0,0.5-0.2,0.9-0.5,1.2C18,11.8,17.6,12.1,17.1,12.1z M2.7,0.8 + c-0.1,0-0.2,0.1-0.3,0.1c0,0.1-0.1,0.2-0.1,0.3v9c0,0.1,0,0.2,0.1,0.3c0,0,0.1,0.1,0.3,0.1h14.4c0.1,0,0.2-0.1,0.3-0.1 + c0.1-0.1,0.1-0.2,0.1-0.3v-9c0-0.1,0-0.2-0.1-0.3c0,0-0.1-0.1-0.3-0.1C17.1,0.8,2.7,0.8,2.7,0.8z"/> </g> <g id="Line-2"> - <path d="M19.5,14.4h-19c-0.4,0-0.7-0.3-0.7-0.7S0.1,13,0.5,13h19c0.4,0,0.7,0.3,0.7,0.7S19.9,14.4,19.5,14.4z"/> + <path d="M19.6,14.5H0.4c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h19.3c0.4,0,0.7,0.3,0.7,0.7S20,14.5,19.6,14.5z"/> </g> </g> </g> diff --git a/images/icons/share_stop_black_24dp.svg b/images/icons/share_stop_black_24dp.svg new file mode 100644 index 0000000000000000000000000000000000000000..7a6f58cba5195366d7abc846df60e61bc390627d --- /dev/null +++ b/images/icons/share_stop_black_24dp.svg @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve"> +<path id="Path" d="M12.6,8.9V7.8l2.6,2.2l-2.6,2.2V11c-3.4,0.1-4.2,2.6-4.2,2.6C8.5,9.6,11.7,9,12.6,8.9z"/> +<g id="Icones_Outline"> + <g id="Laptop_Black_24dp"> + <g transform="translate(2.000000, 5.000000)"> + <g id="Shape"> + <path d="M17,12H2.8c-0.5,0-0.9-0.2-1.2-0.5C1.2,11.1,1,10.7,1,10.2V1.3c0-0.5,0.2-0.9,0.5-1.2s0.8-0.5,1.2-0.5H17 + c0.5,0,0.9,0.2,1.2,0.5c0.3,0.3,0.5,0.8,0.5,1.2v8.9c0,0.5-0.2,0.9-0.5,1.2S17.5,12,17,12z M2.8,0.9C2.7,0.9,2.6,1,2.5,1 + c0,0.1-0.1,0.2-0.1,0.3v8.9c0,0.1,0,0.2,0.1,0.3c0,0,0.1,0.1,0.3,0.1H17c0.1,0,0.2-0.1,0.3-0.1c0.1-0.1,0.1-0.2,0.1-0.3V1.3 + c0-0.1,0-0.2-0.1-0.3c0,0-0.1-0.1-0.3-0.1C17,0.9,2.8,0.9,2.8,0.9z"/> + </g> + <g id="Line-2"> + <path d="M19.5,14.4h-19c-0.4,0-0.7-0.3-0.7-0.7S0.1,13,0.5,13h19c0.4,0,0.7,0.3,0.7,0.7S19.9,14.4,19.5,14.4z"/> + </g> + </g> + </g> +</g> +<g> + <rect x="2.9" y="10.3" transform="matrix(0.8327 -0.5537 0.5537 0.8327 -4.0847 8.3949)" width="17.9" height="1.4"/> +</g> +</svg> diff --git a/resources.qrc b/resources.qrc index 1b86aec0c01bb7f9a4f36a3036f812de6aa681e8..5adc05f0938ac011ce10eb35c7c7eb0ea470dc9f 100644 --- a/resources.qrc +++ b/resources.qrc @@ -83,7 +83,6 @@ <file>images/icons/baseline-people-24px.svg</file> <file>images/icons/ic_high_quality_24px.svg</file> <file>images/icons/insert_photo-24px.svg</file> - <file>images/icons/screen_share-24px.svg</file> <file>images/icons/round-add_a_photo-24px.svg</file> <file>images/icons/ic_mic_white_24dp.png</file> <file>images/icons/ic_play_white_24dp.png</file> @@ -137,6 +136,7 @@ <file>images/icons/quote.svg</file> <file>images/icons/plugins-24px.svg</file> <file>images/icons/record_black_24dp.svg</file> + <file>images/icons/share_stop_black_24dp.svg</file> <file>images/icons/share_screen_black_24dp.svg</file> <file>images/icons/chat_black_24dp.svg</file> <file>images/icons/add_people_black_24dp.svg</file> diff --git a/src/avadapter.cpp b/src/avadapter.cpp index d8d555ed752f2fa0c7bd52e83ebdda59ad38fcb6..fb7bfb7306677971599b6aa2230d013f2a58c190 100644 --- a/src/avadapter.cpp +++ b/src/avadapter.cpp @@ -19,8 +19,6 @@ */ #include "avadapter.h" - -#include "lrcinstance.h" #include "qtutils.h" #ifdef Q_OS_LINUX @@ -39,6 +37,13 @@ AvAdapter::AvAdapter(LRCInstance* instance, QObject* parent) deviceListSize_ = avModel.getDevices().size(); connect(&avModel, &lrc::api::AVModel::deviceEvent, this, &AvAdapter::slotDeviceEvent); + connect(lrcInstance_->renderer(), &RenderManager::previewFrameStarted, [this]() { + // TODO: listen to the correct signals that are needed to be added in daemon or lrc + auto callId = getCurrentCallId(); + if (!callId.isEmpty()) + set_currentRenderingDeviceType( + lrcInstance_->avModel().getCurrentRenderedDevice(callId).type); + }); } QVariantMap @@ -236,6 +241,15 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig #endif } +void +AvAdapter::stopSharingScreen() +{ + auto callId = getCurrentCallId(); + if (!callId.isEmpty()) + lrcInstance_->avModel().switchInputTo(lrcInstance_->avModel().getCurrentVideoCaptureDevice(), + callId); +} + void AvAdapter::startAudioMeter(bool async) { @@ -251,10 +265,14 @@ AvAdapter::stopAudioMeter(bool async) QString AvAdapter::getCurrentCallId() { - const auto& convInfo = lrcInstance_->getConversationFromConvUid( - lrcInstance_->get_selectedConvUid()); - auto call = lrcInstance_->getCallInfoForConversation(convInfo); - return call ? call->id : QString(); + try { + const auto& convInfo = lrcInstance_->getConversationFromConvUid( + lrcInstance_->get_selectedConvUid()); + auto call = lrcInstance_->getCallInfoForConversation(convInfo); + return call ? call->id : QString(); + } catch (...) { + return QString(); + } } void diff --git a/src/avadapter.h b/src/avadapter.h index c0347999f9fbb8eecaf90caa677151d1bca84c94..9f169df59b0659fc8b68915334568143f988b807 100644 --- a/src/avadapter.h +++ b/src/avadapter.h @@ -19,14 +19,17 @@ #pragma once #include "qmladapterbase.h" +#include "lrcinstance.h" #include <QObject> #include <QVariant> #include <QString> +#include <qtutils.h> class AvAdapter final : public QmlAdapterBase { Q_OBJECT + QML_PROPERTY(lrc::api::video::DeviceType, currentRenderingDeviceType) public: explicit AvAdapter(LRCInstance* instance, QObject* parent = nullptr); @@ -69,6 +72,9 @@ protected: // Select screen area to display (from all screens). Q_INVOKABLE void shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned height); + // Stop sharing the screen + Q_INVOKABLE void stopSharingScreen(); + Q_INVOKABLE void startAudioMeter(bool async); Q_INVOKABLE void stopAudioMeter(bool async); diff --git a/src/constant/JamiStrings.qml b/src/constant/JamiStrings.qml index bd3853aa5056edfaad39b06f2b7fdd7dce776c74..a03edf72a7bbc9acfdd3cfd267a98f1d0ea9dc46 100644 --- a/src/constant/JamiStrings.qml +++ b/src/constant/JamiStrings.qml @@ -208,6 +208,7 @@ Item { property string exitFullScreen: qsTr("Exit full screen") property string fullScreen: qsTr("Full screen") property string shareScreen: qsTr("Share screen") + property string stopSharingScreen: qsTr("Stop sharing screen") property string shareScreenArea: qsTr("Share screen area") property string shareFile: qsTr("Share file") property string viewPlugin: qsTr("View plugin") diff --git a/src/mainview/components/CallActionBar.qml b/src/mainview/components/CallActionBar.qml index 67cdb0613cf9cdfb5099088baad0a5ec64e8baa4..f5e2800b6e0c5c08708f754f3386e38236a72a11 100644 --- a/src/mainview/components/CallActionBar.qml +++ b/src/mainview/components/CallActionBar.qml @@ -39,6 +39,7 @@ Control { signal addToConferenceClicked signal transferClicked // TODO: bind this signal shareScreenClicked + signal stopSharingScreenClicked signal shareScreenAreaClicked // TODO: bind this signal pluginsClicked @@ -102,7 +103,7 @@ Control { lrcInstance: LRCInstance } function accept(index) { - if(listModel.deviceCount() < 1) + if (listModel.deviceCount() < 1) return try { var deviceId = listModel.data( @@ -111,7 +112,7 @@ Control { var deviceName = listModel.data( listModel.index(index, 0), VideoInputDeviceModel.DeviceName) - if(deviceId.length === 0) { + if (deviceId.length === 0) { console.warn("Couldn't find device: " + deviceName) return } @@ -120,7 +121,9 @@ Control { AVModel.setDefaultDevice(deviceId) } AvAdapter.selectVideoInputDeviceById(deviceId) - } catch(err){ console.warn(err.message) } + } catch (err) { + console.warn(err.message) + } } } ] @@ -185,10 +188,17 @@ Control { }, Action { id: shareAction - onTriggered: root.shareScreenClicked() - icon.source: "qrc:/images/icons/share_screen_black_24dp.svg" - icon.color: "white" - text: JamiStrings.shareScreen + onTriggered: AvAdapter.currentRenderingDeviceType === Video.DeviceType.DISPLAY ? + root.stopSharingScreenClicked() : + root.shareScreenClicked() + icon.source: AvAdapter.currentRenderingDeviceType === Video.DeviceType.DISPLAY ? + "qrc:/images/icons/share_stop_black_24dp.svg" : + "qrc:/images/icons/share_screen_black_24dp.svg" + icon.color: AvAdapter.currentRenderingDeviceType === Video.DeviceType.DISPLAY ? + "red" : "white" + text: AvAdapter.currentRenderingDeviceType === Video.DeviceType.DISPLAY ? + JamiStrings.stopSharingScreen : + JamiStrings.shareScreen property real size: 34 }, Action { @@ -221,7 +231,7 @@ Control { } function reset() { - CallOverlayModel.clearControls(); + CallOverlayModel.clearControls() // centered controls CallOverlayModel.addPrimaryControl(muteAudioAction) @@ -286,7 +296,8 @@ Control { spacing: itemSpacing property int overflowIndex: { - var maxItems = Math.floor((overflowRect.remainingSpace - 24) / root.height) - 1 + var maxItems = Math.floor( + (overflowRect.remainingSpace - 24) / root.height) - 1 return Math.min(overflowItemCount, maxItems) } property int nOverflowItems: overflowItemCount - overflowIndex @@ -348,8 +359,18 @@ Control { ScrollIndicator.vertical: ScrollIndicator {} add: Transition { - NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 80 } - NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 80 } + NumberAnimation { + property: "opacity" + from: 0 + to: 1.0 + duration: 80 + } + NumberAnimation { + property: "scale" + from: 0 + to: 1.0 + duration: 80 + } } } } @@ -364,12 +385,9 @@ Control { id: overflowListView spacing: itemSpacing implicitHeight: contentHeight - model: overflowButton.popup.visible ? - overflowButton.delegateModel : - null + model: overflowButton.popup.visible ? overflowButton.delegateModel : null ScrollIndicator.vertical: ScrollIndicator {} - } background: Rectangle { diff --git a/src/mainview/components/CallOverlay.qml b/src/mainview/components/CallOverlay.qml index 175930788198eb82f320e12201c0e6ee94c10978..e4d68709e514763530c1ad4c358615d9cc5f74d5 100644 --- a/src/mainview/components/CallOverlay.qml +++ b/src/mainview/components/CallOverlay.qml @@ -195,6 +195,7 @@ Item { function onAddToConferenceClicked() { openContactPicker(ContactList.CONFERENCE) } function onTransferClicked() { openContactPicker(ContactList.TRANSFER) } function onShareScreenClicked() { openShareScreen() } + function onStopSharingScreenClicked() { AvAdapter.stopSharingScreen() } function onShareScreenAreaClicked() { openShareScreenArea() } function onPluginsClicked() { openPluginsMenu() } } diff --git a/src/mainview/components/CallViewContextMenu.qml b/src/mainview/components/CallViewContextMenu.qml index 9ea09aaa6b5b290f67a395703273396c838ba55d..351813b2908d90927e1d5775ee1589e8151ad1ac 100644 --- a/src/mainview/components/CallViewContextMenu.qml +++ b/src/mainview/components/CallViewContextMenu.qml @@ -52,59 +52,54 @@ Item { menu.close() } - function openMenu(){ + function openMenu() { ContextMenuGenerator.initMenu() - if (isSIP){ - ContextMenuGenerator.addMenuItem(isPaused ? JamiStrings.resumeCall : - JamiStrings.pauseCall, - isPaused ? - "qrc:/images/icons/play_circle_outline-24px.svg" : - "qrc:/images/icons/pause_circle_outline-24px.svg", - function (){ - CallAdapter.holdThisCallToggle() - }) + if (isSIP) { + ContextMenuGenerator.addMenuItem( + isPaused ? JamiStrings.resumeCall : JamiStrings.pauseCall, + isPaused ? "qrc:/images/icons/play_circle_outline-24px.svg" : + "qrc:/images/icons/pause_circle_outline-24px.svg", + function () { + CallAdapter.holdThisCallToggle() + }) ContextMenuGenerator.addMenuItem(JamiStrings.sipInputPanel, "qrc:/images/icons/ic_keypad.svg", - function (){ + function () { sipInputPanel.open() }) - ContextMenuGenerator.addMenuItem(JamiStrings.transferCall, - "qrc:/images/icons/phone_forwarded-24px.svg", - function (){ - root.transferCallButtonClicked() - }) + ContextMenuGenerator.addMenuItem( + JamiStrings.transferCall, + "qrc:/images/icons/phone_forwarded-24px.svg", + function () { + root.transferCallButtonClicked() + }) ContextMenuGenerator.addMenuSeparator() } - ContextMenuGenerator.addMenuItem(localIsRecording ? JamiStrings.stopRec : - JamiStrings.startRec, - "qrc:/images/icons/av_icons/fiber_manual_record-24px.svg", - function (){ - CallAdapter.recordThisCallToggle() - localIsRecording = CallAdapter.isRecordingThisCall() - }, - JamiTheme.recordIconColor) + ContextMenuGenerator.addMenuItem( + localIsRecording ? JamiStrings.stopRec : JamiStrings.startRec, + "qrc:/images/icons/av_icons/fiber_manual_record-24px.svg", + function () { + CallAdapter.recordThisCallToggle() + localIsRecording = CallAdapter.isRecordingThisCall() + }, JamiTheme.recordIconColor) if (isAudioOnly && !isPaused) ContextMenuGenerator.addMenuItem( - JamiQmlUtils.callIsFullscreen ? JamiStrings.exitFullScreen : - JamiStrings.fullScreen, - JamiQmlUtils.callIsFullscreen ? - "qrc:/images/icons/close_fullscreen-24px.svg" : - "qrc:/images/icons/open_in_full-24px.svg", - function (){ - callStackView.toggleFullScreen() + JamiQmlUtils.callIsFullscreen ? JamiStrings.exitFullScreen : JamiStrings.fullScreen, + JamiQmlUtils.callIsFullscreen ? "qrc:/images/icons/close_fullscreen-24px.svg" : + "qrc:/images/icons/open_in_full-24px.svg", + function () { + callStackView.toggleFullScreen() }) if (!isAudioOnly && !isPaused) { ContextMenuGenerator.addMenuItem( - JamiQmlUtils.callIsFullscreen ? JamiStrings.exitFullScreen : - JamiStrings.fullScreen, - JamiQmlUtils.callIsFullscreen ? - "qrc:/images/icons/close_fullscreen-24px.svg" : - "qrc:/images/icons/open_in_full-24px.svg", - function (){ + JamiQmlUtils.callIsFullscreen ? JamiStrings.exitFullScreen : JamiStrings.fullScreen, + JamiQmlUtils.callIsFullscreen ? "qrc:/images/icons/close_fullscreen-24px.svg" : + "qrc:/images/icons/open_in_full-24px.svg", + function () { callStackView.toggleFullScreen() }) @@ -114,39 +109,51 @@ Item { ContextMenuGenerator.addMenuSeparator() - ContextMenuGenerator.addMenuItem(JamiStrings.shareScreen, - "qrc:/images/icons/screen_share-24px.svg", - function (){ - if (Qt.application.screens.length === 1) { - AvAdapter.shareEntireScreen(0) - } else { - SelectScreenWindowCreation.createSelectScreenWindowObject() - SelectScreenWindowCreation.showSelectScreenWindow() - } - }) - ContextMenuGenerator.addMenuItem(JamiStrings.shareScreenArea, - "qrc:/images/icons/screen_share-24px.svg", - function (){ - if (Qt.platform.os !== "windows") { - AvAdapter.shareScreenArea(0, 0, 0, 0) - } else { - ScreenRubberBandCreation.createScreenRubberBandWindowObject() - ScreenRubberBandCreation.showScreenRubberBandWindow() - } - }) - ContextMenuGenerator.addMenuItem(JamiStrings.shareFile, - "qrc:/images/icons/insert_photo-24px.svg", - function (){ - jamiFileDialog.open() - }) + if (AvAdapter.currentRenderingDeviceType === Video.DeviceType.DISPLAY) { + ContextMenuGenerator.addMenuItem( + JamiStrings.stopSharingScreen, + "qrc:/images/icons/share_stop_black_24dp.svg", + function () { + AvAdapter.stopSharingScreen() + }) + } else { + ContextMenuGenerator.addMenuItem( + JamiStrings.shareScreen, + "qrc:/images/icons/share_screen_black_24dp.svg", + function () { + if (Qt.application.screens.length === 1) { + AvAdapter.shareEntireScreen(0) + } else { + SelectScreenWindowCreation.createSelectScreenWindowObject() + SelectScreenWindowCreation.showSelectScreenWindow() + } + }) + ContextMenuGenerator.addMenuItem( + JamiStrings.shareScreenArea, + "qrc:/images/icons/share_screen_black_24dp.svg", + function () { + if (Qt.platform.os !== "windows") { + AvAdapter.shareScreenArea(0, 0, 0, 0) + } else { + ScreenRubberBandCreation.createScreenRubberBandWindowObject() + ScreenRubberBandCreation.showScreenRubberBandWindow() + } + }) + } + + ContextMenuGenerator.addMenuItem( + JamiStrings.shareFile, + "qrc:/images/icons/insert_photo-24px.svg", function () { + jamiFileDialog.open() + }) } if (UtilsAdapter.checkShowPluginsButton(true)) { - ContextMenuGenerator.addMenuItem(JamiStrings.viewPlugin, - "qrc:/images/icons/extension_24dp.svg", - function (){ - root.pluginItemClicked() - }) + ContextMenuGenerator.addMenuItem( + JamiStrings.viewPlugin, + "qrc:/images/icons/extension_24dp.svg", function () { + root.pluginItemClicked() + }) } root.height = ContextMenuGenerator.getMenu().height @@ -182,9 +189,10 @@ Item { Component.onCompleted: { ContextMenuGenerator.createBaseContextMenuObjects(root) - VideoDeviceContextMenuItemCreation.setVideoContextMenuObject(ContextMenuGenerator.getMenu()) + VideoDeviceContextMenuItemCreation.setVideoContextMenuObject( + ContextMenuGenerator.getMenu()) - ContextMenuGenerator.getMenu().closed.connect(function (){ + ContextMenuGenerator.getMenu().closed.connect(function () { VideoDeviceContextMenuItemCreation.removeCreatedItems() }) } @@ -204,4 +212,3 @@ Item { // } // } } - diff --git a/src/rendermanager.cpp b/src/rendermanager.cpp index 22bff5db32ba62c055d9ab2d60f2f076ff3027d5..a60c52a990eef23a17a420d5e1a2cdcf104b43c1 100644 --- a/src/rendermanager.cpp +++ b/src/rendermanager.cpp @@ -122,6 +122,8 @@ FrameWrapper::slotRenderingStarted(const QString& id) } isRendering_ = true; + + Q_EMIT renderingStarted(id); } void @@ -191,6 +193,13 @@ RenderManager::RenderManager(AVModel& avModel) { previewFrameWrapper_ = std::make_unique<FrameWrapper>(avModel_); + QObject::connect(previewFrameWrapper_.get(), + &FrameWrapper::renderingStarted, + [this](const QString& id) { + Q_UNUSED(id); + Q_EMIT previewFrameStarted(); + }); + QObject::connect(previewFrameWrapper_.get(), &FrameWrapper::frameUpdated, [this](const QString& id) { diff --git a/src/rendermanager.h b/src/rendermanager.h index 89105ce8d81d61c035d296dda797bb46d7339460..a4bf076e45367e737f7ebe12f934df5e0ff1c2bc 100644 --- a/src/rendermanager.h +++ b/src/rendermanager.h @@ -82,6 +82,11 @@ public: void frameMutexUnlock(); Q_SIGNALS: + /* + * Emitted once in slotRenderingStarted. + * @param id of the renderer + */ + void renderingStarted(const QString& id); /* * Emitted each time a frame is ready to be displayed. * @param id of the renderer @@ -214,6 +219,11 @@ public: Q_SIGNALS: + /* + * Emitted when the preview the preview is started. + */ + void previewFrameStarted(); + /* * Emitted when the preview has a new frame ready. */