Shortcuts you invent, rules you write, gestures you own - all still just data
Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -48,6 +48,20 @@ SettingsPage {
|
||||
property bool importOpen: false
|
||||
property string importPath: ""
|
||||
|
||||
// The saved list, folded at the house cap. Sorted by the helper with the
|
||||
// active and autoconnecting profiles first, so a slice keeps the ones worth
|
||||
// seeing and folds the tail.
|
||||
property bool savedShowAll: false
|
||||
readonly property int savedCap: 6
|
||||
readonly property var savedShown: {
|
||||
const list = NetworkTools.savedConnections;
|
||||
if (root.savedShowAll || list.length <= root.savedCap)
|
||||
return list;
|
||||
return list.slice(0, root.savedCap);
|
||||
}
|
||||
readonly property int savedHidden:
|
||||
NetworkTools.savedConnections.length - root.savedShown.length
|
||||
|
||||
// The proxy dropdown and its address, page-local until they add up to a
|
||||
// whole setting.
|
||||
//
|
||||
@@ -187,6 +201,7 @@ SettingsPage {
|
||||
ConnectionDetails {
|
||||
width: parent.width
|
||||
visible: root.wiredOpen && Connectivity.wiredOn
|
||||
connection: root.wiredConnection
|
||||
details: root.wiredConnection !== ""
|
||||
? NetworkTools.detailsFor(root.wiredConnection) : null
|
||||
}
|
||||
@@ -303,6 +318,88 @@ SettingsPage {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Saved networks ───────────────────────────────────────────────────────
|
||||
//
|
||||
// The list above is what is nearby. This is what this machine REMEMBERS,
|
||||
// which is a different set and the more useful one to tidy: a profile you
|
||||
// want rid of is invisible in a scan-driven list until you are standing
|
||||
// next to it, which is exactly when you are least able to deal with it.
|
||||
|
||||
SettingsCard {
|
||||
title: "Saved networks"
|
||||
visible: NetworkTools.savedConnections.length > 0
|
||||
subtitle: NetworkTools.savedConnections.length
|
||||
+ (NetworkTools.savedConnections.length === 1 ? " profile" : " profiles")
|
||||
+ " NetworkManager holds, including the ones nowhere near you."
|
||||
|
||||
Repeater {
|
||||
model: root.savedShown
|
||||
|
||||
delegate: SettingRow {
|
||||
id: savedRow
|
||||
|
||||
required property var modelData
|
||||
required property int index
|
||||
|
||||
readonly property string name: String(savedRow.modelData.name ?? "")
|
||||
readonly property bool wireless: savedRow.modelData.wifi === true
|
||||
|
||||
width: parent.width
|
||||
label: savedRow.name
|
||||
// Armed, the row stops describing the profile and names what
|
||||
// the confirming press costs. The saved passphrase goes with
|
||||
// the profile, and nothing else on this page says so.
|
||||
detail: {
|
||||
if (forgetSaved.armed)
|
||||
return "This deletes the saved profile and its password. Rejoining "
|
||||
+ savedRow.name + " means typing it again.";
|
||||
const bits = [];
|
||||
if (savedRow.modelData.active === true)
|
||||
bits.push("Connected");
|
||||
else if (savedRow.wireless)
|
||||
bits.push(savedRow.modelData.inRange === true ? "In range" : "Out of range");
|
||||
else
|
||||
bits.push(String(savedRow.modelData.type ?? ""));
|
||||
bits.push(savedRow.modelData.autoconnect === true
|
||||
? "autoconnects" : "never autoconnects");
|
||||
return bits.join(" · ");
|
||||
}
|
||||
value: savedRow.modelData.active === true ? "this one" : ""
|
||||
controlWidth: 200
|
||||
divider: savedRow.index < root.savedShown.length - 1 || root.savedHidden > 0
|
||||
|| root.savedShowAll
|
||||
|
||||
ConfirmAction {
|
||||
id: forgetSaved
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: savedRow.modelData.active !== true
|
||||
actionId: "forget-saved-network:" + savedRow.name
|
||||
armText: "Forget…"
|
||||
confirmText: "Forget it"
|
||||
enabled: !NetworkTools.busy
|
||||
onConfirmed: NetworkTools.forget(savedRow.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingRow {
|
||||
width: parent.width
|
||||
visible: root.savedHidden > 0
|
||||
|| (root.savedShowAll && NetworkTools.savedConnections.length > root.savedCap)
|
||||
label: root.savedShowAll
|
||||
? "Show fewer"
|
||||
: root.savedHidden + (root.savedHidden === 1 ? " more" : " more")
|
||||
detail: root.savedShowAll
|
||||
? ""
|
||||
: "Folded to keep the list short — the ones you use least are at the bottom"
|
||||
activatable: true
|
||||
divider: false
|
||||
onActivated: root.savedShowAll = !root.savedShowAll
|
||||
}
|
||||
}
|
||||
|
||||
// ── VPN ──────────────────────────────────────────────────────────────────
|
||||
|
||||
SettingsCard {
|
||||
|
||||
Reference in New Issue
Block a user