diff --git a/files/builds/development-branch/uninstall.sh b/files/builds/development-branch/uninstall.sh index 0e4e4b3..8096e34 100644 --- a/files/builds/development-branch/uninstall.sh +++ b/files/builds/development-branch/uninstall.sh @@ -7,7 +7,7 @@ # Author URI: https://cryinkfly.com # # License: MIT # # Copyright (c) 2020-2022 # -# Time/Date: 12:40/23.05.2022 # +# Time/Date: 13:20/23.05.2022 # # Version: 0.7 -> 0.8 # ################################################################################ @@ -32,71 +32,139 @@ function DL_GET_FILES { ############################################################################################################################################################### function DL_LOAD_LOCALE { -DL_LOCALE=`cat /tmp/fusion360/settings.txt | awk 'NR == 1'` -if [[ $DL_LOCALE = "Czech" ]]; then + DL_LOCALE=`cat /tmp/fusion360/settings.txt | awk 'NR == 1'` + if [[ $DL_LOCALE = "Czech" ]]; then echo "CS" . $DL_PATH/locale/cs-CZ/locale-cs.sh -elif [[ $DL_LOCALE = "English" ]]; then + elif [[ $DL_LOCALE = "English" ]]; then echo "EN" . $DL_PATH/locale/en-US/locale-en.sh -elif [[ $DL_LOCALE = "German" ]]; then + elif [[ $DL_LOCALE = "German" ]]; then echo "DE" . $DL_PATH/locale/de-DE/locale-de.sh -elif [[ $DL_LOCALE = "Spanish" ]]; then + elif [[ $DL_LOCALE = "Spanish" ]]; then echo "ES" . $DL_PATH0/locale/es-ES/locale-es.sh -elif [[ $DL_LOCALE = "French" ]]; then + elif [[ $DL_LOCALE = "French" ]]; then echo "FR" . $DL_PATH/locale/fr-FR/locale-fr.sh -elif [[ $DL_LOCALE = "Italian" ]]; then + elif [[ $DL_LOCALE = "Italian" ]]; then echo "IT" . $DL_PATH/locale/it-IT/locale-it.sh -elif [[ $DL_LOCALE = "Japanese" ]]; then + elif [[ $DL_LOCALE = "Japanese" ]]; then echo "JP" . $DL_PATH/locale/ja-JP/locale-ja.sh -elif [[ $DL_LOCALE = "Korean" ]]; then + elif [[ $DL_LOCALE = "Korean" ]]; then echo "KO" . $DL_PATH/locale/ko-KR/locale-ko.sh -elif [[ $DL_LOCALE = "Chinese" ]]; then + elif [[ $DL_LOCALE = "Chinese" ]]; then echo "ZH" . $DL_PATH/locale/zh-CN/locale-zh.sh -else + else echo "EN" . $DL_PATH/locale/en-US/locale-en.sh -fi + fi } +############################################################################################################################################################### +# ALL DEL-FUNCTIONS ARE ARRANGED HERE: # ############################################################################################################################################################### -function DL_WINEPREFIXES_DEL { -DL_WINEPREFIXES=${DL_WINEPREFIXES_STRING/#TRUE} +function DL_WINEPREFIXES_ACT { + DL_WINEPREFIXES=${DL_WINEPREFIXES_STRING/#TRUE} DL_WINEPREFIXES_VAR_1=`grep -n "$DL_WINEPREFIXES" /tmp/fusion360/logs/wineprefixes.log | grep -Eo '^[^:]+'` DL_WINEPREFIXES_VAR_2=1 DL_WINEPREFIXES_VAR_SUM=`echo $(( var1 - var2 ))` # Get info if the user is sure with there choise ... - - + DL_WINEPREFIXES_DEL_INFO +} + +############################################################################################################################################################### + +function DL_WINEPREFIXES_DEL { sed --in-place "${DL_WINEPREFIXES_VAR_SUM}d" /tmp/fusion360/logs/wineprefixes.log DL_WINEPREFIXES_VAR_1=`grep -n "$DL_WINEPREFIXES" /tmp/fusion360/logs/wineprefixes.log | grep -Eo '^[^:]+'` sed --in-place "${DL_WINEPREFIXES_VAR_1}d" /tmp/fusion360/logs/wineprefixes.log # Continue with removing ... rmdir $DL_WINEPREFIXES - # Check if there another Wineprefixes ... - # if ... then - # Do nothing! - # else - # rmdir $HOME/.fusion360 - # fi - + DL_WINEPREFIXES_DEL_ALL +} + +############################################################################################################################################################### + +function DL_WINEPREFIXES_DEL_ALL { + if [[ ! -z $(cat /tmp/fusion360/logs/wineprefixes.log) ]] ; then + # Do nothing! + echo "There is at least one installed Wineprefix on your system!" + else + echo "There are no more Wineprefixes installed on your system!" + rmdir $DL_PATH + fi } ############################################################################################################################################################### # ALL DIALOGS ARE ARRANGED HERE: # ############################################################################################################################################################### +function DL_WELCOME { + yad \ + --form \ + --separator="" \ + --center \ + --height=125 \ + --width=750 \ + --buttons-layout=center \ + --title="" \ + --field="$DL_TITLE:LBL" \ + --field="$DL_WELCOME_LABEL_1:LBL" \ + --field="$DL_WELCOME_LABEL_2:LBL" \ + --align=center \ + --button=gtk-about!!"$DL_WELCOME_TOOLTIP_1":1 \ + --button=gtk-cancel:99 \ + --button=gtk-ok:2 + + ret=$? + + # Responses to above button presses are below: + if [[ $ret -eq 1 ]]; then + xdg-open https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux + DL-WELCOME + elif [[ $ret -eq 2 ]]; then + DL_WINEPREFIXES_LIST + else + exit; + fi +} + +############################################################################################################################################################### + function DL_WINEPREFIXES_LIST { DL_WINEPREFIXES_STRING=$(yad --height=300 --separator="" --list --radiolist --column=SELECT --column=WINEPREFIXES < /tmp/fusion360/logs/wineprefixes.log) - DL_WINEPREFIXES_DEL + DL_WINEPREFIXES_ACT +} + +############################################################################################################################################################### + +function DL_WINEPREFIXES_DEL_INFO { + DL_WINEPREFIXES_DEL_CHECK=$(yad \ + --title="" \ + --form \ + --borders=15 \ + --width=550 \ + --height=450 \ + --buttons-layout=center \ + --align=center \ + --field=":TXT" "$DL_WINEPREFIXES_DEL_INFO_TEXT" \ + --field="$DL_WINEPREFIXES_DEL_INFO_LABEL:CHK" ) + + if [[ $DL_WINEPREFIXES_DEL_CHECK = *"TRUE"* ]]; then + echo "TRUE" + DL_WINEPREFIXES_DEL + DL_WINEPREFIXES_DEL_ALL + else + echo "FALSE" + DL_WELCOME + fi } ############################################################################################################################################################### @@ -105,4 +173,4 @@ function DL_WINEPREFIXES_LIST { DL_GET_FILES DL_LOAD_LOCALE -DL_WINEPREFIXES_LIST +DL_WELCOME