Commit 231f4144 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Calls/Incall): video request uses custom Window component

parent 630ec603
...@@ -458,10 +458,6 @@ Server url not configured.</translation> ...@@ -458,10 +458,6 @@ Server url not configured.</translation>
<source>acceptVideoDescription</source> <source>acceptVideoDescription</source>
<translation>Your contact would like to turn on video.</translation> <translation>Your contact would like to turn on video.</translation>
</message> </message>
<message>
<source>acceptVideoTitle</source>
<translation>Video requested</translation>
</message>
</context> </context>
<context> <context>
<name>InviteFriends</name> <name>InviteFriends</name>
......
...@@ -458,10 +458,6 @@ Url du serveur non configurée.</translation> ...@@ -458,10 +458,6 @@ Url du serveur non configurée.</translation>
<source>acceptVideoDescription</source> <source>acceptVideoDescription</source>
<translation>Votre correspondant souhaite ajouter la vidéo.</translation> <translation>Votre correspondant souhaite ajouter la vidéo.</translation>
</message> </message>
<message>
<source>acceptVideoTitle</source>
<translation>Demande de vidéo</translation>
</message>
</context> </context>
<context> <context>
<name>InviteFriends</name> <name>InviteFriends</name>
......
...@@ -261,6 +261,7 @@ ...@@ -261,6 +261,7 @@
<file>ui/modules/Common/Window/ApplicationWindow.qml</file> <file>ui/modules/Common/Window/ApplicationWindow.qml</file>
<file>ui/modules/Common/Window/VirtualWindow.qml</file> <file>ui/modules/Common/Window/VirtualWindow.qml</file>
<file>ui/modules/Common/Window/Window.js</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/Account/AccountStatus.qml</file>
<file>ui/modules/Linphone/Calls/CallControls.qml</file> <file>ui/modules/Linphone/Calls/CallControls.qml</file>
<file>ui/modules/Linphone/Calls/Calls.qml</file> <file>ui/modules/Linphone/Calls/Calls.qml</file>
......
...@@ -29,6 +29,7 @@ Item { ...@@ -29,6 +29,7 @@ Item {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onWheel: wheel.accepted = true
} }
Rectangle { Rectangle {
......
...@@ -29,3 +29,10 @@ function attachVirtualWindow (object, properties, exitStatusHandler) { ...@@ -29,3 +29,10 @@ function attachVirtualWindow (object, properties, exitStatusHandler) {
virtualWindow.setContent(object) virtualWindow.setContent(object)
} }
function detachVirtualWindow () {
var object = virtualWindow.unsetContent()
if (object) {
object.destroy()
}
}
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 ...@@ -77,3 +77,4 @@ TooltipArea 1.0 Tooltip/TooltipArea.qml
ScrollableListView 1.0 View/ScrollableListView.qml ScrollableListView 1.0 View/ScrollableListView.qml
ApplicationWindow 1.0 Window/ApplicationWindow.qml ApplicationWindow 1.0 Window/ApplicationWindow.qml
Window 1.0 Window/Window.qml
...@@ -27,12 +27,11 @@ function handleStatusChanged (status) { ...@@ -27,12 +27,11 @@ function handleStatusChanged (status) {
function handleVideoRequested () { function handleVideoRequested () {
var call = incall.call var call = incall.call
var dialog
// Close dialog after 10s. // Close dialog after 10s.
var timeout = Utils.setTimeout(incall, 10000, function () { var timeout = Utils.setTimeout(incall, 10000, function () {
call.statusChanged.disconnect(endedHandler) call.statusChanged.disconnect(endedHandler)
dialog.close() window.detachVirtualWindow()
call.rejectVideoRequest() call.rejectVideoRequest()
}) })
...@@ -41,16 +40,16 @@ function handleVideoRequested () { ...@@ -41,16 +40,16 @@ function handleVideoRequested () {
if (status === Linphone.CallModel.CallStatusEnded) { if (status === Linphone.CallModel.CallStatusEnded) {
Utils.clearTimeout(timeout) Utils.clearTimeout(timeout)
call.statusChanged.disconnect(endedHandler) call.statusChanged.disconnect(endedHandler)
dialog.close() window.detachVirtualWindow()
} }
} }
call.statusChanged.connect(endedHandler) call.statusChanged.connect(endedHandler)
// Ask video to user. // Ask video to user.
dialog = Utils.openConfirmDialog(window, { window.attachVirtualWindow(Utils.buildDialogUri('ConfirmDialog'), {
descriptionText: qsTr('acceptVideoDescription'), descriptionText: qsTr('acceptVideoDescription'),
exitHandler: function (status) { }, function (status) {
Utils.clearTimeout(timeout) Utils.clearTimeout(timeout)
call.statusChanged.disconnect(endedHandler) call.statusChanged.disconnect(endedHandler)
...@@ -59,11 +58,6 @@ function handleVideoRequested () { ...@@ -59,11 +58,6 @@ function handleVideoRequested () {
} else { } else {
call.rejectVideoRequest() call.rejectVideoRequest()
} }
},
properties: {
modality: Qt.NonModal
},
title: qsTr('acceptVideoTitle')
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment