clearer session screen download warning, update check config option

This commit is contained in:
end-4
2026-02-08 20:29:49 +01:00
parent 314b0ab3d0
commit be4eb16b60
4 changed files with 37 additions and 7 deletions
@@ -599,6 +599,7 @@ Singleton {
} }
property JsonObject updates: JsonObject { property JsonObject updates: JsonObject {
property bool enableCheck: true
property int checkInterval: 120 // minutes property int checkInterval: 120 // minutes
property int adviseUpdateThreshold: 75 // packages property int adviseUpdateThreshold: 75 // packages
property int stronglyAdviseUpdateThreshold: 200 // packages property int stronglyAdviseUpdateThreshold: 200 // packages
@@ -238,7 +238,7 @@ Scope {
} }
} }
RowLayout { ColumnLayout {
anchors { anchors {
top: contentColumn.bottom top: contentColumn.bottom
topMargin: 10 topMargin: 10
@@ -247,19 +247,22 @@ Scope {
spacing: 10 spacing: 10
Loader { Loader {
active: SessionWarnings.packageManagerRunning Layout.alignment: Qt.AlignHCenter
active: SessionWarnings.downloadRunning
visible: active visible: active
sourceComponent: DescriptionLabel { sourceComponent: DescriptionLabel {
text: Translation.tr("Your package manager is running") text: Translation.tr("There might be a download in progress. Check your Downloads folder.")
textColor: Appearance.m3colors.m3onErrorContainer textColor: Appearance.m3colors.m3onErrorContainer
color: Appearance.m3colors.m3errorContainer color: Appearance.m3colors.m3errorContainer
} }
} }
Loader { Loader {
active: SessionWarnings.downloadRunning Layout.alignment: Qt.AlignHCenter
active: SessionWarnings.packageManagerRunning
visible: active visible: active
sourceComponent: DescriptionLabel { sourceComponent: DescriptionLabel {
text: Translation.tr("There might be a download in progress") text: Translation.tr("Your package manager is running")
textColor: Appearance.m3colors.m3onErrorContainer textColor: Appearance.m3colors.m3onErrorContainer
color: Appearance.m3colors.m3errorContainer color: Appearance.m3colors.m3errorContainer
} }
@@ -203,6 +203,32 @@ ContentPage {
} }
} }
// There's no update indicator in ii for now so we shouldn't show this yet
// ContentSection {
// icon: "deployed_code_update"
// title: Translation.tr("System updates (Arch only)")
// ConfigSwitch {
// text: Translation.tr("Enable update checks")
// checked: Config.options.updates.enableCheck
// onCheckedChanged: {
// Config.options.updates.enableCheck = checked;
// }
// }
// ConfigSpinBox {
// icon: "av_timer"
// text: Translation.tr("Check interval (mins)")
// value: Config.options.updates.checkInterval
// from: 60
// to: 1440
// stepSize: 60
// onValueChanged: {
// Config.options.updates.checkInterval = value;
// }
// }
// }
ContentSection { ContentSection {
icon: "weather_mix" icon: "weather_mix"
title: Translation.tr("Weather") title: Translation.tr("Weather")
@@ -29,7 +29,7 @@ Singleton {
Timer { Timer {
interval: Config.options.updates.checkInterval * 60 * 1000 interval: Config.options.updates.checkInterval * 60 * 1000
repeat: true repeat: true
running: Config.ready running: Config.ready && Config.options.updates.enableCheck
onTriggered: { onTriggered: {
print("[Updates] Periodic update check due") print("[Updates] Periodic update check due")
root.refresh(); root.refresh();
@@ -38,7 +38,7 @@ Singleton {
Process { Process {
id: checkAvailabilityProc id: checkAvailabilityProc
running: true running: Config.ready && Config.options.updates.enableCheck
command: ["which", "checkupdates"] command: ["which", "checkupdates"]
onExited: (exitCode, exitStatus) => { onExited: (exitCode, exitStatus) => {
root.available = (exitCode === 0); root.available = (exitCode === 0);