uniformisation des longueurs des boites de dialogue

This commit is contained in:
Djan GICQUEL 2021-03-10 20:07:52 +01:00
parent ddba8939e6
commit 336b04ca27
1 changed files with 16 additions and 18 deletions

View File

@ -18,21 +18,21 @@ TestBorgRepo () {
if [ ! -f "config" ]; then
TestBorgErr=1
infoerr=$(echo "Impossible de trouver le fichier de configuration borg.")
zenity --width=500 --error --text="$infoerr"
zenity --width=600 --error --text="$infoerr"
exit
fi
if [ ! -d "data" ]; then
TestBorgErr=1
infoerr=$(echo "Impossible de trouver le fichier de configuration borg.")
zenity --width=500 --error --text="$infoerr"
zenity --width=600 --error --text="$infoerr"
exit
fi
if [ -d "lock.exclusive" ]; then
TestBorgErr=1
infoerr=$(echo "Le dépôt est bloqué, une opération est peut-être en cours")
zenity --width=500 --error --text="$infoerr"
zenity --width=600 --error --text="$infoerr"
exit
fi
}
@ -45,7 +45,7 @@ bobainfoa () {
DossierPresent () {
if [ ! -d "$1" ]; then
inforerror=$(echo "Erreur, le dossier $1 est absent.\nFin du script.")
zenity --width=500 --error --text="$inforerror"
zenity --width=600 --error --text="$inforerror"
exit
fi
}
@ -54,12 +54,12 @@ SauvegardeBorg () {
DossierPresent $borg_repo
DossierPresent $borg_dir
zenity --width=500 --height=600 --info --text="<tt>$(cd $dossierprofil && cat $fichierprofil)</tt>"
zenity --width=600 --height=500 --info --text="<tt>$(cd $dossierprofil && cat $fichierprofil)</tt>"
borg create $borg_excludes $borg_compress $borg_repo::$borg_archive $borg_dir | zenity --width=400 --progress --pulsate --auto-close --title="Sauvegarde en cours..."
sync | zenity --width=400 --progress --pulsate --auto-close --title="Synchronisation des écritures..."
borg create $borg_excludes $borg_compress $borg_repo::$borg_archive $borg_dir | zenity --width=600 --progress --pulsate --auto-close --title="Sauvegarde en cours..."
sync | zenity --width=600 --progress --pulsate --auto-close --title="Synchronisation des écritures..."
zenity --notification --text "Sauvegarde $nomsauvegarde terminée"
zenity --width=300 --info --text "Sauvegarde $nomsauvegarde terminée"
zenity --width=600 --info --text "Sauvegarde $nomsauvegarde terminée"
}
# Profils et tests
@ -71,16 +71,16 @@ if [ ! $1 = "" ]; then
. "$1"
else
cd $dossierprofil
fichierprofil=$(ls -1 *.txt | zenity --height=500 --width=400 --list --title "Profils" --hide-header --column "profil") && . $fichierprofil
fichierprofil=$(ls -1 *.txt | zenity --height=500 --width=600 --list --title "Profils" --hide-header --column "profil") && . $fichierprofil
fi
if [ "$nomsauvegarde" = "" ]; then
infoerr=$(echo "Nom de sauvegarde non défini.")
zenity --width=200 --error --text="$infoerr"
zenity --width=600 --error --text="$infoerr"
exit
elif [ "$borg_repo" = "" ]; then
infoerr=$(echo "Variable \$borg_repo absente")
zenity --width=200 --error --text="$infoerr"
zenity --width=600 --error --text="$infoerr"
exit
fi
@ -118,18 +118,16 @@ elif [ "$choixmenu" = "ms" ];then
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
mkdir $HOME/$borg_archive
borg mount $borg_repo::$borg_archive $HOME/$borg_archive
zenity --width=400 --info --text="La sauvegarde est disponible dans le dossier\n<tt>$HOME/$borg_archive</tt>"
zenity --width=600 --info --text="La sauvegarde est disponible dans le dossier\n<tt>$HOME/$borg_archive</tt>"
elif [ "$choixmenu" = "dm" ];then
ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity --width=500 --height=400 --list --title "Liste des points de montages" --column "")
fusermount -u $ptnmontage
sleep 5
rmdir $ptnmontage
fusermount -u $ptnmontage && sleep 5 && rmdir $ptnmontage
elif [ "$choixmenu" = "ss" ];then
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
borg delete $borg_repo::$borg_archive | zenity --width=400 --progress --pulsate --auto-close --title="Suppression en cours..."
zenity --width=200 --info --text="Suppresion terminée"
borg delete $borg_repo::$borg_archive | zenity --width=600 --progress --pulsate --auto-close --title="Suppression en cours..."
zenity --width=600 --info --text="Suppresion de l'archive $borg_archive terminée"
elif [ "$choixmenu" = "is" ];then
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
@ -142,6 +140,6 @@ elif [ "$choixmenu" = "ap" ];then
zenity --width=600 --height=400 --info --text="<tt>$(cd $dossierprofil && cat $fichierprofil)</tt>"
elif [ "$choixmenu" = "" ];then
zenity --width=500 --info --text="Aucun choix, retour au menu."
zenity --width=600 --info --text="Aucun choix, retour au menu."
fi
done