mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
change Airplane Mode visibility conditions
This commit is contained in:
@@ -14,4 +14,5 @@ NIconButtonHot {
|
||||
onClicked: {
|
||||
NetworkService.setAirplaneMode(!NetworkService.airplaneModeEnabled);
|
||||
}
|
||||
enabled: NetworkService.wifiAvailable && BluetoothService.bluetoothAvailable
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ Item {
|
||||
icon: NetworkService.wifiEnabled ? "wifi" : "wifi-off"
|
||||
checked: NetworkService.wifiEnabled
|
||||
onToggled: checked => NetworkService.setWifiEnabled(checked)
|
||||
enabled: ProgramCheckerService.nmcliAvailable && !NetworkService.airplaneModeEnabled && NetworkService.wifiAvailable
|
||||
enabled: !NetworkService.airplaneModeEnabled && NetworkService.wifiAvailable
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
}
|
||||
@@ -324,7 +324,7 @@ Item {
|
||||
// Airplane Mode
|
||||
NBox {
|
||||
id: miscSettingsBox
|
||||
visible: !root.showOnlyLists
|
||||
visible: !root.showOnlyLists && miscSettingsCol.visibleChildren.length > 0
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: miscSettingsCol.implicitHeight + Style.margin2XL
|
||||
color: Color.mSurface
|
||||
@@ -336,6 +336,7 @@ Item {
|
||||
spacing: Style.marginM
|
||||
|
||||
NToggle {
|
||||
visible: NetworkService.wifiAvailable && BluetoothService.bluetoothAvailable
|
||||
label: I18n.tr("toast.airplane-mode.title")
|
||||
description: I18n.tr("toast.airplane-mode.description")
|
||||
icon: NetworkService.airplaneModeEnabled ? "plane" : "plane-off"
|
||||
|
||||
@@ -105,9 +105,11 @@ Singleton {
|
||||
Connections {
|
||||
target: Time
|
||||
function onResumed() {
|
||||
Logger.i("Network", "System resumed - forcing state poll");
|
||||
deviceStatusProcess.restart();
|
||||
connectivityCheckProcess.restart();
|
||||
if (ProgramCheckerService.nmcliAvailable) {
|
||||
Logger.i("Network", "System resumed - forcing state poll");
|
||||
deviceStatusProcess.restart();
|
||||
connectivityCheckProcess.restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +155,9 @@ Singleton {
|
||||
id: wifiDebounce
|
||||
interval: 300
|
||||
onTriggered: {
|
||||
if (!ProgramCheckerService.nmcliAvailable) {
|
||||
return;
|
||||
}
|
||||
if (root.airplaneModeToggled) {
|
||||
root.airplaneModeToggled = false;
|
||||
if (root.wifiEnabled) {
|
||||
|
||||
Reference in New Issue
Block a user