mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 19:38:09 +00:00
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
// =============================================================================
|
|
// Windows (qml) Logic.
|
|
// =============================================================================
|
|
|
|
.import 'qrc:/ui/scripts/Utils/utils.js' as Utils
|
|
|
|
// =============================================================================
|
|
|
|
// Create a dynamic component hover the main content of one window.
|
|
// The object parameter must have a `exitStatus` signal which is used
|
|
// at item destruction.
|
|
//
|
|
// The exit status handler is optional.
|
|
function attachVirtualWindow (component, properties, exitStatusHandler) {
|
|
if (virtualWindow.visible) {
|
|
return
|
|
}
|
|
|
|
var object = Utils.createObject(component, null, {
|
|
properties: properties
|
|
})
|
|
|
|
object.exitStatus.connect(detachVirtualWindow)
|
|
if (exitStatusHandler) {
|
|
object.exitStatus.connect(exitStatusHandler)
|
|
}
|
|
|
|
virtualWindow.setContent(object)
|
|
|
|
window.attachedVirtualWindow()
|
|
}
|
|
|
|
function detachVirtualWindow () {
|
|
var object = virtualWindow.unsetContent()
|
|
if (object) {
|
|
object.destroy()
|
|
window.detachedVirtualWindow()
|
|
}
|
|
}
|