Commit 62be5c35 authored by rudu's avatar rudu
Browse files

Added device specific notes

parent f656346e
......@@ -215,6 +215,7 @@ Every config file should have `metadata` with the following fields:
- `device_code`: str; The official device code.
- `supported_device_codes`: List[str]; A list of supported device codes for the config. The config will be loaded based on this field.
- `twrp-link`: [OPTIONAL] str; name of the corresponding twrp page.
- `notes`: [OPTIONAL] str; specific phone information, showed before choosing ROM / recovery
In addition to these metadata, every config can have optional `requirements`. If these are set, the user is asked to check if they are meet.
- `android`: [OPTIONAL] int|str; Android version to install prior to installing a custom ROM.
......
......@@ -166,6 +166,7 @@ def validate_config(config: str) -> bool:
"device_code": str,
"supported_device_codes": [str],
schema.Optional("twrp-link"): str,
schema.Optional("notes"): str,
},
schema.Optional("requirements"): {
schema.Optional("android"): schema.Or(str, int),
......
......@@ -144,6 +144,20 @@ OpenAndroidInstaller works with the [TWRP recovery project](https://twrp.me/abou
# text row to show infos during the process
self.info_field = Row()
# Device specific notes
if "notes" in self.state.config.metadata:
self.right_view.controls.extend(
[
Text(
"Important notes for your device",
style="titleSmall",
color=colors.RED,
weight="bold",
),
Markdown(f"""{self.state.config.metadata['notes']}"""),
]
)
# if there is an available download, show the button to the page
if self.download_link:
twrp_download_link = f"https://dl.twrp.me/{self.state.config.twrp_link if self.state.config.twrp_link else self.state.config.device_code}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment