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.
This commit is contained in:
Vasily
2019-02-01 16:38:44 +01:00
parent 33768028b4
commit b6ffa8d30d
7 changed files with 169 additions and 119 deletions
+3 -1
View File
@@ -163,4 +163,6 @@ DISTFILES += \
src/res/qml/LineSeparator.qml \
src/res/qml/utilities_page/keyboard_utils/* \
src/res/qml/utilities_page/desktop_size/* \
src/res/qml/utilities_page/alarm_clock/*
src/res/qml/utilities_page/alarm_clock/* \
src/res/qml/audio_page/dialog_boxes/* \
src/res/qml/audio_page/dialog_boxes/AudioDeleteProfileDialog.qml
+7 -118
View File
@@ -2,7 +2,8 @@ import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import matzman666.advsettings 1.0
import ".."
import ".." //common imports
import "dialog_boxes"
MyStackViewPage {
width: 1200
@@ -11,38 +12,16 @@ MyStackViewPage {
property bool componentCompleted: false
MyDialogOkPopup {
AudioMessageDialog {
id: audioMessageDialog
function showMessage(title, text) {
dialogTitle = title
dialogText = text
open()
}
}
MyDialogOkCancelPopup {
PttDeleteProfileDialog {
id: pttDeleteProfileDialog
property int profileIndex: -1
dialogTitle: "Delete Profile"
dialogText: "Do you really want to delete this ptt profile?"
onClosed: {
if (okClicked) {
AudioTabController.deletePttProfile(profileIndex)
}
}
}
MyDialogOkCancelPopup {
AudioDeleteProfileDialog {
id: audioDeleteProfileDialog
property int profileIndex: -1
dialogTitle: "Delete Profile"
dialogText: "Do you really want to delete this audio profile?"
onClosed: {
if (okClicked) {
AudioTabController.deleteAudioProfile(profileIndex)
pttProfileComboBox.currentIndex = 0
}
}
}
PttControllerConfigDialog {
@@ -50,101 +29,12 @@ MyStackViewPage {
pttControllerConfigClass: AudioTabController
}
MyDialogOkCancelPopup {
PttNewProfileDialog {
id: pttNewProfileDialog
dialogTitle: "Create New PTT Profile"
dialogWidth: 600
dialogHeight: 220
dialogContentItem: ColumnLayout {
RowLayout {
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
MyText {
text: "Name: "
}
MyTextField {
id: pttNewProfileName
keyBoardUID: 590
color: "#cccccc"
text: ""
Layout.fillWidth: true
font.pointSize: 20
function onInputEvent(input) {
pttNewProfileName.text = input
}
}
}
}
onClosed: {
if (okClicked) {
if (pttNewProfileName.text != "") {
AudioTabController.addPttProfile(pttNewProfileName.text)
} else {
audioMessageDialog.showMessage("Create New Profile", "ERROR: No name given.")
}
}
}
function openPopup() {
pttNewProfileName.text = ""
open()
}
}
MyDialogOkCancelPopup {
AudioNewProfileDialog {
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 {
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
MyToggleButton {
id: audioDefaultProfileToggle
Layout.preferredWidth: 250
text: "Make Default"
onCheckedChanged: {
AudioTabController.setAudioProfileDefault(checked, false)
}
}
}
}
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()
}
}
content: ColumnLayout {
@@ -572,7 +462,6 @@ MyStackViewPage {
audioPttRightControllerToggle.checked = AudioTabController.pttRightControllerEnabled
audioPttShowNotificationToggle.checked = AudioTabController.pttShowNotification
audioPttReverseToggle.checked = AudioTabController.micReversePtt
audioDefaultProfileToggle.checked = AudioTabController.audioProfileDefault
componentCompleted = true
}
@@ -0,0 +1,18 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import matzman666.advsettings 1.0
import "../.." //common imports
MyDialogOkCancelPopup {
id: audioDeleteProfileDialog
property int profileIndex: -1
dialogTitle: "Delete Profile"
dialogText: "Do you really want to delete this audio profile?"
onClosed: {
if (okClicked) {
AudioTabController.deleteAudioProfile(profileIndex)
pttProfileComboBox.currentIndex = 0
}
}
}
@@ -0,0 +1,14 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import matzman666.advsettings 1.0
import "../.." //common imports
MyDialogOkPopup {
id: audioMessageDialog
function showMessage(title, text) {
dialogTitle = title
dialogText = text
open()
}
}
@@ -0,0 +1,63 @@
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()
}
}
@@ -0,0 +1,17 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import matzman666.advsettings 1.0
import "../.." //common imports
MyDialogOkCancelPopup {
id: pttDeleteProfileDialog
property int profileIndex: -1
dialogTitle: "Delete Profile"
dialogText: "Do you really want to delete this ptt profile?"
onClosed: {
if (okClicked) {
AudioTabController.deletePttProfile(profileIndex)
}
}
}
@@ -0,0 +1,47 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import matzman666.advsettings 1.0
import "../.." //common imports
MyDialogOkCancelPopup {
id: pttNewProfileDialog
dialogTitle: "Create New PTT Profile"
dialogWidth: 600
dialogHeight: 220
dialogContentItem: ColumnLayout {
RowLayout {
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
MyText {
text: "Name: "
}
MyTextField {
id: pttNewProfileName
keyBoardUID: 590
color: "#cccccc"
text: ""
Layout.fillWidth: true
font.pointSize: 20
function onInputEvent(input) {
pttNewProfileName.text = input
}
}
}
}
onClosed: {
if (okClicked) {
if (pttNewProfileName.text != "") {
AudioTabController.addPttProfile(pttNewProfileName.text)
} else {
audioMessageDialog.showMessage("Create New Profile", "ERROR: No name given.")
}
}
}
function openPopup() {
pttNewProfileName.text = ""
open()
}
}