diff --git a/patch-control.sh b/patch-control.sh index 78d90dd4925b6902b7c0f5c95f08b8cabcbc0ff0..a60b56007640f7c42a824709ef662b3ef0f9feac 100644 --- a/patch-control.sh +++ b/patch-control.sh @@ -37,16 +37,23 @@ function on_exit() { unset pid } -function createList() { +function get_run_setup_file() { local LIST - local file + local line - for file in *.detectorfile; do - LIST=(${LIST[*]} "FALSE" ${file}) - done - unset file + while IFS=';' read -ra line; do + LIST+=("FALSE" "${line[@]}") + done < pc.cfg - echo ${LIST[*]} + echo $(zenity --title "Run Setup Selector" \ + --list \ + --text "Select one of the following Run Setups:" \ + --radiolist \ + --column="Selection" \ + --column="Run Setup file" \ + --column="Run Setup name" \ + --column="Description" \ + --hide-column=2 "${LIST[@]}") } function dm_driver() { @@ -95,13 +102,7 @@ while [ 1 ]; do # Ask for the run setup - rs_file=`zenity --title "Run Setup Selector" \ - --list \ - --text "Select one of the following Run Setups:" \ - --radiolist \ - --column="Selection" \ - --column="Run Setup file" \ - $(createList ${folder})` + rs_file=`get_run_setup_file` if [ -z "${rs_file}" ]; then zenity --error --text="No Run Setup file selected, aborting"