Refactor audio proximity enable button into separate file
This commit is contained in:
@@ -5,6 +5,7 @@ import matzman666.advsettings 1.0
|
|||||||
import ".." //common imports
|
import ".." //common imports
|
||||||
import "dialog_boxes"
|
import "dialog_boxes"
|
||||||
import "device_selector"
|
import "device_selector"
|
||||||
|
import "proximity"
|
||||||
|
|
||||||
MyStackViewPage {
|
MyStackViewPage {
|
||||||
width: 1200
|
width: 1200
|
||||||
@@ -46,13 +47,7 @@ MyStackViewPage {
|
|||||||
}
|
}
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: 18
|
spacing: 18
|
||||||
MyToggleButton {
|
ProximityToggle {
|
||||||
id: audioMuteProximitySensorToggle
|
|
||||||
Layout.preferredWidth: 600
|
|
||||||
text: "Proximity Sensor Mutes/Unmutes Microphone"
|
|
||||||
onClicked: {
|
|
||||||
AudioTabController.setMicProximitySensorCanMute(checked, false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
RowLayout {
|
RowLayout {
|
||||||
MyToggleButton {
|
MyToggleButton {
|
||||||
@@ -228,12 +223,6 @@ MyStackViewPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (AudioTabController.micDeviceIndex < 0) {
|
|
||||||
audioMuteProximitySensorToggle.enabled = false
|
|
||||||
} else {
|
|
||||||
audioMuteProximitySensorToggle.enabled = true
|
|
||||||
audioMuteProximitySensorToggle.checked = AudioTabController.micProximitySensorCanMute
|
|
||||||
}
|
|
||||||
reloadPttProfiles()
|
reloadPttProfiles()
|
||||||
reloadAudioProfiles()
|
reloadAudioProfiles()
|
||||||
audioPttEnabledToggle.checked = AudioTabController.pttEnabled
|
audioPttEnabledToggle.checked = AudioTabController.pttEnabled
|
||||||
@@ -245,17 +234,11 @@ MyStackViewPage {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: AudioTabController
|
target: AudioTabController
|
||||||
onMicProximitySensorCanMuteChanged: {
|
|
||||||
audioMuteProximitySensorToggle.checked = AudioTabController.micProximitySensorCanMute
|
|
||||||
}
|
|
||||||
onMicReversePttChanged: {
|
onMicReversePttChanged: {
|
||||||
audioPttReverseToggle.checked = AudioTabController.micReversePtt
|
audioPttReverseToggle.checked = AudioTabController.micReversePtt
|
||||||
}
|
}
|
||||||
onPttEnabledChanged: {
|
onPttEnabledChanged: {
|
||||||
audioPttEnabledToggle.checked = AudioTabController.pttEnabled
|
audioPttEnabledToggle.checked = AudioTabController.pttEnabled
|
||||||
}
|
|
||||||
onPttActiveChanged: {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
onPttShowNotificationChanged: {
|
onPttShowNotificationChanged: {
|
||||||
audioPttShowNotificationToggle.checked = AudioTabController.pttShowNotification
|
audioPttShowNotificationToggle.checked = AudioTabController.pttShowNotification
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import QtQuick 2.7
|
||||||
|
import QtQuick.Controls 2.0
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
import matzman666.advsettings 1.0
|
||||||
|
import "../.." //common imports
|
||||||
|
|
||||||
|
MyToggleButton {
|
||||||
|
id: audioMuteProximitySensorToggle
|
||||||
|
Layout.preferredWidth: 600
|
||||||
|
text: "Proximity Sensor Mutes/Unmutes Microphone"
|
||||||
|
onClicked: {
|
||||||
|
AudioTabController.setMicProximitySensorCanMute(checked, false)
|
||||||
|
}
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (AudioTabController.micDeviceIndex < 0) {
|
||||||
|
audioMuteProximitySensorToggle.enabled = false
|
||||||
|
} else {
|
||||||
|
audioMuteProximitySensorToggle.enabled = true
|
||||||
|
audioMuteProximitySensorToggle.checked = AudioTabController.micProximitySensorCanMute
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Connections {
|
||||||
|
target: AudioTabController
|
||||||
|
onMicProximitySensorCanMuteChanged: {
|
||||||
|
audioMuteProximitySensorToggle.checked = AudioTabController.micProximitySensorCanMute
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user