mirror of
https://github.com/outbackdingo/OpCore-Simplify.git
synced 2026-04-07 19:05:41 +00:00
Add GUI Support for OpCore Simplify (#512)
* Refactor OpCore-Simplify to GUI version * New ConfigEditor * Add requirement checks and installation in launchers * Add GitHub Actions workflow to generate manifest.json * Set compression level for asset * Skip .git and __pycache__ folders * Refactor update process to include integrity checker * Add SMBIOS model selection * Update README.md * Update to main branch
This commit is contained in:
47
Scripts/datasets/config_tooltips.py
Normal file
47
Scripts/datasets/config_tooltips.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from typing import Dict, Callable
|
||||
|
||||
from Scripts.value_formatters import format_value, get_value_type
|
||||
|
||||
|
||||
def get_tooltip(key_path, value, original_value = None, context = None):
|
||||
context = context or {}
|
||||
|
||||
if key_path in TOOLTIP_GENERATORS:
|
||||
generator = TOOLTIP_GENERATORS[key_path]
|
||||
return generator(key_path, value, original_value, context)
|
||||
|
||||
path_parts = key_path.split(".")
|
||||
for i in range(len(path_parts), 0, -1):
|
||||
parent_path = ".".join(path_parts[:i]) + ".*"
|
||||
if parent_path in TOOLTIP_GENERATORS:
|
||||
generator = TOOLTIP_GENERATORS[parent_path]
|
||||
return generator(key_path, value, original_value, context)
|
||||
|
||||
return _default_tooltip(key_path, value, original_value, context)
|
||||
|
||||
def _default_tooltip(key_path, value, original_value, context):
|
||||
tooltip = f"<b>{key_path}</b><br><br>"
|
||||
|
||||
if original_value is not None and original_value != value:
|
||||
tooltip += f"<b>Original:</b> {format_value(original_value)}<br>"
|
||||
original_type = get_value_type(original_value)
|
||||
if original_type:
|
||||
tooltip += f"<b>Type:</b> {original_type}<br>"
|
||||
tooltip += f"<b>Modified:</b> {format_value(value)}<br>"
|
||||
modified_type = get_value_type(value)
|
||||
if modified_type:
|
||||
tooltip += f"<b>Type:</b> {modified_type}<br>"
|
||||
tooltip += "<br>"
|
||||
else:
|
||||
tooltip += f"<b>Value:</b> {format_value(value)}<br>"
|
||||
value_type = get_value_type(value)
|
||||
if value_type:
|
||||
tooltip += f"<b>Type:</b> {value_type}<br>"
|
||||
tooltip += "<br>"
|
||||
|
||||
return tooltip
|
||||
|
||||
TOOLTIP_GENERATORS: Dict[str, Callable] = {}
|
||||
|
||||
def _register_tooltip(path, generator):
|
||||
TOOLTIP_GENERATORS[path] = generator
|
||||
@@ -1,3 +1,9 @@
|
||||
from Scripts.settings import Settings
|
||||
|
||||
settings = Settings()
|
||||
|
||||
INCLUDE_BETA = settings.get_include_beta_versions()
|
||||
|
||||
class macOSVersionInfo:
|
||||
def __init__(self, name, macos_version, release_status = "final"):
|
||||
self.name = name
|
||||
@@ -17,7 +23,7 @@ macos_versions = [
|
||||
macOSVersionInfo("Tahoe", "26")
|
||||
]
|
||||
|
||||
def get_latest_darwin_version(include_beta=True):
|
||||
def get_latest_darwin_version(include_beta=INCLUDE_BETA):
|
||||
for macos_version in macos_versions[::-1]:
|
||||
if include_beta:
|
||||
return "{}.{}.{}".format(macos_version.darwin_version, 99, 99)
|
||||
@@ -32,4 +38,4 @@ def get_macos_name_by_darwin(darwin_version):
|
||||
for data in macos_versions:
|
||||
if data.darwin_version == int(darwin_version[:2]):
|
||||
return "macOS {} {}{}".format(data.name, data.macos_version, "" if data.release_status == "final" else " (Beta)")
|
||||
return None
|
||||
return None
|
||||
Reference in New Issue
Block a user