Add Configurator and CLI options to reset ESDE

This commit is contained in:
icenine451 2023-12-01 09:33:17 -05:00
parent f06b0043ae
commit 2bbeaf3ee2
5 changed files with 32 additions and 3 deletions

View file

@ -45,9 +45,9 @@ prepare_emulator() {
set_setting_value "$es_settings" "ROMDirectory" "$roms_folder" "es_settings"
set_setting_value "$es_settings" "MediaDirectory" "$media_folder" "es_settings"
set_setting_value "$es_settings" "UserThemeDirectory" "$themes_folder" "es_settings"
dir_prep "$rdhome/gamelists" "/var/config/emulationstation/.emulationstation/gamelists"
emulationstation --home /var/config/emulationstation --create-system-dirs
update_splashscreens
dir_prep "$rdhome/gamelists" "/var/config/emulationstation/.emulationstation/gamelists"
fi
if [[ "$action" == "postmove" ]]; then
set_setting_value "$es_settings" "ROMDirectory" "$roms_folder" "es_settings"

@ -1 +1 @@
Subproject commit 9dc439300e92338d5b2bc3fc680eedd4fe1d3b0c
Subproject commit 0b1cfb79e591e10488a3262d6b38db843c39a409

@ -1 +1 @@
Subproject commit 76809270588f87c6c14df96fef2dde9a7bac84f4
Subproject commit a2441b964afefd8cd1cebcdf562c7878670daf42

View file

@ -20,6 +20,7 @@ Arguments:
--compress-one <file> Compresses target file to a compatible format
--compress-all <format> Compresses all supported games into compatible format. Available formats are \"chd\", \"zip\", \"rvz\" and \"all\".
--reset-emulator <emulator> Reset one or more emulator configs to the default values
--reset-emulationstation Reset EmulationStation DE to default settings
--reset-retrodeck Starts the initial RetroDECK installer (backup your data first!)
For flatpak run specific options please run: flatpak run -h
@ -73,6 +74,18 @@ https://retrodeck.net
exit
fi
;;
--reset-emulationstation*)
echo "You are about to reset EmulationStation DE to default settings. Your scraped media, downloaded themes and gamelists will remain untouched."
read -p "Enter 'y' to continue, 'n' to stop: " response
if [[ $response == [yY] ]]; then
prepare_emulator "reset" "emulationstation" "cli"
read -p "The process has been completed, press Enter key to start RetroDECK."
shift # Continue launch after previous command is finished
else
read -p "The process has been cancelled, press Enter key to exit."
exit
fi
;;
--reset-retrodeck*)
echo "You are about to reset RetroDECK completely!"
read -p "Enter 'y' to continue, 'n' to stop: " response

View file

@ -77,6 +77,7 @@ source /app/libexec/global.sh
# - Reset XEMU
# - Reset Yuzu
# - Reset All Emulators
# - Reset EmulationStation DE
# - Reset RetroDECK
# - RetroDECK: About
# - RetroDECK Version History
@ -957,6 +958,7 @@ configurator_reset_dialog() {
--column="Choice" --column="Action" \
"Reset Specific Emulator" "Reset only one specific emulator to default settings" \
"Reset All Emulators" "Reset all emulators to default settings" \
"Reset EmulationStation DE" "Reset the ES-DE frontend" \
"Reset RetroDECK" "Reset RetroDECK to default settings" )
case $choice in
@ -1025,6 +1027,20 @@ configurator_reset_dialog() {
fi
;;
"Reset EmulationStation DE" )
if [[ $(configurator_reset_confirmation_dialog "EmulationStation DE" "Are you sure you want to reset EmulationStation DE to default settings?\n\nYour scraped media, downloaded themes and gamelists will not be touched.\n\nThis process cannot be undone.") == "true" ]]; then
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator Utility - Reset EmulationStation DE" \
--text="You are resetting EmulationStation DE to its default settings.\n\nAfter the process is complete you will need to exit RetroDECK and run it again."
prepare_emulator "reset" "emulationstation" "configurator"
configurator_process_complete_dialog "resetting EmulationStation DE"
else
configurator_generic_dialog "RetroDeck Configurator - EmulationStation DE: Reset" "Reset process cancelled."
configurator_reset_dialog
fi
;;
"Reset RetroDECK" )
if [[ $(configurator_reset_confirmation_dialog "RetroDECK" "Are you sure you want to reset RetroDECK entirely?\n\nThis process cannot be undone.") == "true" ]]; then
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \