2023-02-22 01:48:49 +03:00
|
|
|
// SPDX-FileCopyrightText: Nheko Contributors
|
2021-03-07 07:57:56 +03:00
|
|
|
//
|
2021-03-05 02:35:15 +03:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-02-18 23:55:29 +03:00
|
|
|
import "../"
|
2023-10-26 02:51:45 +03:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
|
|
|
import im.nheko
|
2021-02-18 23:55:29 +03:00
|
|
|
|
|
|
|
Popup {
|
|
|
|
modal: true
|
|
|
|
|
2022-03-10 22:42:12 +03:00
|
|
|
anchors.centerIn: parent;
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
2021-02-18 23:55:29 +03:00
|
|
|
frameRateCombo.currentIndex = frameRateCombo.find(Settings.screenShareFrameRate);
|
|
|
|
}
|
2023-03-11 16:36:51 +03:00
|
|
|
Component.onDestruction: {
|
|
|
|
CallManager.closeScreenShare();
|
|
|
|
}
|
2021-02-18 23:55:29 +03:00
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
2021-02-22 00:30:10 +03:00
|
|
|
Layout.topMargin: 16
|
|
|
|
Layout.bottomMargin: 16
|
|
|
|
Layout.leftMargin: 8
|
|
|
|
Layout.rightMargin: 8
|
2021-02-18 23:55:29 +03:00
|
|
|
Layout.alignment: Qt.AlignLeft
|
2021-05-28 23:14:59 +03:00
|
|
|
text: qsTr("Share desktop with %1?").arg(room.roomName)
|
2023-06-02 02:29:05 +03:00
|
|
|
color: palette.windowText
|
2021-02-18 23:55:29 +03:00
|
|
|
}
|
|
|
|
|
2023-03-11 16:36:51 +03:00
|
|
|
RowLayout {
|
|
|
|
Layout.leftMargin: 8
|
|
|
|
Layout.rightMargin: 8
|
|
|
|
Layout.bottomMargin: 8
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
|
|
|
text: qsTr("Method:")
|
2023-06-02 02:29:05 +03:00
|
|
|
color: palette.windowText
|
2023-03-11 16:36:51 +03:00
|
|
|
}
|
|
|
|
|
2023-03-27 00:08:43 +03:00
|
|
|
ComboBox {
|
|
|
|
id: screenshareType
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
model: CallManager.screenShareTypeList()
|
2023-06-19 22:22:54 +03:00
|
|
|
onCurrentIndexChanged: CallManager.setScreenShareType(currentIndex);
|
2023-03-27 00:08:43 +03:00
|
|
|
}
|
2023-03-11 16:36:51 +03:00
|
|
|
}
|
|
|
|
|
2021-02-18 23:55:29 +03:00
|
|
|
RowLayout {
|
|
|
|
Layout.leftMargin: 8
|
|
|
|
Layout.rightMargin: 8
|
2021-02-25 01:07:01 +03:00
|
|
|
Layout.bottomMargin: 8
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
|
|
|
text: qsTr("Window:")
|
2023-06-02 02:29:05 +03:00
|
|
|
color: palette.windowText
|
2021-02-25 01:07:01 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox {
|
2023-06-19 02:38:40 +03:00
|
|
|
visible: CallManager.screenShareType == Voip.X11
|
2021-02-25 01:07:01 +03:00
|
|
|
id: windowCombo
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
model: CallManager.windowList()
|
|
|
|
}
|
|
|
|
|
2023-03-11 16:36:51 +03:00
|
|
|
Button {
|
2023-06-19 02:38:40 +03:00
|
|
|
visible: CallManager.screenShareType == Voip.XDP
|
2023-03-11 16:36:51 +03:00
|
|
|
highlighted: !CallManager.screenShareReady
|
|
|
|
text: qsTr("Request screencast")
|
|
|
|
onClicked: {
|
|
|
|
Settings.screenShareHideCursor = hideCursorCheckBox.checked;
|
|
|
|
CallManager.setupScreenShareXDP();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-25 01:07:01 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Layout.leftMargin: 8
|
|
|
|
Layout.rightMargin: 8
|
|
|
|
Layout.bottomMargin: 8
|
2021-02-18 23:55:29 +03:00
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
|
|
|
text: qsTr("Frame rate:")
|
2023-06-02 02:29:05 +03:00
|
|
|
color: palette.windowText
|
2021-02-18 23:55:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
id: frameRateCombo
|
|
|
|
|
2021-02-25 01:07:01 +03:00
|
|
|
Layout.fillWidth: true
|
2021-02-18 23:55:29 +03:00
|
|
|
model: ["25", "20", "15", "10", "5", "2", "1"]
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-02-25 22:45:59 +03:00
|
|
|
GridLayout {
|
|
|
|
columns: 2
|
|
|
|
rowSpacing: 10
|
|
|
|
Layout.margins: 8
|
2021-02-20 19:26:53 +03:00
|
|
|
|
2021-02-25 22:45:59 +03:00
|
|
|
MatrixText {
|
|
|
|
text: qsTr("Include your camera picture-in-picture")
|
|
|
|
}
|
2021-02-20 19:26:53 +03:00
|
|
|
|
2021-02-25 22:45:59 +03:00
|
|
|
ToggleButton {
|
|
|
|
id: pipCheckBox
|
2021-02-18 23:55:29 +03:00
|
|
|
|
2021-02-25 22:45:59 +03:00
|
|
|
enabled: CallManager.cameras.length > 0
|
2022-03-13 22:40:09 +03:00
|
|
|
checked: CallManager.cameras.length > 0 && Settings.screenSharePiP
|
2021-02-25 22:45:59 +03:00
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
}
|
|
|
|
|
|
|
|
MatrixText {
|
|
|
|
text: qsTr("Request remote camera")
|
|
|
|
ToolTip.text: qsTr("View your callee's camera like a regular video call")
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
}
|
2021-02-18 23:55:29 +03:00
|
|
|
|
2021-02-25 22:45:59 +03:00
|
|
|
ToggleButton {
|
|
|
|
id: remoteVideoCheckBox
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
checked: Settings.screenShareRemoteVideo
|
|
|
|
ToolTip.text: qsTr("View your callee's camera like a regular video call")
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
}
|
|
|
|
|
|
|
|
MatrixText {
|
|
|
|
text: qsTr("Hide mouse cursor")
|
|
|
|
}
|
|
|
|
|
|
|
|
ToggleButton {
|
|
|
|
id: hideCursorCheckBox
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
checked: Settings.screenShareHideCursor
|
|
|
|
}
|
2021-02-19 00:53:30 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-02-18 23:55:29 +03:00
|
|
|
RowLayout {
|
|
|
|
Layout.margins: 8
|
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
2023-03-11 16:36:51 +03:00
|
|
|
visible: CallManager.screenShareReady
|
2021-02-18 23:55:29 +03:00
|
|
|
text: qsTr("Share")
|
2021-11-14 04:23:10 +03:00
|
|
|
icon.source: "qrc:/icons/icons/ui/screen-share.svg"
|
2022-03-13 22:40:09 +03:00
|
|
|
|
2021-02-18 23:55:29 +03:00
|
|
|
onClicked: {
|
2022-03-13 22:40:09 +03:00
|
|
|
Settings.screenShareFrameRate = frameRateCombo.currentText;
|
|
|
|
Settings.screenSharePiP = pipCheckBox.checked;
|
|
|
|
Settings.screenShareRemoteVideo = remoteVideoCheckBox.checked;
|
|
|
|
Settings.screenShareHideCursor = hideCursorCheckBox.checked;
|
|
|
|
|
2023-06-19 02:38:40 +03:00
|
|
|
CallManager.sendInvite(room.roomId, Voip.SCREEN, windowCombo.currentIndex);
|
2022-03-13 22:40:09 +03:00
|
|
|
close();
|
2021-02-18 23:55:29 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-25 20:00:55 +03:00
|
|
|
Button {
|
2023-03-11 16:36:51 +03:00
|
|
|
visible: CallManager.screenShareReady
|
2021-02-25 20:00:55 +03:00
|
|
|
text: qsTr("Preview")
|
|
|
|
onClicked: {
|
|
|
|
CallManager.previewWindow(windowCombo.currentIndex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-18 23:55:29 +03:00
|
|
|
Button {
|
|
|
|
text: qsTr("Cancel")
|
|
|
|
onClicked: {
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
background: Rectangle {
|
2023-06-02 02:29:05 +03:00
|
|
|
color: palette.window
|
|
|
|
border.color: palette.windowText
|
2021-02-18 23:55:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|