Network: moved options to appropriate network block

This commit is contained in:
Lemmy
2026-01-02 17:52:44 -05:00
parent 5a4f9480d6
commit 01c8b48b4d
5 changed files with 20 additions and 23 deletions
+7 -10
View File
@@ -25,7 +25,7 @@ Singleton {
- Default cache directory: ~/.cache/noctalia
*/
readonly property alias data: adapter // Used to access via Settings.data.xxx.yyy
readonly property int settingsVersion: 36
readonly property int settingsVersion: 37
readonly property bool isDebug: Quickshell.env("NOCTALIA_DEBUG") === "1"
readonly property string shellName: "noctalia"
readonly property string configDir: Quickshell.env("NOCTALIA_CONFIG_DIR") || (Quickshell.env("XDG_CONFIG_HOME") || Quickshell.env("HOME") + "/.config") + "/" + shellName + "/"
@@ -299,11 +299,7 @@ Singleton {
property real panelBackgroundOpacity: 0.93
property bool panelsAttachedToBar: true
property string settingsPanelMode: "attached" // "centered", "attached", "window"
// Details view mode persistence for panels
property string wifiDetailsViewMode: "grid" // "grid" or "list"
property string bluetoothDetailsViewMode: "grid" // "grid" or "list"
// Bluetooth available devices list: hide items without a name
property bool bluetoothHideUnnamedDevices: false
property bool boxBorderEnabled: false
}
// location
@@ -523,10 +519,11 @@ Singleton {
// network
property JsonObject network: JsonObject {
property bool wifiEnabled: true
// Opt-in Bluetooth RSSI polling (uses bluetoothctl)
property bool bluetoothRssiPollingEnabled: false
// Polling interval in milliseconds for RSSI queries
property int bluetoothRssiPollIntervalMs: 10000
property bool bluetoothRssiPollingEnabled: false // Opt-in Bluetooth RSSI polling (uses bluetoothctl)
property int bluetoothRssiPollIntervalMs: 10000 // Polling interval in milliseconds for RSSI queries
property string wifiDetailsViewMode: "grid" // "grid" or "list"
property string bluetoothDetailsViewMode: "grid" // "grid" or "list"
property bool bluetoothHideUnnamedDevices: false
}
// session menu
@@ -20,8 +20,8 @@ NBox {
// Per-list expanded details (by device key)
property string expandedDeviceKey: ""
// Local layout toggle for details: true = grid (2 cols), false = rows (1 col)
// Persisted under Settings.data.ui.bluetoothDetailsViewMode
property bool detailsGrid: (Settings.data && Settings.data.ui && Settings.data.ui.bluetoothDetailsViewMode !== undefined) ? (Settings.data.ui.bluetoothDetailsViewMode === "grid") : true
// Persisted under Settings.data.network.bluetoothDetailsViewMode
property bool detailsGrid: (Settings.data && Settings.data.ui && Settings.data.network.bluetoothDetailsViewMode !== undefined) ? (Settings.data.network.bluetoothDetailsViewMode === "grid") : true
Layout.fillWidth: true
Layout.preferredHeight: column.implicitHeight + Style.marginM * 2
@@ -54,11 +54,11 @@ NBox {
visible: root.headerMode === "filter"
// Option A: filter/filter-off
// Off (show all): filter; On (hide unnamed): filter-off
icon: (Settings.data && Settings.data.ui && Settings.data.ui.bluetoothHideUnnamedDevices) ? "filter-off" : "filter"
tooltipText: (Settings.data && Settings.data.ui && Settings.data.ui.bluetoothHideUnnamedDevices) ? I18n.tr("tooltips.hide-unnamed-devices") : I18n.tr("tooltips.show-all-devices")
icon: (Settings.data && Settings.data.ui && Settings.data.network.bluetoothHideUnnamedDevices) ? "filter-off" : "filter"
tooltipText: (Settings.data && Settings.data.ui && Settings.data.network.bluetoothHideUnnamedDevices) ? I18n.tr("tooltips.hide-unnamed-devices") : I18n.tr("tooltips.show-all-devices")
onClicked: {
if (Settings.data && Settings.data.ui) {
Settings.data.ui.bluetoothHideUnnamedDevices = !(Settings.data.ui.bluetoothHideUnnamedDevices);
Settings.data.network.bluetoothHideUnnamedDevices = !(Settings.data.network.bluetoothHideUnnamedDevices);
}
}
}
@@ -284,7 +284,7 @@ NBox {
onClicked: {
root.detailsGrid = !root.detailsGrid;
if (Settings.data && Settings.data.ui) {
Settings.data.ui.bluetoothDetailsViewMode = root.detailsGrid ? "grid" : "list";
Settings.data.network.bluetoothDetailsViewMode = root.detailsGrid ? "grid" : "list";
}
}
z: 1
+1 -1
View File
@@ -194,7 +194,7 @@ SmartPanel {
return [];
var filtered = BluetoothService.adapter.devices.values.filter(dev => dev && !dev.blocked && !dev.paired && !dev.trusted);
// Optionally hide devices without a meaningful name when the filter is enabled
if (Settings.data && Settings.data.ui && Settings.data.ui.bluetoothHideUnnamedDevices) {
if (Settings.data && Settings.data.ui && Settings.data.network.bluetoothHideUnnamedDevices) {
filtered = filtered.filter(function (dev) {
// Extract display name
var dn = "";
+3 -3
View File
@@ -21,8 +21,8 @@ NBox {
// Currently expanded info panel for a connected SSID
property string infoSsid: ""
// Local layout toggle for details: true = grid (2 cols), false = rows (1 col)
// Persisted under Settings.data.ui.wifiDetailsViewMode
property bool detailsGrid: (Settings.data && Settings.data.ui && Settings.data.ui.wifiDetailsViewMode !== undefined) ? (Settings.data.ui.wifiDetailsViewMode === "grid") : true
// Persisted under Settings.data.network.wifiDetailsViewMode
property bool detailsGrid: (Settings.data && Settings.data.ui && Settings.data.network.wifiDetailsViewMode !== undefined) ? (Settings.data.network.wifiDetailsViewMode === "grid") : true
signal passwordRequested(string ssid)
signal passwordSubmitted(string ssid, string password)
@@ -325,7 +325,7 @@ NBox {
onClicked: {
root.detailsGrid = !root.detailsGrid;
if (Settings.data && Settings.data.ui) {
Settings.data.ui.wifiDetailsViewMode = root.detailsGrid ? "grid" : "list";
Settings.data.network.wifiDetailsViewMode = root.detailsGrid ? "grid" : "list";
}
}
z: 1
+3 -3
View File
@@ -19,9 +19,9 @@ SmartPanel {
property bool hasHadNetworks: false
// Ethernet details UI state (mirrors WiFi info behavior)
// Info panel collapsed by default, view mode persisted under Settings.data.ui.wifiDetailsViewMode
// Info panel collapsed by default, view mode persisted under Settings.data.network.wifiDetailsViewMode
property bool ethernetInfoExpanded: false
property bool ethernetDetailsGrid: (Settings.data && Settings.data.ui && Settings.data.ui.wifiDetailsViewMode !== undefined) ? (Settings.data.ui.wifiDetailsViewMode === "grid") : true
property bool ethernetDetailsGrid: (Settings.data && Settings.data.ui && Settings.data.network.wifiDetailsViewMode !== undefined) ? (Settings.data.network.wifiDetailsViewMode === "grid") : true
// Computed network lists
readonly property var knownNetworks: {
@@ -189,7 +189,7 @@ SmartPanel {
onClicked: {
ethernetDetailsGrid = !ethernetDetailsGrid;
if (Settings.data && Settings.data.ui) {
Settings.data.ui.wifiDetailsViewMode = ethernetDetailsGrid ? "grid" : "list";
Settings.data.network.wifiDetailsViewMode = ethernetDetailsGrid ? "grid" : "list";
}
}
z: 1