Files
OpenVR-AdvancedSettings-frame/src/res/qml/audio_page/dialog_boxes/AudioNewProfileDialog.qml
T
Vasily b6ffa8d30d Move dialog boxes into separate folder
Setting the default audio profile has also been moved into the separate
dialog box. This should not change anything and no bugs were found in
testing, however I have no idea how objects in QML/C++ are initialized
or if our current codebase is created with this in mind.
2019-02-01 16:38:44 +01:00

64 lines
1.8 KiB
QML

import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import matzman666.advsettings 1.0
import "../.." //common imports
MyDialogOkCancelPopup {
id: audioNewProfileDialog
dialogTitle: "Create New Audio Profile"
dialogWidth: 600
dialogHeight: 300
dialogContentItem: ColumnLayout {
RowLayout {
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
MyText {
text: "Name: "
}
MyTextField {
id: audioNewProfileName
keyBoardUID: 590
color: "#cccccc"
text: ""
Layout.fillWidth: true
font.pointSize: 20
function onInputEvent(input) {
audioNewProfileName.text = input
}
}
}
RowLayout {
id: test
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
MyToggleButton {
id: audioDefaultProfileToggle
Layout.preferredWidth: 250
text: "Make Default"
onCheckedChanged: {
AudioTabController.setAudioProfileDefault(checked, false)
}
}
Component.onCompleted: {
audioDefaultProfileToggle.checked = AudioTabController.audioProfileDefault
}
}
}
onClosed: {
if (okClicked) {
if (audioNewProfileName.text != "") {
AudioTabController.addAudioProfile(audioNewProfileName.text)
} else {
audioMessageDialog.showMessage("Create New Profile", "ERROR: No name given.")
}
}
}
function openPopup() {
audioNewProfileName.text = ""
open()
}
}