2023-07-04 19:57:59 +02:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
|
|
|
|
|
|
|
|
import QtQuick
|
2023-10-24 12:10:29 +02:00
|
|
|
import StudioControls as StudioControls
|
|
|
|
|
import StudioTheme as StudioTheme
|
|
|
|
|
import HelperWidgets as HelperWidgets
|
2023-07-04 19:57:59 +02:00
|
|
|
|
2023-10-24 12:10:29 +02:00
|
|
|
StudioControls.PopupDialog {
|
2023-09-18 17:34:39 +02:00
|
|
|
id: root
|
2023-10-24 12:10:29 +02:00
|
|
|
|
2023-09-19 11:49:27 +02:00
|
|
|
property alias backend: form.backend
|
2023-08-29 18:10:37 +02:00
|
|
|
|
2024-05-13 15:36:03 +02:00
|
|
|
keepOpen: form.keepOpen
|
|
|
|
|
|
2023-07-27 12:00:45 +02:00
|
|
|
titleBar: Row {
|
|
|
|
|
spacing: 30 // TODO
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
|
|
Text {
|
|
|
|
|
color: StudioTheme.Values.themeTextColor
|
|
|
|
|
text: qsTr("Target")
|
|
|
|
|
font.pixelSize: StudioTheme.Values.myFontSize
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2023-10-24 12:10:29 +02:00
|
|
|
|
2023-09-08 15:49:58 +02:00
|
|
|
HelperWidgets.ToolTipArea {
|
2023-08-31 16:24:18 +02:00
|
|
|
anchors.fill: parent
|
2023-09-21 14:48:21 +02:00
|
|
|
tooltip: qsTr("Sets the Component that is connected to a <b>Signal</b>.")
|
2023-08-31 16:24:18 +02:00
|
|
|
}
|
2023-07-27 12:00:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StudioControls.TopLevelComboBox {
|
|
|
|
|
id: target
|
2023-08-14 11:03:02 +02:00
|
|
|
style: StudioTheme.Values.connectionPopupControlStyle
|
|
|
|
|
width: 180
|
2023-07-27 12:00:45 +02:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2023-08-29 18:10:37 +02:00
|
|
|
model: backend.signal.id.model ?? 0
|
|
|
|
|
|
|
|
|
|
onActivated: backend.signal.id.activateIndex(target.currentIndex)
|
|
|
|
|
property int currentTypeIndex: backend.signal.id.currentIndex ?? 0
|
|
|
|
|
onCurrentTypeIndexChanged: target.currentIndex = target.currentTypeIndex
|
2023-07-27 12:00:45 +02:00
|
|
|
}
|
2023-07-04 19:57:59 +02:00
|
|
|
}
|
2023-07-27 12:00:45 +02:00
|
|
|
|
2023-08-29 18:10:37 +02:00
|
|
|
ConnectionsDialogForm {
|
2023-09-19 11:49:27 +02:00
|
|
|
id: form
|
2023-09-18 17:34:39 +02:00
|
|
|
|
2024-05-13 15:36:03 +02:00
|
|
|
parentWindow: root.window
|
|
|
|
|
|
2023-09-19 11:49:27 +02:00
|
|
|
Connections {
|
|
|
|
|
target: root.backend
|
2023-09-19 18:17:01 +02:00
|
|
|
function onPopupShouldClose() {
|
2023-09-19 11:49:27 +02:00
|
|
|
root.close()
|
|
|
|
|
}
|
2023-11-09 17:37:52 +01:00
|
|
|
function onPopupShouldOpen() {
|
2023-11-16 18:34:39 +01:00
|
|
|
Qt.callLater(root.showGlobal)
|
2023-11-09 17:37:52 +01:00
|
|
|
}
|
2023-09-19 11:49:27 +02:00
|
|
|
}
|
|
|
|
|
}
|
2023-07-04 19:57:59 +02:00
|
|
|
}
|