Skip to content
Snippets Groups Projects
Commit 48536ecc authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

mainoverlay: add stop sharing screen options

Gitlab: #409

Change-Id: I4ceb5835b0b5e218d0550fbc3e2f0787bdd249f9
parent b6aadb12
Branches
Tags
No related merge requests found
<?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
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!-- 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" <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"> 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="Icones_Outline">
<g id="Laptop_Black_24dp"> <g id="Laptop_Black_24dp">
<g transform="translate(2.000000, 5.000000)"> <g transform="translate(2.000000, 5.000000)">
<g id="Shape"> <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 <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.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.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
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 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-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"/> 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>
<g id="Line-2"> <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> </g>
</g> </g>
......
<?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>
...@@ -83,7 +83,6 @@ ...@@ -83,7 +83,6 @@
<file>images/icons/baseline-people-24px.svg</file> <file>images/icons/baseline-people-24px.svg</file>
<file>images/icons/ic_high_quality_24px.svg</file> <file>images/icons/ic_high_quality_24px.svg</file>
<file>images/icons/insert_photo-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/round-add_a_photo-24px.svg</file>
<file>images/icons/ic_mic_white_24dp.png</file> <file>images/icons/ic_mic_white_24dp.png</file>
<file>images/icons/ic_play_white_24dp.png</file> <file>images/icons/ic_play_white_24dp.png</file>
...@@ -137,6 +136,7 @@ ...@@ -137,6 +136,7 @@
<file>images/icons/quote.svg</file> <file>images/icons/quote.svg</file>
<file>images/icons/plugins-24px.svg</file> <file>images/icons/plugins-24px.svg</file>
<file>images/icons/record_black_24dp.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/share_screen_black_24dp.svg</file>
<file>images/icons/chat_black_24dp.svg</file> <file>images/icons/chat_black_24dp.svg</file>
<file>images/icons/add_people_black_24dp.svg</file> <file>images/icons/add_people_black_24dp.svg</file>
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
*/ */
#include "avadapter.h" #include "avadapter.h"
#include "lrcinstance.h"
#include "qtutils.h" #include "qtutils.h"
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
...@@ -39,6 +37,13 @@ AvAdapter::AvAdapter(LRCInstance* instance, QObject* parent) ...@@ -39,6 +37,13 @@ AvAdapter::AvAdapter(LRCInstance* instance, QObject* parent)
deviceListSize_ = avModel.getDevices().size(); deviceListSize_ = avModel.getDevices().size();
connect(&avModel, &lrc::api::AVModel::deviceEvent, this, &AvAdapter::slotDeviceEvent); 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 QVariantMap
...@@ -236,6 +241,15 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig ...@@ -236,6 +241,15 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig
#endif #endif
} }
void
AvAdapter::stopSharingScreen()
{
auto callId = getCurrentCallId();
if (!callId.isEmpty())
lrcInstance_->avModel().switchInputTo(lrcInstance_->avModel().getCurrentVideoCaptureDevice(),
callId);
}
void void
AvAdapter::startAudioMeter(bool async) AvAdapter::startAudioMeter(bool async)
{ {
...@@ -251,10 +265,14 @@ AvAdapter::stopAudioMeter(bool async) ...@@ -251,10 +265,14 @@ AvAdapter::stopAudioMeter(bool async)
QString QString
AvAdapter::getCurrentCallId() AvAdapter::getCurrentCallId()
{ {
try {
const auto& convInfo = lrcInstance_->getConversationFromConvUid( const auto& convInfo = lrcInstance_->getConversationFromConvUid(
lrcInstance_->get_selectedConvUid()); lrcInstance_->get_selectedConvUid());
auto call = lrcInstance_->getCallInfoForConversation(convInfo); auto call = lrcInstance_->getCallInfoForConversation(convInfo);
return call ? call->id : QString(); return call ? call->id : QString();
} catch (...) {
return QString();
}
} }
void void
......
...@@ -19,14 +19,17 @@ ...@@ -19,14 +19,17 @@
#pragma once #pragma once
#include "qmladapterbase.h" #include "qmladapterbase.h"
#include "lrcinstance.h"
#include <QObject> #include <QObject>
#include <QVariant> #include <QVariant>
#include <QString> #include <QString>
#include <qtutils.h>
class AvAdapter final : public QmlAdapterBase class AvAdapter final : public QmlAdapterBase
{ {
Q_OBJECT Q_OBJECT
QML_PROPERTY(lrc::api::video::DeviceType, currentRenderingDeviceType)
public: public:
explicit AvAdapter(LRCInstance* instance, QObject* parent = nullptr); explicit AvAdapter(LRCInstance* instance, QObject* parent = nullptr);
...@@ -69,6 +72,9 @@ protected: ...@@ -69,6 +72,9 @@ protected:
// Select screen area to display (from all screens). // Select screen area to display (from all screens).
Q_INVOKABLE void shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned height); 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 startAudioMeter(bool async);
Q_INVOKABLE void stopAudioMeter(bool async); Q_INVOKABLE void stopAudioMeter(bool async);
......
...@@ -208,6 +208,7 @@ Item { ...@@ -208,6 +208,7 @@ Item {
property string exitFullScreen: qsTr("Exit full screen") property string exitFullScreen: qsTr("Exit full screen")
property string fullScreen: qsTr("Full screen") property string fullScreen: qsTr("Full screen")
property string shareScreen: qsTr("Share screen") property string shareScreen: qsTr("Share screen")
property string stopSharingScreen: qsTr("Stop sharing screen")
property string shareScreenArea: qsTr("Share screen area") property string shareScreenArea: qsTr("Share screen area")
property string shareFile: qsTr("Share file") property string shareFile: qsTr("Share file")
property string viewPlugin: qsTr("View plugin") property string viewPlugin: qsTr("View plugin")
......
...@@ -39,6 +39,7 @@ Control { ...@@ -39,6 +39,7 @@ Control {
signal addToConferenceClicked signal addToConferenceClicked
signal transferClicked // TODO: bind this signal transferClicked // TODO: bind this
signal shareScreenClicked signal shareScreenClicked
signal stopSharingScreenClicked
signal shareScreenAreaClicked // TODO: bind this signal shareScreenAreaClicked // TODO: bind this
signal pluginsClicked signal pluginsClicked
...@@ -120,7 +121,9 @@ Control { ...@@ -120,7 +121,9 @@ Control {
AVModel.setDefaultDevice(deviceId) AVModel.setDefaultDevice(deviceId)
} }
AvAdapter.selectVideoInputDeviceById(deviceId) AvAdapter.selectVideoInputDeviceById(deviceId)
} catch(err){ console.warn(err.message) } } catch (err) {
console.warn(err.message)
}
} }
} }
] ]
...@@ -185,10 +188,17 @@ Control { ...@@ -185,10 +188,17 @@ Control {
}, },
Action { Action {
id: shareAction id: shareAction
onTriggered: root.shareScreenClicked() onTriggered: AvAdapter.currentRenderingDeviceType === Video.DeviceType.DISPLAY ?
icon.source: "qrc:/images/icons/share_screen_black_24dp.svg" root.stopSharingScreenClicked() :
icon.color: "white" root.shareScreenClicked()
text: JamiStrings.shareScreen 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 property real size: 34
}, },
Action { Action {
...@@ -221,7 +231,7 @@ Control { ...@@ -221,7 +231,7 @@ Control {
} }
function reset() { function reset() {
CallOverlayModel.clearControls(); CallOverlayModel.clearControls()
// centered controls // centered controls
CallOverlayModel.addPrimaryControl(muteAudioAction) CallOverlayModel.addPrimaryControl(muteAudioAction)
...@@ -286,7 +296,8 @@ Control { ...@@ -286,7 +296,8 @@ Control {
spacing: itemSpacing spacing: itemSpacing
property int overflowIndex: { 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) return Math.min(overflowItemCount, maxItems)
} }
property int nOverflowItems: overflowItemCount - overflowIndex property int nOverflowItems: overflowItemCount - overflowIndex
...@@ -348,8 +359,18 @@ Control { ...@@ -348,8 +359,18 @@ Control {
ScrollIndicator.vertical: ScrollIndicator {} ScrollIndicator.vertical: ScrollIndicator {}
add: Transition { add: Transition {
NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 80 } NumberAnimation {
NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 80 } property: "opacity"
from: 0
to: 1.0
duration: 80
}
NumberAnimation {
property: "scale"
from: 0
to: 1.0
duration: 80
}
} }
} }
} }
...@@ -364,12 +385,9 @@ Control { ...@@ -364,12 +385,9 @@ Control {
id: overflowListView id: overflowListView
spacing: itemSpacing spacing: itemSpacing
implicitHeight: contentHeight implicitHeight: contentHeight
model: overflowButton.popup.visible ? model: overflowButton.popup.visible ? overflowButton.delegateModel : null
overflowButton.delegateModel :
null
ScrollIndicator.vertical: ScrollIndicator {} ScrollIndicator.vertical: ScrollIndicator {}
} }
background: Rectangle { background: Rectangle {
......
...@@ -195,6 +195,7 @@ Item { ...@@ -195,6 +195,7 @@ Item {
function onAddToConferenceClicked() { openContactPicker(ContactList.CONFERENCE) } function onAddToConferenceClicked() { openContactPicker(ContactList.CONFERENCE) }
function onTransferClicked() { openContactPicker(ContactList.TRANSFER) } function onTransferClicked() { openContactPicker(ContactList.TRANSFER) }
function onShareScreenClicked() { openShareScreen() } function onShareScreenClicked() { openShareScreen() }
function onStopSharingScreenClicked() { AvAdapter.stopSharingScreen() }
function onShareScreenAreaClicked() { openShareScreenArea() } function onShareScreenAreaClicked() { openShareScreenArea() }
function onPluginsClicked() { openPluginsMenu() } function onPluginsClicked() { openPluginsMenu() }
} }
......
...@@ -55,10 +55,9 @@ Item { ...@@ -55,10 +55,9 @@ Item {
function openMenu() { function openMenu() {
ContextMenuGenerator.initMenu() ContextMenuGenerator.initMenu()
if (isSIP) { if (isSIP) {
ContextMenuGenerator.addMenuItem(isPaused ? JamiStrings.resumeCall : ContextMenuGenerator.addMenuItem(
JamiStrings.pauseCall, isPaused ? JamiStrings.resumeCall : JamiStrings.pauseCall,
isPaused ? isPaused ? "qrc:/images/icons/play_circle_outline-24px.svg" :
"qrc:/images/icons/play_circle_outline-24px.svg" :
"qrc:/images/icons/pause_circle_outline-24px.svg", "qrc:/images/icons/pause_circle_outline-24px.svg",
function () { function () {
CallAdapter.holdThisCallToggle() CallAdapter.holdThisCallToggle()
...@@ -68,7 +67,8 @@ Item { ...@@ -68,7 +67,8 @@ Item {
function () { function () {
sipInputPanel.open() sipInputPanel.open()
}) })
ContextMenuGenerator.addMenuItem(JamiStrings.transferCall, ContextMenuGenerator.addMenuItem(
JamiStrings.transferCall,
"qrc:/images/icons/phone_forwarded-24px.svg", "qrc:/images/icons/phone_forwarded-24px.svg",
function () { function () {
root.transferCallButtonClicked() root.transferCallButtonClicked()
...@@ -77,21 +77,18 @@ Item { ...@@ -77,21 +77,18 @@ Item {
ContextMenuGenerator.addMenuSeparator() ContextMenuGenerator.addMenuSeparator()
} }
ContextMenuGenerator.addMenuItem(localIsRecording ? JamiStrings.stopRec : ContextMenuGenerator.addMenuItem(
JamiStrings.startRec, localIsRecording ? JamiStrings.stopRec : JamiStrings.startRec,
"qrc:/images/icons/av_icons/fiber_manual_record-24px.svg", "qrc:/images/icons/av_icons/fiber_manual_record-24px.svg",
function () { function () {
CallAdapter.recordThisCallToggle() CallAdapter.recordThisCallToggle()
localIsRecording = CallAdapter.isRecordingThisCall() localIsRecording = CallAdapter.isRecordingThisCall()
}, }, JamiTheme.recordIconColor)
JamiTheme.recordIconColor)
if (isAudioOnly && !isPaused) if (isAudioOnly && !isPaused)
ContextMenuGenerator.addMenuItem( ContextMenuGenerator.addMenuItem(
JamiQmlUtils.callIsFullscreen ? JamiStrings.exitFullScreen : JamiQmlUtils.callIsFullscreen ? JamiStrings.exitFullScreen : JamiStrings.fullScreen,
JamiStrings.fullScreen, JamiQmlUtils.callIsFullscreen ? "qrc:/images/icons/close_fullscreen-24px.svg" :
JamiQmlUtils.callIsFullscreen ?
"qrc:/images/icons/close_fullscreen-24px.svg" :
"qrc:/images/icons/open_in_full-24px.svg", "qrc:/images/icons/open_in_full-24px.svg",
function () { function () {
callStackView.toggleFullScreen() callStackView.toggleFullScreen()
...@@ -99,10 +96,8 @@ Item { ...@@ -99,10 +96,8 @@ Item {
if (!isAudioOnly && !isPaused) { if (!isAudioOnly && !isPaused) {
ContextMenuGenerator.addMenuItem( ContextMenuGenerator.addMenuItem(
JamiQmlUtils.callIsFullscreen ? JamiStrings.exitFullScreen : JamiQmlUtils.callIsFullscreen ? JamiStrings.exitFullScreen : JamiStrings.fullScreen,
JamiStrings.fullScreen, JamiQmlUtils.callIsFullscreen ? "qrc:/images/icons/close_fullscreen-24px.svg" :
JamiQmlUtils.callIsFullscreen ?
"qrc:/images/icons/close_fullscreen-24px.svg" :
"qrc:/images/icons/open_in_full-24px.svg", "qrc:/images/icons/open_in_full-24px.svg",
function () { function () {
callStackView.toggleFullScreen() callStackView.toggleFullScreen()
...@@ -114,8 +109,17 @@ Item { ...@@ -114,8 +109,17 @@ Item {
ContextMenuGenerator.addMenuSeparator() ContextMenuGenerator.addMenuSeparator()
ContextMenuGenerator.addMenuItem(JamiStrings.shareScreen, if (AvAdapter.currentRenderingDeviceType === Video.DeviceType.DISPLAY) {
"qrc:/images/icons/screen_share-24px.svg", 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 () { function () {
if (Qt.application.screens.length === 1) { if (Qt.application.screens.length === 1) {
AvAdapter.shareEntireScreen(0) AvAdapter.shareEntireScreen(0)
...@@ -124,8 +128,9 @@ Item { ...@@ -124,8 +128,9 @@ Item {
SelectScreenWindowCreation.showSelectScreenWindow() SelectScreenWindowCreation.showSelectScreenWindow()
} }
}) })
ContextMenuGenerator.addMenuItem(JamiStrings.shareScreenArea, ContextMenuGenerator.addMenuItem(
"qrc:/images/icons/screen_share-24px.svg", JamiStrings.shareScreenArea,
"qrc:/images/icons/share_screen_black_24dp.svg",
function () { function () {
if (Qt.platform.os !== "windows") { if (Qt.platform.os !== "windows") {
AvAdapter.shareScreenArea(0, 0, 0, 0) AvAdapter.shareScreenArea(0, 0, 0, 0)
...@@ -134,17 +139,19 @@ Item { ...@@ -134,17 +139,19 @@ Item {
ScreenRubberBandCreation.showScreenRubberBandWindow() ScreenRubberBandCreation.showScreenRubberBandWindow()
} }
}) })
ContextMenuGenerator.addMenuItem(JamiStrings.shareFile, }
"qrc:/images/icons/insert_photo-24px.svg",
function (){ ContextMenuGenerator.addMenuItem(
JamiStrings.shareFile,
"qrc:/images/icons/insert_photo-24px.svg", function () {
jamiFileDialog.open() jamiFileDialog.open()
}) })
} }
if (UtilsAdapter.checkShowPluginsButton(true)) { if (UtilsAdapter.checkShowPluginsButton(true)) {
ContextMenuGenerator.addMenuItem(JamiStrings.viewPlugin, ContextMenuGenerator.addMenuItem(
"qrc:/images/icons/extension_24dp.svg", JamiStrings.viewPlugin,
function (){ "qrc:/images/icons/extension_24dp.svg", function () {
root.pluginItemClicked() root.pluginItemClicked()
}) })
} }
...@@ -182,7 +189,8 @@ Item { ...@@ -182,7 +189,8 @@ Item {
Component.onCompleted: { Component.onCompleted: {
ContextMenuGenerator.createBaseContextMenuObjects(root) ContextMenuGenerator.createBaseContextMenuObjects(root)
VideoDeviceContextMenuItemCreation.setVideoContextMenuObject(ContextMenuGenerator.getMenu()) VideoDeviceContextMenuItemCreation.setVideoContextMenuObject(
ContextMenuGenerator.getMenu())
ContextMenuGenerator.getMenu().closed.connect(function () { ContextMenuGenerator.getMenu().closed.connect(function () {
VideoDeviceContextMenuItemCreation.removeCreatedItems() VideoDeviceContextMenuItemCreation.removeCreatedItems()
...@@ -204,4 +212,3 @@ Item { ...@@ -204,4 +212,3 @@ Item {
// } // }
// } // }
} }
...@@ -122,6 +122,8 @@ FrameWrapper::slotRenderingStarted(const QString& id) ...@@ -122,6 +122,8 @@ FrameWrapper::slotRenderingStarted(const QString& id)
} }
isRendering_ = true; isRendering_ = true;
Q_EMIT renderingStarted(id);
} }
void void
...@@ -191,6 +193,13 @@ RenderManager::RenderManager(AVModel& avModel) ...@@ -191,6 +193,13 @@ RenderManager::RenderManager(AVModel& avModel)
{ {
previewFrameWrapper_ = std::make_unique<FrameWrapper>(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(), QObject::connect(previewFrameWrapper_.get(),
&FrameWrapper::frameUpdated, &FrameWrapper::frameUpdated,
[this](const QString& id) { [this](const QString& id) {
......
...@@ -82,6 +82,11 @@ public: ...@@ -82,6 +82,11 @@ public:
void frameMutexUnlock(); void frameMutexUnlock();
Q_SIGNALS: 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. * Emitted each time a frame is ready to be displayed.
* @param id of the renderer * @param id of the renderer
...@@ -214,6 +219,11 @@ public: ...@@ -214,6 +219,11 @@ public:
Q_SIGNALS: Q_SIGNALS:
/*
* Emitted when the preview the preview is started.
*/
void previewFrameStarted();
/* /*
* Emitted when the preview has a new frame ready. * Emitted when the preview has a new frame ready.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment