mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix problem with Airplane Mode toggle visibility & add some default values for the Color Scheme settings
This commit is contained in:
@@ -71,11 +71,10 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle system wakeup to force-poll and ensure state is up-to-date
|
||||
// Handle potential case where Quickshell doesnt't properly update adapter after system wakeup
|
||||
Connections {
|
||||
target: Time
|
||||
function onResumed() {
|
||||
Logger.i("Bluetooth", "System resumed - forcing state poll");
|
||||
ctlPollTimer.restart();
|
||||
}
|
||||
}
|
||||
@@ -90,7 +89,7 @@ Singleton {
|
||||
checkAirplaneMode();
|
||||
}
|
||||
function onEnabledChanged() {
|
||||
if (adapter && adapter.enabled && Settings.data.network.bluetoothAutoConnect) {
|
||||
if (adapter?.enabled && Settings.data.network.bluetoothAutoConnect) {
|
||||
autoConnectTimer.restart();
|
||||
}
|
||||
}
|
||||
@@ -99,7 +98,7 @@ Singleton {
|
||||
Connections {
|
||||
target: Settings.data.network
|
||||
function onBluetoothAutoConnectChanged() {
|
||||
if (Settings.data.network.bluetoothAutoConnect && adapter && adapter.enabled) {
|
||||
if (Settings.data.network.bluetoothAutoConnect && adapter?.enabled) {
|
||||
autoConnectTimer.restart();
|
||||
} else {
|
||||
autoConnectTimer.stop();
|
||||
@@ -137,7 +136,7 @@ Singleton {
|
||||
|
||||
Timer {
|
||||
id: ctlPollTimer
|
||||
interval: 250
|
||||
interval: 2000
|
||||
running: false
|
||||
onTriggered: {
|
||||
if (!adapter || !ProgramCheckerService.bluetoothctlAvailable) {
|
||||
|
||||
@@ -114,7 +114,7 @@ Singleton {
|
||||
|
||||
Component.onCompleted: {
|
||||
Logger.i("Network", "Service started");
|
||||
wifiInitTimer.running = true;
|
||||
wifiInitTimer.restart();
|
||||
|
||||
// Ensure initial detection if nmcli is already available at startup
|
||||
if (ProgramCheckerService.nmcliAvailable) {
|
||||
@@ -155,23 +155,6 @@ Singleton {
|
||||
}
|
||||
return;
|
||||
}
|
||||
var isAirplaneModeActive = !root.wifiEnabled && BluetoothService.blocked;
|
||||
// Extra check for Airplane Mode if Bluetooth has been blocked before Wi-Fi
|
||||
if (isAirplaneModeActive && !root.airplaneModeEnabled) {
|
||||
root.airplaneModeEnabled = true;
|
||||
ToastService.showNotice(I18n.tr("toast.airplane-mode.title"), I18n.tr("common.enabled"), "plane");
|
||||
Logger.i("AirplaneMode", "Enabled");
|
||||
root.networks = ({});
|
||||
return;
|
||||
}
|
||||
// Extra check for Airplane Mode if Wi-Fi has been unblocked before Bluetooth
|
||||
if (!isAirplaneModeActive && root.airplaneModeEnabled) {
|
||||
root.airplaneModeEnabled = false;
|
||||
ToastService.showNotice(I18n.tr("toast.airplane-mode.title"), I18n.tr("common.disabled"), "plane-off");
|
||||
Logger.i("AirplaneMode", "Disabled");
|
||||
scan();
|
||||
return;
|
||||
}
|
||||
if (root.wifiEnabled) {
|
||||
ToastService.showNotice(I18n.tr("common.wifi"), I18n.tr("common.enabled"), "wifi");
|
||||
scan();
|
||||
|
||||
Reference in New Issue
Block a user