Skip to content

Commit

Permalink
v8.23
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
MichaIng committed Sep 30, 2023
1 parent b04b43b commit 77c9b12
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions dietpi/dietpi-backup
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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[@]}"
Expand All @@ -567,22 +568,17 @@ _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')

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')
Expand All @@ -593,7 +589,6 @@ _EOF_

[[ $FP_TARGET == '/' ]] && FP_TARGET='/mnt'
FP_TARGET+='/dietpi-backup'

;;

*) :;;
Expand All @@ -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

}
Expand Down

0 comments on commit 77c9b12

Please sign in to comment.