Skip to content

Commit

Permalink
Add "Check for updates on startup" setting. #129
Browse files Browse the repository at this point in the history
  • Loading branch information
wgh136 committed Jan 6, 2025
1 parent 4b19ab5 commit 9876da8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 4 additions & 2 deletions assets/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@
"Enable": "启用",
"Aggregated": "聚合",
"Default Search Target": "默认搜索目标",
"Auto Language Filters": "自动语言筛选"
"Auto Language Filters": "自动语言筛选",
"Check for updates on startup": "启动时检查更新"
},
"zh_TW": {
"Home": "首頁",
Expand Down Expand Up @@ -531,6 +532,7 @@
"Enable": "啟用",
"Aggregated": "聚合",
"Default Search Target": "默認搜索目標",
"Auto Language Filters": "自動語言篩選"
"Auto Language Filters": "自動語言篩選",
"Check for updates on startup": "啟動時檢查更新"
}
}
8 changes: 7 additions & 1 deletion lib/pages/settings/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ class _AboutSettingsState extends State<AboutSettings> {
},
).fixHeight(32),
).toSliver(),
_SwitchSetting(
title: "Check for updates on startup".tl,
settingKey: "checkUpdateOnStart",
).toSliver(),
ListTile(
title: const Text("Github"),
trailing: const Icon(Icons.open_in_new),
Expand Down Expand Up @@ -102,7 +106,9 @@ Future<void> checkUpdateUi([bool showMessageIfNoUpdate = true]) async {
return ContentDialog(
title: "New version available".tl,
content: Text(
"A new version is available. Do you want to update now?".tl),
"A new version is available. Do you want to update now?"
.tl)
.paddingHorizontal(8),
actions: [
Button.text(
onPressed: () {
Expand Down

0 comments on commit 9876da8

Please sign in to comment.