The last two values that could only be changed by editing a file. Weather was pinned to hardcoded coordinates, so the card could not be pointed anywhere else. It is a location search now, not latitude and longitude fields: nobody knows their own coordinates, and a control that demands them is one nobody uses. Open-Meteo's geocoding endpoint needs no key, the same reason the forecast already uses them. Only the search term leaves the machine -- the stored place name is a label -- and coordinates are rounded to four decimals, far finer than a weather reading resolves and coarse enough to keep a precise home location out of the settings file. The graphics readout was hardcoded to card1. This machine has two amdgpu cards, discrete and integrated, so that was right only by luck, and the path is meaningless on any other machine. GPUs are enumerated with a readable name from lspci, since sysfs exposes only numeric ids, and the picker appears only when there is more than one to choose between. A stored path the machine does not have is refused and reported rather than silently measuring nothing. Also merges the per-application notification rules UI. Its three commits were believed integrated but the page half was not actually in the tree: main had the service side in Notifs.qml and zero references to setAppRule in NotificationsPage. Ancestry is not content. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
54 lines
1.5 KiB
QML
54 lines
1.5 KiB
QML
// Choosing where the weather reading is for.
|
|
//
|
|
// A search box rather than latitude and longitude fields: nobody knows their
|
|
// own coordinates, and a control that demands them is one nobody ever uses. The
|
|
// coordinates are what actually get stored -- the name is only a label.
|
|
|
|
import QtQuick
|
|
import qs.config
|
|
import qs.services
|
|
import qs.modules.clipboard
|
|
|
|
Column {
|
|
id: root
|
|
|
|
spacing: 0
|
|
|
|
SearchField {
|
|
id: query
|
|
width: parent.width
|
|
placeholder: "Search for a town or city"
|
|
onTextChanged: Geocoding.search(query.text)
|
|
}
|
|
|
|
Repeater {
|
|
model: Geocoding.results
|
|
|
|
SettingRow {
|
|
id: place
|
|
|
|
required property var modelData
|
|
required property int index
|
|
|
|
label: place.modelData.name
|
|
detail: [place.modelData.admin, place.modelData.country].filter(part => !!part).join(", ")
|
|
value: place.modelData.latitude.toFixed(2) + ", " + place.modelData.longitude.toFixed(2)
|
|
controlWidth: 150
|
|
divider: place.index < Geocoding.results.length - 1
|
|
activatable: true
|
|
onActivated: {
|
|
if (Geocoding.choose(place.modelData))
|
|
query.text = "";
|
|
}
|
|
}
|
|
}
|
|
|
|
SettingRow {
|
|
width: parent.width
|
|
visible: Geocoding.searching || Geocoding.lastError !== ""
|
|
label: Geocoding.searching ? "Searching…" : "No result"
|
|
detail: Geocoding.searching ? "" : Geocoding.lastError
|
|
divider: false
|
|
}
|
|
}
|