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 "dialog_boxes"
|
||||
import "device_selector"
|
||||
import "proximity"
|
||||
|
||||
MyStackViewPage {
|
||||
width: 1200
|
||||
@@ -46,13 +47,7 @@ MyStackViewPage {
|
||||
}
|
||||
ColumnLayout {
|
||||
spacing: 18
|
||||
MyToggleButton {
|
||||
id: audioMuteProximitySensorToggle
|
||||
Layout.preferredWidth: 600
|
||||
text: "Proximity Sensor Mutes/Unmutes Microphone"
|
||||
onClicked: {
|
||||
AudioTabController.setMicProximitySensorCanMute(checked, false)
|
||||
}
|
||||
ProximityToggle {
|
||||
}
|
||||
RowLayout {
|
||||
MyToggleButton {
|
||||
@@ -228,12 +223,6 @@ MyStackViewPage {
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (AudioTabController.micDeviceIndex < 0) {
|
||||
audioMuteProximitySensorToggle.enabled = false
|
||||
} else {
|
||||
audioMuteProximitySensorToggle.enabled = true
|
||||
audioMuteProximitySensorToggle.checked = AudioTabController.micProximitySensorCanMute
|
||||
}
|
||||
reloadPttProfiles()
|
||||
reloadAudioProfiles()
|
||||
audioPttEnabledToggle.checked = AudioTabController.pttEnabled
|
||||
@@ -245,17 +234,11 @@ MyStackViewPage {
|
||||
|
||||
Connections {
|
||||
target: AudioTabController
|
||||
onMicProximitySensorCanMuteChanged: {
|
||||
audioMuteProximitySensorToggle.checked = AudioTabController.micProximitySensorCanMute
|
||||
}
|
||||
onMicReversePttChanged: {
|
||||
audioPttReverseToggle.checked = AudioTabController.micReversePtt
|
||||
}
|
||||
onPttEnabledChanged: {
|
||||
audioPttEnabledToggle.checked = AudioTabController.pttEnabled
|
||||
}
|
||||
onPttActiveChanged: {
|
||||
|
||||
}
|
||||
onPttShowNotificationChanged: {
|
||||
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