Add ability to manage search sources. Close #174

This commit is contained in:
2025-02-09 19:29:51 +08:00
parent 17ef17ca5b
commit df4263f969
6 changed files with 120 additions and 25 deletions

View File

@@ -40,6 +40,10 @@ class _ExploreSettingsState extends State<ExploreSettings> {
title: "Network Favorite Pages".tl,
builder: setFavoritesPagesWidget,
).toSliver(),
_PopupWindowSetting(
title: "Search Sources".tl,
builder: setSearchSourcesWidget,
).toSliver(),
_SwitchSetting(
title: "Show favorite status on comic tile".tl,
settingKey: "showFavoriteStatusOnTile",
@@ -210,4 +214,18 @@ Widget setFavoritesPagesWidget() {
settingsIndex: "favorites",
pages: pages,
);
}
Widget setSearchSourcesWidget() {
var pages = <String, String>{};
for (var c in ComicSource.all()) {
if (c.searchPageData != null) {
pages[c.key] = c.name;
}
}
return _MultiPagesFilter(
title: "Search Sources".tl,
settingsIndex: "searchSources",
pages: pages,
);
}