RetroDECK/tools/configurator/components/bios_check/bios_check.gd

70 lines
2.9 KiB
GDScript3
Raw Normal View History

extends Control
var file := FileAccess
var bios_tempfile : String
var command: String = "../../tools/retrodeck_function_wrapper.sh"
var console: bool = false
var BIOS_COLUMNS_BASIC := ["BIOS File Name", "System", "Found", "Hash Match", "Description"]
var BIOS_COLUMNS_EXPERT := ["BIOS File Name", "System", "Found", "Hash Match", "Description", "Subdirectory", "Hash"]
@onready var bios_type:int = get_tree().current_scene.bios_type
Theme and Theme Inheritance On branch feat/godot-configurator Changes to be committed: new file: tools/configurator/assets/fonts/OpenDyslexic3/OpenDyslexic3-Bold.ttf new file: tools/configurator/assets/fonts/OpenDyslexic3/OpenDyslexic3-Bold.ttf.import new file: tools/configurator/assets/fonts/OpenDyslexic3/OpenDyslexic3-Regular.ttf new file: tools/configurator/assets/fonts/OpenDyslexic3/OpenDyslexic3-Regular.ttf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-Black.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-Black.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-Bold.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-Bold.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-ExtraLight.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-ExtraLight.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-Light.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-Light.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-Regular.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-Regular.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-SemiBold.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-SemiBold.otf.import new file: tools/configurator/assets/fonts/akrobat/akrobat-extrabold-webfont.ttf new file: tools/configurator/assets/fonts/akrobat/akrobat-extrabold-webfont.ttf.import new file: tools/configurator/assets/fonts/munro/munro-narrow.ttf new file: tools/configurator/assets/fonts/munro/munro-narrow.ttf.import new file: tools/configurator/assets/fonts/munro/munro-small.ttf new file: tools/configurator/assets/fonts/munro/munro-small.ttf.import new file: tools/configurator/assets/fonts/munro/munro.ttf new file: tools/configurator/assets/fonts/munro/munro.ttf.import new file: tools/configurator/assets/graphics/Rekku/Rekku-test.xcf new file: tools/configurator/assets/graphics/Rekku/base.png new file: tools/configurator/assets/graphics/Rekku/base.png.import new file: tools/configurator/assets/graphics/Rekku/blink1.png new file: tools/configurator/assets/graphics/Rekku/blink1.png.import new file: tools/configurator/assets/graphics/Rekku/blink2.png new file: tools/configurator/assets/graphics/Rekku/blink2.png.import new file: tools/configurator/assets/graphics/Rekku/eyes-open.png new file: tools/configurator/assets/graphics/Rekku/eyes-open.png.import new file: tools/configurator/assets/graphics/Rekku/mouth-A.png new file: tools/configurator/assets/graphics/Rekku/mouth-A.png.import new file: tools/configurator/assets/graphics/Rekku/mouth-O.png new file: tools/configurator/assets/graphics/Rekku/mouth-O.png.import new file: tools/configurator/assets/graphics/Rekku/mouth-base.png new file: tools/configurator/assets/graphics/Rekku/mouth-base.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-blink-down.png new file: tools/configurator/assets/graphics/Rekku/rekku-blink-down.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-blink-up.png new file: tools/configurator/assets/graphics/Rekku/rekku-blink-up.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-idle.png new file: tools/configurator/assets/graphics/Rekku/rekku-idle.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-speak1.png new file: tools/configurator/assets/graphics/Rekku/rekku-speak1.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-speak2.png new file: tools/configurator/assets/graphics/Rekku/rekku-speak2.png.import new file: tools/configurator/assets/graphics/retrodeck.png new file: tools/configurator/assets/graphics/retrodeck.png.import new file: tools/configurator/assets/themes/accesible_theme.tres new file: tools/configurator/assets/themes/default_theme.tres new file: tools/configurator/assets/themes/modern_theme.tres new file: tools/configurator/assets/themes/retro_theme.tres modified: tools/configurator/components/bios_check/bios_check.gd modified: tools/configurator/main.gd modified: tools/configurator/main.tscn modified: tools/configurator/res/pixel_ui_theme/RetroDECKTheme.tres
2024-07-28 18:44:07 +00:00
@onready var custom_theme: Theme = get_tree().current_scene.custom_theme
func _ready():
Theme and Theme Inheritance On branch feat/godot-configurator Changes to be committed: new file: tools/configurator/assets/fonts/OpenDyslexic3/OpenDyslexic3-Bold.ttf new file: tools/configurator/assets/fonts/OpenDyslexic3/OpenDyslexic3-Bold.ttf.import new file: tools/configurator/assets/fonts/OpenDyslexic3/OpenDyslexic3-Regular.ttf new file: tools/configurator/assets/fonts/OpenDyslexic3/OpenDyslexic3-Regular.ttf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-Black.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-Black.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-Bold.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-Bold.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-ExtraLight.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-ExtraLight.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-Light.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-Light.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-Regular.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-Regular.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-SemiBold.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-SemiBold.otf.import new file: tools/configurator/assets/fonts/akrobat/akrobat-extrabold-webfont.ttf new file: tools/configurator/assets/fonts/akrobat/akrobat-extrabold-webfont.ttf.import new file: tools/configurator/assets/fonts/munro/munro-narrow.ttf new file: tools/configurator/assets/fonts/munro/munro-narrow.ttf.import new file: tools/configurator/assets/fonts/munro/munro-small.ttf new file: tools/configurator/assets/fonts/munro/munro-small.ttf.import new file: tools/configurator/assets/fonts/munro/munro.ttf new file: tools/configurator/assets/fonts/munro/munro.ttf.import new file: tools/configurator/assets/graphics/Rekku/Rekku-test.xcf new file: tools/configurator/assets/graphics/Rekku/base.png new file: tools/configurator/assets/graphics/Rekku/base.png.import new file: tools/configurator/assets/graphics/Rekku/blink1.png new file: tools/configurator/assets/graphics/Rekku/blink1.png.import new file: tools/configurator/assets/graphics/Rekku/blink2.png new file: tools/configurator/assets/graphics/Rekku/blink2.png.import new file: tools/configurator/assets/graphics/Rekku/eyes-open.png new file: tools/configurator/assets/graphics/Rekku/eyes-open.png.import new file: tools/configurator/assets/graphics/Rekku/mouth-A.png new file: tools/configurator/assets/graphics/Rekku/mouth-A.png.import new file: tools/configurator/assets/graphics/Rekku/mouth-O.png new file: tools/configurator/assets/graphics/Rekku/mouth-O.png.import new file: tools/configurator/assets/graphics/Rekku/mouth-base.png new file: tools/configurator/assets/graphics/Rekku/mouth-base.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-blink-down.png new file: tools/configurator/assets/graphics/Rekku/rekku-blink-down.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-blink-up.png new file: tools/configurator/assets/graphics/Rekku/rekku-blink-up.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-idle.png new file: tools/configurator/assets/graphics/Rekku/rekku-idle.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-speak1.png new file: tools/configurator/assets/graphics/Rekku/rekku-speak1.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-speak2.png new file: tools/configurator/assets/graphics/Rekku/rekku-speak2.png.import new file: tools/configurator/assets/graphics/retrodeck.png new file: tools/configurator/assets/graphics/retrodeck.png.import new file: tools/configurator/assets/themes/accesible_theme.tres new file: tools/configurator/assets/themes/default_theme.tres new file: tools/configurator/assets/themes/modern_theme.tres new file: tools/configurator/assets/themes/retro_theme.tres modified: tools/configurator/components/bios_check/bios_check.gd modified: tools/configurator/main.gd modified: tools/configurator/main.tscn modified: tools/configurator/res/pixel_ui_theme/RetroDECKTheme.tres
2024-07-28 18:44:07 +00:00
$".".theme = custom_theme
#Check if XDG_RUNTIME_DIR is set and choose temp file location
if OS.has_environment("XDG_RUNTIME_DIR"):
#temporary hack for Tim
# This uses tempfs system revisit
#bios_tempfile = OS.get_environment("XDG_RUNTIME_DIR") + "/godot_temp/godot_bios_files_checked.tmp"
bios_tempfile = "/var/config/retrodeck/godot/godot_bios_files_checked.tmp"
else:
bios_tempfile = "/var/config/retrodeck/godot/godot_bios_files_checked.tmp"
Theme and Theme Inheritance On branch feat/godot-configurator Changes to be committed: new file: tools/configurator/assets/fonts/OpenDyslexic3/OpenDyslexic3-Bold.ttf new file: tools/configurator/assets/fonts/OpenDyslexic3/OpenDyslexic3-Bold.ttf.import new file: tools/configurator/assets/fonts/OpenDyslexic3/OpenDyslexic3-Regular.ttf new file: tools/configurator/assets/fonts/OpenDyslexic3/OpenDyslexic3-Regular.ttf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-Black.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-Black.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-Bold.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-Bold.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-ExtraLight.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-ExtraLight.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-Light.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-Light.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-Regular.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-Regular.otf.import new file: tools/configurator/assets/fonts/akrobat/Akrobat-SemiBold.otf new file: tools/configurator/assets/fonts/akrobat/Akrobat-SemiBold.otf.import new file: tools/configurator/assets/fonts/akrobat/akrobat-extrabold-webfont.ttf new file: tools/configurator/assets/fonts/akrobat/akrobat-extrabold-webfont.ttf.import new file: tools/configurator/assets/fonts/munro/munro-narrow.ttf new file: tools/configurator/assets/fonts/munro/munro-narrow.ttf.import new file: tools/configurator/assets/fonts/munro/munro-small.ttf new file: tools/configurator/assets/fonts/munro/munro-small.ttf.import new file: tools/configurator/assets/fonts/munro/munro.ttf new file: tools/configurator/assets/fonts/munro/munro.ttf.import new file: tools/configurator/assets/graphics/Rekku/Rekku-test.xcf new file: tools/configurator/assets/graphics/Rekku/base.png new file: tools/configurator/assets/graphics/Rekku/base.png.import new file: tools/configurator/assets/graphics/Rekku/blink1.png new file: tools/configurator/assets/graphics/Rekku/blink1.png.import new file: tools/configurator/assets/graphics/Rekku/blink2.png new file: tools/configurator/assets/graphics/Rekku/blink2.png.import new file: tools/configurator/assets/graphics/Rekku/eyes-open.png new file: tools/configurator/assets/graphics/Rekku/eyes-open.png.import new file: tools/configurator/assets/graphics/Rekku/mouth-A.png new file: tools/configurator/assets/graphics/Rekku/mouth-A.png.import new file: tools/configurator/assets/graphics/Rekku/mouth-O.png new file: tools/configurator/assets/graphics/Rekku/mouth-O.png.import new file: tools/configurator/assets/graphics/Rekku/mouth-base.png new file: tools/configurator/assets/graphics/Rekku/mouth-base.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-blink-down.png new file: tools/configurator/assets/graphics/Rekku/rekku-blink-down.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-blink-up.png new file: tools/configurator/assets/graphics/Rekku/rekku-blink-up.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-idle.png new file: tools/configurator/assets/graphics/Rekku/rekku-idle.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-speak1.png new file: tools/configurator/assets/graphics/Rekku/rekku-speak1.png.import new file: tools/configurator/assets/graphics/Rekku/rekku-speak2.png new file: tools/configurator/assets/graphics/Rekku/rekku-speak2.png.import new file: tools/configurator/assets/graphics/retrodeck.png new file: tools/configurator/assets/graphics/retrodeck.png.import new file: tools/configurator/assets/themes/accesible_theme.tres new file: tools/configurator/assets/themes/default_theme.tres new file: tools/configurator/assets/themes/modern_theme.tres new file: tools/configurator/assets/themes/retro_theme.tres modified: tools/configurator/components/bios_check/bios_check.gd modified: tools/configurator/main.gd modified: tools/configurator/main.tscn modified: tools/configurator/res/pixel_ui_theme/RetroDECKTheme.tres
2024-07-28 18:44:07 +00:00
var table := $Table
if bios_type == 0: #Basic BIOS button pressed
table.columns = BIOS_COLUMNS_BASIC.size()
for i in BIOS_COLUMNS_BASIC.size():
table.set_column_title(i, BIOS_COLUMNS_BASIC[i])
else: #Assume advanced BIOS button pressed
table.columns = BIOS_COLUMNS_EXPERT.size()
for i in BIOS_COLUMNS_EXPERT.size():
table.set_column_title(i, BIOS_COLUMNS_EXPERT[i])
var root = table.create_item()
table.hide_root = true
if bios_type == 0: #Basic BIOS button pressed
#OS.execute("/app/tools/retrodeck_function_wrapper.sh",["check_bios_files", "basic"])
#var parameters = ["log", "i", "Configurator: " + "check_bios_files"]
# classFunctions.execute_command(command, parameters, false)
var parameters = ["check_bios_files","basic"]
#result = classFunctions.execute_command(command, parameters, false)
#threaded
await run_thread_command(command, parameters, console)
else: #Assume advanced BIOS button pressed
var parameters = ["check_bios_files"]
class_functions.execute_command(command, parameters, false)
await run_thread_command(command, parameters, console)
#OS.execute("/app/tools/retrodeck_function_wrapper.sh",["check_bios_files"])
if file.file_exists(bios_tempfile): #File to be removed after script is done
var bios_list := file.open(bios_tempfile, FileAccess.READ)
var bios_line := []
while ! bios_list.eof_reached():
bios_line = bios_list.get_csv_line("^")
var table_line: TreeItem = table.create_item(root)
for i in bios_line.size():
table_line.set_text(i, bios_line[i])
if table_line.get_index() % 2 == 1:
table_line.set_custom_bg_color(i,Color(0.15, 0.15, 0.15, 1),false)
2024-04-08 21:14:58 +00:00
table_line.set_custom_color(i,Color(1,1,1,1))
func run_thread_command(command: String, parameters: Array, console: bool) -> void:
var result = await class_functions.run_command_in_thread(command, parameters, console)
if result != null:
print (result["output"])
print ("Exit Code: " + str(result["exit_code"]))