From 77c9b123bafdff285ff9088e724cf0a15884c4ca Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 30 Sep 2023 21:04:24 +0200 Subject: [PATCH] v8.23 - DietPi-Backup | Adjust location selection button texts to better indicate what they do: "Ok" > "Select" for selecting one of the menu options, "Cancel" > "Back" for navigating back to the main menu --- dietpi/dietpi-backup | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index 1d524f75b4..7ad4fea2b6 100755 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -541,8 +541,9 @@ _EOF_ 'Manual' ': Manually type a directory to use' ) - if G_WHIP_MENU "Please select the location where the backup will be saved, and restored from.\n\nYour current location:\n$FP_TARGET"; then - + G_WHIP_BUTTON_OK_TEXT='Select' G_WHIP_BUTTON_CANCEL_TEXT='Back' + if G_WHIP_MENU "Please select the location where the backup will be saved, and restored from.\n\nYour current location:\n$FP_TARGET" + then local current_directory=$FP_TARGET case "$G_WHIP_RETURNED_VALUE" in @@ -554,8 +555,8 @@ _EOF_ mapfile -t alist < <(find / -type f -name "$FP_STATS") # Do we have any results? - if [[ ${alist[0]} ]]; then - + if [[ ${alist[0]} ]] + then # Create List for Whiptail G_WHIP_MENU_ARRAY=() for i in "${alist[@]}" @@ -567,14 +568,10 @@ _EOF_ G_WHIP_MENU 'Please select a previous backup to use:' || return 0 FP_TARGET=$G_WHIP_RETURNED_VALUE - else - G_WHIP_MSG 'No previous backups were found.' return 0 - fi - ;; 'Manual') @@ -582,7 +579,6 @@ _EOF_ G_WHIP_DEFAULT_ITEM=$FP_TARGET G_WHIP_INPUTBOX 'Please enter the absolute path to the backup directory.\nE.g.: /mnt/dietpi-backup\n - Must be a filesystem which supports symlinks and UNIX permissions, like ext4, F2FS, Btrfs, XFS, ZFS or a proper NFS mount' || return 0 FP_TARGET=$G_WHIP_RETURNED_VALUE - ;; 'List') @@ -593,7 +589,6 @@ _EOF_ [[ $FP_TARGET == '/' ]] && FP_TARGET='/mnt' FP_TARGET+='/dietpi-backup' - ;; *) :;; @@ -602,11 +597,8 @@ _EOF_ # If not supported, reset directory target to previous Check_Supported_Directory_Location || FP_TARGET=$current_directory - else - TARGETMENUID=0 # Return to main menu - fi }