mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
Add a setting for comic source list url
This commit is contained in:
@@ -313,7 +313,8 @@
|
|||||||
"Imported @a comics": "已导入 @a 本漫画",
|
"Imported @a comics": "已导入 @a 本漫画",
|
||||||
"New Version": "新版本",
|
"New Version": "新版本",
|
||||||
"@c updates": "@c 项更新",
|
"@c updates": "@c 项更新",
|
||||||
"No updates": "无更新"
|
"No updates": "无更新",
|
||||||
|
"Set comic source list url": "设置漫画源列表URL"
|
||||||
},
|
},
|
||||||
"zh_TW": {
|
"zh_TW": {
|
||||||
"Home": "首頁",
|
"Home": "首頁",
|
||||||
@@ -629,6 +630,7 @@
|
|||||||
"Imported @a comics": "已匯入 @a 部漫畫",
|
"Imported @a comics": "已匯入 @a 部漫畫",
|
||||||
"New Version": "新版本",
|
"New Version": "新版本",
|
||||||
"@c updates": "@c 項更新",
|
"@c updates": "@c 項更新",
|
||||||
"No updates": "無更新"
|
"No updates": "無更新",
|
||||||
|
"Set comic source list url": "設置漫畫源列表URL"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -155,6 +155,7 @@ class _Settings with ChangeNotifier {
|
|||||||
'customImageProcessing': defaultCustomImageProcessing,
|
'customImageProcessing': defaultCustomImageProcessing,
|
||||||
'sni': true,
|
'sni': true,
|
||||||
'autoAddLanguageFilter': 'none', // none, chinese, english, japanese
|
'autoAddLanguageFilter': 'none', // none, chinese, english, japanese
|
||||||
|
'comicSourceListUrl': "https://raw.githubusercontent.com/venera-app/venera-configs/master/index.json",
|
||||||
};
|
};
|
||||||
|
|
||||||
operator [](String key) {
|
operator [](String key) {
|
||||||
|
@@ -469,8 +469,7 @@ class _ComicSourceListState extends State<_ComicSourceList> {
|
|||||||
|
|
||||||
void load() async {
|
void load() async {
|
||||||
var dio = AppDio();
|
var dio = AppDio();
|
||||||
var res = await dio.get<String>(
|
var res = await dio.get<String>(appdata.settings['comicSourceListUrl']);
|
||||||
"https://raw.githubusercontent.com/venera-app/venera-configs/master/index.json");
|
|
||||||
if (res.statusCode != 200) {
|
if (res.statusCode != 200) {
|
||||||
context.showMessage(message: "Network error".tl);
|
context.showMessage(message: "Network error".tl);
|
||||||
return;
|
return;
|
||||||
@@ -485,6 +484,27 @@ class _ComicSourceListState extends State<_ComicSourceList> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return PopUpWidgetScaffold(
|
return PopUpWidgetScaffold(
|
||||||
title: "Comic Source".tl,
|
title: "Comic Source".tl,
|
||||||
|
tailing: [
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.settings),
|
||||||
|
onPressed: () async {
|
||||||
|
await showInputDialog(
|
||||||
|
context: context,
|
||||||
|
title: "Set comic source list url".tl,
|
||||||
|
initialValue: appdata.settings['comicSourceListUrl'],
|
||||||
|
onConfirm: (value) {
|
||||||
|
appdata.settings['comicSourceListUrl'] = value;
|
||||||
|
appdata.saveData();
|
||||||
|
setState(() {
|
||||||
|
loading = true;
|
||||||
|
json = null;
|
||||||
|
});
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
body: buildBody(),
|
body: buildBody(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user