Integrated update experience (#259)

This commit is contained in:
Gregory Schier
2025-10-01 09:36:36 -07:00
committed by GitHub
parent 757d28c235
commit 9a94a15c82
35 changed files with 631 additions and 155 deletions

View File

@@ -122,6 +122,7 @@ pub struct Settings {
pub update_channel: String,
pub hide_license_badge: bool,
pub autoupdate: bool,
pub auto_download_updates: bool,
}
impl UpsertModelInfo for Settings {
@@ -172,6 +173,7 @@ impl UpsertModelInfo for Settings {
(UpdateChannel, self.update_channel.into()),
(HideLicenseBadge, self.hide_license_badge.into()),
(Autoupdate, self.autoupdate.into()),
(AutoDownloadUpdates, self.auto_download_updates.into()),
(ColoredMethods, self.colored_methods.into()),
(Proxy, proxy.into()),
])
@@ -196,6 +198,7 @@ impl UpsertModelInfo for Settings {
SettingsIden::UpdateChannel,
SettingsIden::HideLicenseBadge,
SettingsIden::Autoupdate,
SettingsIden::AutoDownloadUpdates,
SettingsIden::ColoredMethods,
]
}
@@ -226,6 +229,7 @@ impl UpsertModelInfo for Settings {
hide_window_controls: row.get("hide_window_controls")?,
update_channel: row.get("update_channel")?,
autoupdate: row.get("autoupdate")?,
auto_download_updates: row.get("auto_download_updates")?,
hide_license_badge: row.get("hide_license_badge")?,
colored_methods: row.get("colored_methods")?,
})

View File

@@ -34,6 +34,7 @@ impl<'a> DbContext<'a> {
autoupdate: true,
colored_methods: false,
hide_license_badge: false,
auto_download_updates: true,
};
self.upsert(&settings, &UpdateSource::Background).expect("Failed to upsert settings")
}