Weather settings in settings app (#2337)

This commit is contained in:
end-4
2025-10-30 17:23:17 +01:00
committed by GitHub
2 changed files with 54 additions and 0 deletions
@@ -177,4 +177,51 @@ ContentPage {
}
}
}
ContentSection {
icon: "weather_mix"
title: Translation.tr("Weather")
ConfigRow {
ConfigSwitch {
buttonIcon: "assistant_navigation"
text: Translation.tr("Enable GPS based location")
checked: Config.options.bar.weather.enableGPS
onCheckedChanged: {
Config.options.bar.weather.enableGPS = checked;
}
}
ConfigSwitch {
buttonIcon: "thermometer"
text: Translation.tr("Fahrenheit unit")
checked: Config.options.bar.weather.useUSCS
onCheckedChanged: {
Config.options.bar.weather.useUSCS = checked;
}
StyledToolTip {
text: Translation.tr("It may take a few seconds to update")
}
}
}
MaterialTextArea {
Layout.fillWidth: true
placeholderText: Translation.tr("City name")
text: Config.options.bar.weather.city
wrapMode: TextEdit.Wrap
onTextChanged: {
Config.options.bar.weather.city = text;
}
}
ConfigSpinBox {
icon: "av_timer"
text: Translation.tr("Polling interval (m)")
value: Config.options.bar.weather.fetchInterval
from: 5
to: 50
stepSize: 5
onValueChanged: {
Config.options.bar.weather.fetchInterval = value;
}
}
}
}
@@ -16,6 +16,13 @@ Singleton {
readonly property bool useUSCS: Config.options.bar.weather.useUSCS
property bool gpsActive: Config.options.bar.weather.enableGPS
onUseUSCSChanged: {
root.getData();
}
onCityChanged: {
root.getData();
}
property var location: ({
valid: false,
lat: 0,