factorisation du menu
This commit is contained in:
parent
d19d5277ec
commit
53b69c67fb
41
borg-gui.sh
41
borg-gui.sh
@ -140,7 +140,20 @@ else
|
||||
MenuEspaceDisque=""
|
||||
fi
|
||||
|
||||
# notification si espace disque faible
|
||||
NotificationEspaceDisque () {
|
||||
if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then
|
||||
zenity --window-icon warning --notification --text="borg-zenity\nEspace disque faible"
|
||||
fi
|
||||
}
|
||||
|
||||
MenuCompacter="co\nCompacter le dépôt\n"
|
||||
MenuMonter="ms\nMonter une archive\n"
|
||||
MenuFiltre="fi\nFiltre : "$filter"\n"
|
||||
MenuBarreHorizontale="--\n------------------------------------------\n"
|
||||
MenuInfoDepot="id\nInformation sur le dépôt\n"
|
||||
MenuAfficherProfil="ap\nAfficher le profil\n"
|
||||
MenuQuitter="qu\nQUITTER\n"
|
||||
|
||||
#################################################################################
|
||||
# Affichage du menu
|
||||
@ -148,45 +161,39 @@ MenuCompacter="co\nCompacter le dépôt\n"
|
||||
|
||||
if [ $menu_avance = "true" ];then
|
||||
|
||||
# notification si espace disque faible
|
||||
if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then
|
||||
zenity --window-icon warning --notification --text="borg-zenity\nEspace disque faible"
|
||||
fi
|
||||
NotificationEspaceDisque
|
||||
|
||||
# menu avancé
|
||||
choixmenu=$(echo -e "\
|
||||
$(echo $MenuCreer)\
|
||||
ms\nMonter une archive\n\
|
||||
$(echo $MenuMonter)\
|
||||
$(echo $MenuDemonter)\
|
||||
$(echo $MenuSupprimer1)\
|
||||
$(echo $MenuSupprimerX)\
|
||||
$(echo $MenuRenommer)\
|
||||
$(echo $MenuCompacter)\
|
||||
$(echo $MenuInfo)\
|
||||
fi\nFiltre : "$filter"\n\
|
||||
--\n------------------------------------------\n\
|
||||
id\nInformation sur le dépôt\n\
|
||||
ap\nAfficher le profil\n\
|
||||
--\n------------------------------------------\n\
|
||||
$(echo $MenuFiltre)\
|
||||
$(echo $MenuBarreHorizontale)\
|
||||
$(echo $MenuInfoDepot)\
|
||||
$(echo $MenuAfficherProfil)\
|
||||
$(echo $MenuBarreHorizontale)\
|
||||
$(echo $MenuEspaceDisque)\
|
||||
qu\nQUITTER\
|
||||
$(echo $MenuQuitter)\
|
||||
" | zenity $iconborg --list $H $W --title "$nomsauvegarde" \
|
||||
--hide-header --hide-column=1 --column "id" --column "choix")
|
||||
|
||||
else
|
||||
# notification si espace disque faible
|
||||
if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then
|
||||
zenity --window-icon warning --notification --text="borg-zenity\nEspace disque faible"
|
||||
fi
|
||||
|
||||
NotificationEspaceDisque
|
||||
# menu simple
|
||||
choixmenu=$(echo -e "\
|
||||
$(echo $MenuCreer)\
|
||||
ms\nMonter une archive\n\
|
||||
$(echo $MenuMonter)\
|
||||
$(echo $MenuDemonter)\
|
||||
$(echo $MenuSupprimer1)\
|
||||
$(echo $MenuEspaceDisque)\
|
||||
qu\nQUITTER\
|
||||
$(echo $MenuQuitter)\
|
||||
" | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \
|
||||
--hide-header --hide-column=1 --column "id" --column "choix")
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user