diff --git a/resources/qml/voip/CallDevices.qml b/resources/qml/voip/CallDevices.qml new file mode 100644 index 0000000000000000000000000000000000000000..ee3503ca124d27c346468f5e3943b2121cd53a3a --- /dev/null +++ b/resources/qml/voip/CallDevices.qml @@ -0,0 +1,91 @@ +import QtQuick 2.3 +import QtQuick.Controls 2.3 +import QtQuick.Dialogs 1.3 +import QtQuick.Layouts 1.2 +import im.nheko 1.0 +import "../" + +ApplicationWindow { + + flags: Qt.Dialog + modality: Qt.ApplicationModal + palette: colors + width: columnLayout.implicitWidth + height: columnLayout.implicitHeight + + ColumnLayout { + id: columnLayout + + spacing: 16 + + ColumnLayout { + spacing: 8 + + RowLayout { + + Layout.topMargin: 8 + Layout.leftMargin: 8 + Layout.rightMargin: 8 + + Image { + Layout.preferredWidth: 22 + Layout.preferredHeight: 22 + source: "qrc:/icons/icons/ui/microphone-unmute.png" + } + + ComboBox { + id: micCombo + Layout.fillWidth: true + model: CallManager.mics + } + } + + RowLayout { + + visible: CallManager.cameras.length > 0 + Layout.leftMargin: 8 + Layout.rightMargin: 8 + + Image { + Layout.preferredWidth: 22 + Layout.preferredHeight: 22 + source: "qrc:/icons/icons/ui/video-call.png" + } + + ComboBox { + id: cameraCombo + Layout.fillWidth: true + model: CallManager.cameras + } + } + } + + RowLayout { + + Layout.rightMargin: 8 + Layout.bottomMargin: 8 + + Item { + implicitWidth: 128 + } + + Button { + text: qsTr("Ok") + onClicked: { + Settings.microphone = micCombo.currentText + if (cameraCombo.visible) { + Settings.camera = cameraCombo.currentText + } + close(); + } + } + + Button { + text: qsTr("Cancel") + onClicked: { + close(); + } + } + } + } +} diff --git a/resources/qml/voip/CallInviteBar.qml b/resources/qml/voip/CallInviteBar.qml index 61a3f0ec2907d3013c23f241bd3a55975e24a792..e22ee6451e99f1a10072de5a147c95cbc17ae38e 100644 --- a/resources/qml/voip/CallInviteBar.qml +++ b/resources/qml/voip/CallInviteBar.qml @@ -16,6 +16,13 @@ Rectangle { icon: StandardIcon.Warning } + Component { + id: devicesDialog + + CallDevices { + } + } + RowLayout { id: rowLayout @@ -53,6 +60,24 @@ Rectangle { Layout.fillWidth: true } + ImageButton { + width: 24 + height: 24 + buttonTextColor: "#000000" + image: ":/icons/icons/ui/settings.png" + hoverEnabled: true + ToolTip.visible: hovered + ToolTip.text: "Devices" + onClicked: { + var dialog = devicesDialog.createObject(timelineRoot); + dialog.show(); + } + } + + Item { + implicitWidth: 8 + } + Button { icon.source: CallManager.isVideo ? "qrc:/icons/icons/ui/video-call.png" : "qrc:/icons/icons/ui/place-call.png" palette: colors @@ -78,7 +103,7 @@ Rectangle { } Item { - implicitWidth: 8 + implicitWidth: 4 } Button { diff --git a/resources/res.qrc b/resources/res.qrc index 52157df0a9a208832f9ffb270dc0930587b4a427..ca333978a80075638c81f10ada35740ea16c3892 100644 --- a/resources/res.qrc +++ b/resources/res.qrc @@ -158,6 +158,7 @@ <file>qml/device-verification/Failed.qml</file> <file>qml/device-verification/Success.qml</file> <file>qml/voip/ActiveCallBar.qml</file> + <file>qml/voip/CallDevices.qml</file> <file>qml/voip/CallInviteBar.qml</file> <file>qml/voip/PlaceCall.qml</file> <file>qml/voip/VideoCall.qml</file>