From 5619b57f0f7c56381150db852be0c95ee564189f Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sat, 23 Jul 2022 12:31:25 +0200 Subject: [PATCH] =?UTF-8?q?simplification=20des=20if=20supression=20des=20?= =?UTF-8?q?dialogues=20=C2=ABAucune=20archive=20choisie,=20retour=20au=20m?= =?UTF-8?q?enu=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 1653d8f..c516ca9 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -246,9 +246,7 @@ fi elif [ "$choixmenu" = "ss" ];then # Supprimer une archive BorgFilter - if [ "$Borg_Archive" = "" ];then - zenity $W --info --text "Aucune archive choisie, retour au menu" - else + if [ ! "$Borg_Archive" = "" ];then borg delete "$borg_repo"::"$Borg_Archive" | ZenityPulsate zenity $W --info --text="Suppresion de l'archive $Borg_Archive terminée" fi @@ -262,9 +260,7 @@ fi Borg_Archive=$(borg list --short "$borg_repo" | grep "$filter" | sed s/^/S\\n/g | zenity $H $W $iconborg --list --checklist --title "Listes des archives" --column "S" --column "Archive") fi - if [ "$Borg_Archive" = "" ];then - zenity $W --info --text "Aucune archive choisie, retour au menu" - else + if [ ! "$Borg_Archive" = "" ];then borg delete "$borg_repo"::$(echo "$Borg_Archive" | sed s/\|/\ /g) | ZenityPulsate zenity $W --info --text="Suppression des archives terminée.\nArchives supprimées : $(echo "$Borg_Archive" | sed s/\|/\ /g)" fi @@ -273,9 +269,7 @@ fi # renommer une archive BorgFilter - if [ "$Borg_Archive" = "" ];then - zenity $W --info --text "Aucune archive choisie, retour au menu" - else + if [ ! "$Borg_Archive" = "" ];then borg_nouveaunom=$(zenity $W --entry --text "Nouveau nom" --entry-text="$Borg_Archive") borg rename "$borg_repo"::"$Borg_Archive" "$borg_nouveaunom" | ZenityPulsate fi @@ -284,9 +278,7 @@ fi elif [ "$choixmenu" = "is" ];then # Information archive BorgFilter - if [ "$Borg_Archive" = "" ];then - zenity $W --info --text "Aucune archive choisie, retour au menu" - else + if [ ! "$Borg_Archive" = "" ];then zenity $W --info --text="$(borg info "$borg_repo"::"$Borg_Archive")" | ZenityPulsate fi