mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-04-10 19:15:12 +00:00
FRAMEWORK: making the framework aware if we are using zenity
This commit is contained in:
parent
45c5ff1ad0
commit
acd5380410
|
@ -59,7 +59,7 @@ check_for_version_update() {
|
||||||
|
|
||||||
if [[ ! "$update_ignore" == "$online_version" ]]; then
|
if [[ ! "$update_ignore" == "$online_version" ]]; then
|
||||||
if [[ "$update_repo" == "RetroDECK" ]] && [[ $(sed -e 's/[\.a-z]//g' <<< $version) -le $(sed -e 's/[\.a-z]//g' <<< $online_version) ]]; then
|
if [[ "$update_repo" == "RetroDECK" ]] && [[ $(sed -e 's/[\.a-z]//g' <<< $version) -le $(sed -e 's/[\.a-z]//g' <<< $online_version) ]]; then
|
||||||
choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="OK" --extra-button="Ignore this version" \
|
choice=$(rd_zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="OK" --extra-button="Ignore this version" \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--title "RetroDECK - New Update Available" \
|
--title "RetroDECK - New Update Available" \
|
||||||
--text="There is a new version of RetroDECK available: <span foreground='$blue'><b>$online_version</b></span>.\nYou can easily update from the app store you have installed, examples: KDE Discover or Gnome Software.\n\nIf you would like to ignore this notification, click the \"Ignore this version\" button.")
|
--text="There is a new version of RetroDECK available: <span foreground='$blue'><b>$online_version</b></span>.\nYou can easily update from the app store you have installed, examples: KDE Discover or Gnome Software.\n\nIf you would like to ignore this notification, click the \"Ignore this version\" button.")
|
||||||
|
|
|
@ -299,7 +299,9 @@ dir_prep() {
|
||||||
|
|
||||||
rd_zenity() {
|
rd_zenity() {
|
||||||
# This function replaces the standard 'zenity' command and filters out annoying GTK errors on Steam Deck
|
# This function replaces the standard 'zenity' command and filters out annoying GTK errors on Steam Deck
|
||||||
|
export GUI="zenity"
|
||||||
zenity 2> >(grep -v 'Gtk' >&2) "$@"
|
zenity 2> >(grep -v 'Gtk' >&2) "$@"
|
||||||
|
unset GUI
|
||||||
}
|
}
|
||||||
|
|
||||||
update_rpcs3_firmware() {
|
update_rpcs3_firmware() {
|
||||||
|
@ -642,7 +644,7 @@ install_release() {
|
||||||
log d "Constructed flatpak URL: $flatpak_url"
|
log d "Constructed flatpak URL: $flatpak_url"
|
||||||
|
|
||||||
# Confirm installation with the user
|
# Confirm installation with the user
|
||||||
zenity --question --icon-name=net.retrodeck.retrodeck --no-wrap \
|
rd_zenity --question --icon-name=net.retrodeck.retrodeck --no-wrap \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--title "RetroDECK Updater" \
|
--title "RetroDECK Updater" \
|
||||||
--text="$1 will be now installed.\nThe update process may take several minutes.\n\nAfter the update is complete, RetroDECK will close. When you run it again, you will be using the latest version.\n\nDo you want to continue?"
|
--text="$1 will be now installed.\nThe update process may take several minutes.\n\nAfter the update is complete, RetroDECK will close. When you run it again, you will be using the latest version.\n\nDo you want to continue?"
|
||||||
|
@ -673,7 +675,7 @@ install_release() {
|
||||||
# Cleanup old bundles to save space
|
# Cleanup old bundles to save space
|
||||||
rm -rf "$rdhome/RetroDECK_Updates"
|
rm -rf "$rdhome/RetroDECK_Updates"
|
||||||
) |
|
) |
|
||||||
zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
|
rd_zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--title "RetroDECK Updater" \
|
--title "RetroDECK Updater" \
|
||||||
--text="RetroDECK is updating to the selected version, please wait."
|
--text="RetroDECK is updating to the selected version, please wait."
|
||||||
|
@ -791,7 +793,7 @@ release_selector() {
|
||||||
while true; do
|
while true; do
|
||||||
echo "# Fetching all available releases from GitHub repositories... Please wait. This may take some time." ; sleep 1
|
echo "# Fetching all available releases from GitHub repositories... Please wait. This may take some time." ; sleep 1
|
||||||
done
|
done
|
||||||
) | zenity --progress --title="Fetching Releases" --text="Fetching releases..." --pulsate --no-cancel --auto-close --width=500 --height=150 &
|
) | rd_zenity --progress --title="Fetching Releases" --text="Fetching releases..." --pulsate --no-cancel --auto-close --width=500 --height=150 &
|
||||||
|
|
||||||
progress_pid=$! # save process PID to kill it later
|
progress_pid=$! # save process PID to kill it later
|
||||||
|
|
||||||
|
@ -931,7 +933,7 @@ quit_retrodeck() {
|
||||||
source /app/libexec/steam_sync.sh
|
source /app/libexec/steam_sync.sh
|
||||||
add_to_steam "$(ls "$rdhome/ES-DE/gamelists/")"
|
add_to_steam "$(ls "$rdhome/ES-DE/gamelists/")"
|
||||||
) |
|
) |
|
||||||
zenity --progress \
|
rd_zenity --progress \
|
||||||
--title="Syncing with Steam" \
|
--title="Syncing with Steam" \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--text="<span foreground='$purple'><b>\t\t\t\tSyncing favorite games with Steam.</b></span>\n\n<b>NOTE: </b>This operation may take some time depending on the size of your library.\nFeel free to leave this in the background and switch to another application.\n\n" \
|
--text="<span foreground='$purple'><b>\t\t\t\tSyncing favorite games with Steam.</b></span>\n\n<b>NOTE: </b>This operation may take some time depending on the size of your library.\nFeel free to leave this in the background and switch to another application.\n\n" \
|
||||||
|
|
|
@ -428,7 +428,7 @@ post_update() {
|
||||||
|
|
||||||
# Create a Zenity window with checkboxes for each reset option and two buttons
|
# Create a Zenity window with checkboxes for each reset option and two buttons
|
||||||
while true; do
|
while true; do
|
||||||
choices=$(zenity --list --checklist --title="RetroDECK Reset Options" \
|
choices=$(rd_zenity --list --checklist --title="RetroDECK Reset Options" \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--text="The following components have been updated and need to be reset or fixed to ensure compatibility with the new version: select the components you want to reset.\n\nNot resetting them may cause serious issues with your installation.\nYou can also reset them manually later via Configurator -> Troubleshooting -> Reset Component.\n\nNote: Your games, saves, game collections and scraped data will not be affected." \
|
--text="The following components have been updated and need to be reset or fixed to ensure compatibility with the new version: select the components you want to reset.\n\nNot resetting them may cause serious issues with your installation.\nYou can also reset them manually later via Configurator -> Troubleshooting -> Reset Component.\n\nNote: Your games, saves, game collections and scraped data will not be affected." \
|
||||||
--column="Select" --column="Component" --column="Description" --width="1100" --height="700" \
|
--column="Select" --column="Component" --column="Description" --width="1100" --height="700" \
|
||||||
|
@ -456,7 +456,7 @@ post_update() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $? -eq 0 && -n "$choices" ]]; then
|
if [[ $? -eq 0 && -n "$choices" ]]; then
|
||||||
if ! zenity --question --title="Confirmation" --text="Are you sure you want to proceed with only the selected options?\n\nThis might cause issues in RetroDECK"; then
|
if ! rd_zenity --question --title="Confirmation" --text="Are you sure you want to proceed with only the selected options?\n\nThis might cause issues in RetroDECK"; then
|
||||||
log i "User is not sure, showing the checklist window again."
|
log i "User is not sure, showing the checklist window again."
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
|
@ -466,7 +466,7 @@ post_update() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $? == 0 ]]; then
|
if [[ $? == 0 ]]; then
|
||||||
if ! zenity --question --title="Confirmation" --text="Are you sure you want to skip the reset process?\n\nThis might cause issues in RetroDECK"; then
|
if ! rd_zenity --question --title="Confirmation" --text="Are you sure you want to skip the reset process?\n\nThis might cause issues in RetroDECK"; then
|
||||||
log i "User is not sure, showing the checklist window again."
|
log i "User is not sure, showing the checklist window again."
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
|
@ -563,7 +563,7 @@ post_update() {
|
||||||
|
|
||||||
# Create a Zenity window with checkboxes for each reset option and two buttons
|
# Create a Zenity window with checkboxes for each reset option and two buttons
|
||||||
while true; do
|
while true; do
|
||||||
choices=$(zenity --list --checklist --title="RetroDECK Reset Options" \
|
choices=$(rd_zenity --list --checklist --title="RetroDECK Reset Options" \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--text="The following components have been updated and need to be reset or fixed to ensure compatibility with the new version: select the components you want to reset.\n\nNot resetting them may cause serious issues with your installation.\nYou can also reset them manually later via Configurator -> Troubleshooting -> Reset Component.\n\nNote: Your games, saves, game collections and scraped data will not be affected." \
|
--text="The following components have been updated and need to be reset or fixed to ensure compatibility with the new version: select the components you want to reset.\n\nNot resetting them may cause serious issues with your installation.\nYou can also reset them manually later via Configurator -> Troubleshooting -> Reset Component.\n\nNote: Your games, saves, game collections and scraped data will not be affected." \
|
||||||
--column="Select" --column="Component" --column="Description" --width="1100" --height="700" \
|
--column="Select" --column="Component" --column="Description" --width="1100" --height="700" \
|
||||||
|
@ -588,7 +588,7 @@ post_update() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $? -eq 0 && -n "$choices" ]]; then
|
if [[ $? -eq 0 && -n "$choices" ]]; then
|
||||||
if ! zenity --question --title="Confirmation" --text="Are you sure you want to proceed with only the selected options?\n\nThis might cause issues in RetroDECK"; then
|
if ! rd_zenity --question --title="Confirmation" --text="Are you sure you want to proceed with only the selected options?\n\nThis might cause issues in RetroDECK"; then
|
||||||
log i "User is not sure, showing the checklist window again."
|
log i "User is not sure, showing the checklist window again."
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
|
@ -598,7 +598,7 @@ post_update() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $? == 0 ]]; then
|
if [[ $? == 0 ]]; then
|
||||||
if ! zenity --question --title="Confirmation" --text="Are you sure you want to skip the reset process?\n\nThis might cause issues in RetroDECK"; then
|
if ! rd_zenity --question --title="Confirmation" --text="Are you sure you want to skip the reset process?\n\nThis might cause issues in RetroDECK"; then
|
||||||
log i "User is not sure, showing the checklist window again."
|
log i "User is not sure, showing the checklist window again."
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
|
|
|
@ -178,7 +178,7 @@ find_system_commands() {
|
||||||
selected_command="${command_list[1]}"
|
selected_command="${command_list[1]}"
|
||||||
else
|
else
|
||||||
# Show the list with Zenity and return the **command** (second column) selected
|
# Show the list with Zenity and return the **command** (second column) selected
|
||||||
selected_command=$(zenity --list \
|
selected_command=$(rd_zenity --list \
|
||||||
--title="Select an emulator for $system_name" \
|
--title="Select an emulator for $system_name" \
|
||||||
--column="Emulator" --column="Hidden Command" "${command_list[@]}" \
|
--column="Emulator" --column="Hidden Command" "${command_list[@]}" \
|
||||||
--width=800 --height=400 --print-column=2 --hide-column=2)
|
--width=800 --height=400 --print-column=2 --hide-column=2)
|
||||||
|
|
|
@ -96,6 +96,7 @@ source /app/libexec/global.sh
|
||||||
|
|
||||||
configurator_welcome_dialog() {
|
configurator_welcome_dialog() {
|
||||||
log i "Configurator: opening welcome dialog"
|
log i "Configurator: opening welcome dialog"
|
||||||
|
export GUI="zenity"
|
||||||
welcome_menu_options=(
|
welcome_menu_options=(
|
||||||
"Settings" "Customize your RetroDECK experience with various presets and tweaks."
|
"Settings" "Customize your RetroDECK experience with various presets and tweaks."
|
||||||
"Open Component" "Manually launch and configure settings for each emulator or component (for advanced users)."
|
"Open Component" "Manually launch and configure settings for each emulator or component (for advanced users)."
|
||||||
|
@ -159,6 +160,7 @@ configurator_welcome_dialog() {
|
||||||
|
|
||||||
"" )
|
"" )
|
||||||
log i "Configurator: closing"
|
log i "Configurator: closing"
|
||||||
|
unset GUI
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue