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=""
|
MenuEspaceDisque=""
|
||||||
fi
|
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"
|
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
|
# Affichage du menu
|
||||||
@ -148,45 +161,39 @@ MenuCompacter="co\nCompacter le dépôt\n"
|
|||||||
|
|
||||||
if [ $menu_avance = "true" ];then
|
if [ $menu_avance = "true" ];then
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# menu avancé
|
# menu avancé
|
||||||
choixmenu=$(echo -e "\
|
choixmenu=$(echo -e "\
|
||||||
$(echo $MenuCreer)\
|
$(echo $MenuCreer)\
|
||||||
ms\nMonter une archive\n\
|
$(echo $MenuMonter)\
|
||||||
$(echo $MenuDemonter)\
|
$(echo $MenuDemonter)\
|
||||||
$(echo $MenuSupprimer1)\
|
$(echo $MenuSupprimer1)\
|
||||||
$(echo $MenuSupprimerX)\
|
$(echo $MenuSupprimerX)\
|
||||||
$(echo $MenuRenommer)\
|
$(echo $MenuRenommer)\
|
||||||
$(echo $MenuCompacter)\
|
$(echo $MenuCompacter)\
|
||||||
$(echo $MenuInfo)\
|
$(echo $MenuInfo)\
|
||||||
fi\nFiltre : "$filter"\n\
|
$(echo $MenuFiltre)\
|
||||||
--\n------------------------------------------\n\
|
$(echo $MenuBarreHorizontale)\
|
||||||
id\nInformation sur le dépôt\n\
|
$(echo $MenuInfoDepot)\
|
||||||
ap\nAfficher le profil\n\
|
$(echo $MenuAfficherProfil)\
|
||||||
--\n------------------------------------------\n\
|
$(echo $MenuBarreHorizontale)\
|
||||||
$(echo $MenuEspaceDisque)\
|
$(echo $MenuEspaceDisque)\
|
||||||
qu\nQUITTER\
|
$(echo $MenuQuitter)\
|
||||||
" | zenity $iconborg --list $H $W --title "$nomsauvegarde" \
|
" | zenity $iconborg --list $H $W --title "$nomsauvegarde" \
|
||||||
--hide-header --hide-column=1 --column "id" --column "choix")
|
--hide-header --hide-column=1 --column "id" --column "choix")
|
||||||
|
|
||||||
else
|
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
|
# menu simple
|
||||||
choixmenu=$(echo -e "\
|
choixmenu=$(echo -e "\
|
||||||
$(echo $MenuCreer)\
|
$(echo $MenuCreer)\
|
||||||
ms\nMonter une archive\n\
|
$(echo $MenuMonter)\
|
||||||
$(echo $MenuDemonter)\
|
$(echo $MenuDemonter)\
|
||||||
$(echo $MenuSupprimer1)\
|
$(echo $MenuSupprimer1)\
|
||||||
$(echo $MenuEspaceDisque)\
|
$(echo $MenuEspaceDisque)\
|
||||||
qu\nQUITTER\
|
$(echo $MenuQuitter)\
|
||||||
" | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \
|
" | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \
|
||||||
--hide-header --hide-column=1 --column "id" --column "choix")
|
--hide-header --hide-column=1 --column "id" --column "choix")
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user