diff --git a/AmRRON-PAT-GUI.sh b/AmRRON-PAT-GUI.sh index f6781da..eda6921 100755 --- a/AmRRON-PAT-GUI.sh +++ b/AmRRON-PAT-GUI.sh @@ -252,18 +252,48 @@ findalias_menu function findalias_menu() { -LISTLOC="$HOME/Documents/ardop-list" +LISTLOC="$HOME/Documents" - if [[ -f $LISTLOC/ardoplist.txt ]]; then + +FINDALIAS=$(yad --center --wrap --show-uri \ + --title="Select Modem" \ + --text="Please choose the modem type you would like to search aliases." \ + --image=$DIR/images/corps-icon.png \ + --button="VARA:3" \ + --button="ARDOP:2" \ + --button="Exit:1" \ +${c} ${r}) +rc=$? +if [[ $rc -eq 2 ]]; then + if [[ -f $LISTLOC/ardop-list/ardoplist.txt ]]; then LASTUPDATE=$(cat $HOME/Documents/ardop-list/ardoplist.txt | head -n 1) else getardoplist | yad --center --progress --pulsate --auto-close --auto-kill --button gtk-cancel:1 --title "Downloading ARDOP Station lists" --text "Please wait while I download the current list of ARDOP stations..." ${r} ${c} fi + MODE=ardop + MODEUPDATE=getardoplist + LISTTXT=ardoplist.txt +elif [[ $rc -eq 1 ]]; then + exit 1 +elif [[ $rc -eq 3 ]]; then + if [[ -f $LISTLOC/vara-list/varalist.txt ]]; then + LASTUPDATE=$(cat $HOME/Documents/vara-list/varalist.txt | head -n 1) + else + getvaralist | yad --center --progress --pulsate --auto-close --auto-kill --button gtk-cancel:1 --title "Downloading VARA Station lists" --text "Please wait while I download the current list of VARA stations..." ${r} ${c} + fi + MODE=vara + MODEUPDATE=getvaralist + LISTTXT=varalist.txt +fi + + + + VIEWER="evince -w" GRIDMAP="$HOME/Documents/grid-map.pdf" BANDS=$(echo 20M,30M,40M,80M) GRIDS=$(echo CN,DN,EN,FN,CM,DM,EM,FM,DL,EL,FL) -if [[ $(jq .ardop.rig $PATCONFIG | tr -d \") == "" ]]; then +if [[ $(jq .$MODE.rig $PATCONFIG | tr -d \") == "" ]]; then FORMAT=$(echo "Manual Tuning,Rigctl Tuning") else FORMAT=$(echo "Rigctl Tuning,Manual Tuning") @@ -286,7 +316,7 @@ FINDALIAS=$(yad --center --wrap --show-uri \ ${c} ${r}) rc=$? if [[ $rc -eq 2 ]]; then - { getardoplist | yad --center --progress --pulsate --auto-close --auto-kill --button gtk-cancel:1 --title "Downloading ARDOP Station lists" --text "Please wait while I download the current list of ARDOP stations..." ${r} ${c}; findalias_menu; return; } + { $MODEUPDATE | yad --center --progress --pulsate --auto-close --auto-kill --button gtk-cancel:1 --title "Downloading Station lists" --text "Please wait while I download the current list of stations..." ${r} ${c}; findalias_menu; return; } elif [[ $rc -eq 1 ]]; then exit 1 elif [[ $rc -eq 3 ]]; then @@ -299,13 +329,13 @@ BAND=$(echo $FINDALIAS | awk -F "," '{print $1}' | tr [:upper:] [:lower:]) GRID=$(echo $FINDALIAS | awk -F "," '{print $2}') TUNEMODE=$(echo $FINDALIAS | awk -F "," '{print $4}' | awk '{print $1}') -cat $LISTLOC/${BAND}ardoplist.txt | awk '$2 ~/'${GRID}'/{print $1,$2,$3,$4,$7,$11}' | sed 's/^/false /' | tr ' ' '\012' > /tmp/stationlist +cat $LISTLOC/${BAND}${LISTTXT} | awk '$2 ~/'${GRID}'/{print $1,$2,$3,$4,$7,$11}' | sed 's/^/false /' | tr ' ' '\012' > /tmp/stationlist cat /tmp/stationlist | yad --image=$DIR/images/corps-icon.png --center \ --checklist \ --separator="," \ - --title "ARDOP Stations" \ + --title "Stations" \ --text "Select the stations you would like to add to your PAT alias list" \ --list \ --button="Exit:1" \