mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-22 06:08:07 +00:00
feat(ui/views/App/Calls/Incall): video request uses custom Window component
This commit is contained in:
parent
630ec6038b
commit
231f4144dc
8 changed files with 57 additions and 25 deletions
|
|
@ -458,10 +458,6 @@ Server url not configured.</translation>
|
|||
<source>acceptVideoDescription</source>
|
||||
<translation>Your contact would like to turn on video.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acceptVideoTitle</source>
|
||||
<translation>Video requested</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>InviteFriends</name>
|
||||
|
|
|
|||
|
|
@ -458,10 +458,6 @@ Url du serveur non configurée.</translation>
|
|||
<source>acceptVideoDescription</source>
|
||||
<translation>Votre correspondant souhaite ajouter la vidéo.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acceptVideoTitle</source>
|
||||
<translation>Demande de vidéo</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>InviteFriends</name>
|
||||
|
|
|
|||
|
|
@ -261,6 +261,7 @@
|
|||
<file>ui/modules/Common/Window/ApplicationWindow.qml</file>
|
||||
<file>ui/modules/Common/Window/VirtualWindow.qml</file>
|
||||
<file>ui/modules/Common/Window/Window.js</file>
|
||||
<file>ui/modules/Common/Window/Window.qml</file>
|
||||
<file>ui/modules/Linphone/Account/AccountStatus.qml</file>
|
||||
<file>ui/modules/Linphone/Calls/CallControls.qml</file>
|
||||
<file>ui/modules/Linphone/Calls/Calls.qml</file>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ Item {
|
|||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onWheel: wheel.accepted = true
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
|
|||
|
|
@ -29,3 +29,10 @@ function attachVirtualWindow (object, properties, exitStatusHandler) {
|
|||
|
||||
virtualWindow.setContent(object)
|
||||
}
|
||||
|
||||
function detachVirtualWindow () {
|
||||
var object = virtualWindow.unsetContent()
|
||||
if (object) {
|
||||
object.destroy()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
36
linphone-desktop/ui/modules/Common/Window/Window.qml
Normal file
36
linphone-desktop/ui/modules/Common/Window/Window.qml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import QtQuick 2.7
|
||||
import QtQuick.Window 2.2
|
||||
|
||||
import 'Window.js' as Logic
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Window {
|
||||
default property alias _content: content.data
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function attachVirtualWindow () {
|
||||
Logic.attachVirtualWindow.apply(this, arguments)
|
||||
}
|
||||
|
||||
function detachVirtualWindow () {
|
||||
Logic.detachVirtualWindow()
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
|
||||
Rectangle {
|
||||
id: content
|
||||
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
VirtualWindow {
|
||||
id: virtualWindow
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -77,3 +77,4 @@ TooltipArea 1.0 Tooltip/TooltipArea.qml
|
|||
ScrollableListView 1.0 View/ScrollableListView.qml
|
||||
|
||||
ApplicationWindow 1.0 Window/ApplicationWindow.qml
|
||||
Window 1.0 Window/Window.qml
|
||||
|
|
|
|||
|
|
@ -27,12 +27,11 @@ function handleStatusChanged (status) {
|
|||
|
||||
function handleVideoRequested () {
|
||||
var call = incall.call
|
||||
var dialog
|
||||
|
||||
// Close dialog after 10s.
|
||||
var timeout = Utils.setTimeout(incall, 10000, function () {
|
||||
call.statusChanged.disconnect(endedHandler)
|
||||
dialog.close()
|
||||
window.detachVirtualWindow()
|
||||
call.rejectVideoRequest()
|
||||
})
|
||||
|
||||
|
|
@ -41,29 +40,24 @@ function handleVideoRequested () {
|
|||
if (status === Linphone.CallModel.CallStatusEnded) {
|
||||
Utils.clearTimeout(timeout)
|
||||
call.statusChanged.disconnect(endedHandler)
|
||||
dialog.close()
|
||||
window.detachVirtualWindow()
|
||||
}
|
||||
}
|
||||
|
||||
call.statusChanged.connect(endedHandler)
|
||||
|
||||
// Ask video to user.
|
||||
dialog = Utils.openConfirmDialog(window, {
|
||||
window.attachVirtualWindow(Utils.buildDialogUri('ConfirmDialog'), {
|
||||
descriptionText: qsTr('acceptVideoDescription'),
|
||||
exitHandler: function (status) {
|
||||
Utils.clearTimeout(timeout)
|
||||
call.statusChanged.disconnect(endedHandler)
|
||||
}, function (status) {
|
||||
Utils.clearTimeout(timeout)
|
||||
call.statusChanged.disconnect(endedHandler)
|
||||
|
||||
if (status) {
|
||||
call.acceptVideoRequest()
|
||||
} else {
|
||||
call.rejectVideoRequest()
|
||||
}
|
||||
},
|
||||
properties: {
|
||||
modality: Qt.NonModal
|
||||
},
|
||||
title: qsTr('acceptVideoTitle')
|
||||
if (status) {
|
||||
call.acceptVideoRequest()
|
||||
} else {
|
||||
call.rejectVideoRequest()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue