From 4b5c9315927ace04418dc2d2a4f5a1359e148612 Mon Sep 17 00:00:00 2001 From: ykeara Date: Tue, 18 Dec 2018 23:17:31 -0600 Subject: [PATCH] unfinished audio settings --- src/res/qml/AudioPage.qml | 123 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 6 deletions(-) diff --git a/src/res/qml/AudioPage.qml b/src/res/qml/AudioPage.qml index 278f934..62dc4f4 100644 --- a/src/res/qml/AudioPage.qml +++ b/src/res/qml/AudioPage.qml @@ -24,7 +24,7 @@ MyStackViewPage { id: pttDeleteProfileDialog property int profileIndex: -1 dialogTitle: "Delete Profile" - dialogText: "Do you really want to delete this profile?" + dialogText: "Do you really want to delete this ptt profile?" onClosed: { if (okClicked) { AudioTabController.deletePttProfile(profileIndex) @@ -32,6 +32,19 @@ MyStackViewPage { } } + MyDialogOkCancelPopup { + id: audioDeleteProfileDialog + property int profileIndex: -1 + dialogTitle: "Delete Profile" + dialogText: "Do you really want to delete this audio profile?" + onClosed: { + //TODO audio delete profile + if (okClicked) { + //AudioTabController.deletePttProfile(profileIndex) + } + } + } + PttControllerConfigDialog { id: pttControllerConfigDialog pttControllerConfigClass: AudioTabController @@ -39,7 +52,7 @@ MyStackViewPage { MyDialogOkCancelPopup { id: pttNewProfileDialog - dialogTitle: "Create New Profile" + dialogTitle: "Create New PTT Profile" dialogWidth: 600 dialogHeight: 220 dialogContentItem: ColumnLayout { @@ -78,6 +91,49 @@ MyStackViewPage { } } + + MyDialogOkCancelPopup { + id: audioNewProfileDialog + dialogTitle: "Create New Audio Profile" + dialogWidth: 600 + dialogHeight: 220 + 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 + } + } + } + } + onClosed: { + if (okClicked) { + if (audioNewProfileName.text != "") { + //TODO call AUDIO add profile + //AudioTabController.addPttProfile(pttNewProfileName.text) + } else { + audioMessageDialog.showMessage("Create New Profile", "ERROR: No name given.") + } + } + } + function openPopup() { + audioNewProfileName.text = "" + open() + } + } + content: ColumnLayout { spacing: 24 @@ -329,16 +385,51 @@ MyStackViewPage { } } RowLayout { - spacing: 18 + spacing: 10 + + MyText { + Layout.preferredWidth: 150 + text: "Audio Profile:" + + } + + MyComboBox { + id: audioProfileComboBox + Layout.preferredWidth: 250 + model: [""] + onCurrentIndexChanged: { + if (currentIndex > 0) { + audioApplyProfileButton.enabled = true + audioDeleteProfileButton.enabled = true + } else { + audioApplyProfileButton.enabled = false + audioDeleteProfileButton.enabled = false + } + } + } + + MyPushButton { + id: audioApplyProfileButton + enabled: true + Layout.preferredWidth: 150 + text: "Apply" + onClicked: { + if (audioProfileComboBox.currentIndex > 0) { + //TODO + // AudioTabController.applyPttProfile(pttProfileComboBox.currentIndex - 1) + audioProfileComboBox.currentIndex = 0 + } + } + } MyText { - Layout.leftMargin: 270 text: "PTT Profile:" + Layout.preferredWidth: 150 } MyComboBox { id: pttProfileComboBox - Layout.fillWidth: true + Layout.preferredWidth: 250 model: [""] onCurrentIndexChanged: { if (currentIndex > 0) { @@ -354,7 +445,7 @@ MyStackViewPage { MyPushButton { id: pttApplyProfileButton enabled: true - Layout.preferredWidth: 200 + Layout.preferredWidth: 150 text: "Apply" onClicked: { if (pttProfileComboBox.currentIndex > 0) { @@ -366,6 +457,26 @@ MyStackViewPage { } RowLayout { spacing: 18 + + MyPushButton { + id: audioDeleteProfileButton + enabled: true + Layout.preferredWidth: 200 + text: "Delete Profile" + onClicked: { + if (audioProfileComboBox.currentIndex > 0) { + audioDeleteProfileDialog.profileIndex = audioProfileComboBox.currentIndex - 1 + audioDeleteProfileDialog.open() + } + } + } + MyPushButton { + Layout.preferredWidth: 200 + text: "New Profile" + onClicked: { + audioNewProfileDialog.openPopup() + } + } Item { Layout.fillWidth: true }