Fix error message if cancel DPI option

This commit is contained in:
q3aql 2021-07-09 12:17:11 +02:00
parent 7192d5d295
commit 705d6ebeb5
2 changed files with 22 additions and 14 deletions

View File

@ -213,15 +213,19 @@ while [ ${showMenu} -eq 0 ] ; do
fi
elif [ "${opcion}" == "${imagesPath}/mouse-dpi.png" ] ; then
dpi_number=$(zenity --entry --title "Set DPI (from 50 to 8000)" --window-icon=${iconPath} --text "Enter DPI number (from 50 to 8000):" --entry-text "800")
sleep 2 | zenity --progress --title "zenidrv-g203-lightsync ${VERSION} (${M_DATE})" --text "Setting DPI to ${dpi_number}" \
--window-icon=${iconPath} --pulsate --no-cancel --auto-close
g203-led.py lightsync dpi ${dpi_number}
device_error=$?
if [ ${device_error} -eq 0 ] ; then
if [ -z ${dpi_number} ] ; then
echo > /dev/null
else
zenity --title "zenidrv-g203-lightsync ${VERSION} ($M_DATE)" --error --window-icon=${iconPath} --width=280 \
--text "Device not found or connected"
sleep 2 | zenity --progress --title "zenidrv-g203-lightsync ${VERSION} (${M_DATE})" --text "Setting DPI to ${dpi_number}" \
--window-icon=${iconPath} --pulsate --no-cancel --auto-close
g203-led.py lightsync dpi ${dpi_number}
device_error=$?
if [ ${device_error} -eq 0 ] ; then
echo > /dev/null
else
zenity --title "zenidrv-g203-lightsync ${VERSION} ($M_DATE)" --error --window-icon=${iconPath} --width=280 \
--text "Device not found or connected"
fi
fi
elif [ "${opcion}" == "${imagesPath}/light-off.png" ] ; then
sleep 2 | zenity --progress --title "zenidrv-g203-lightsync ${VERSION} (${M_DATE})" --text "Turning off the light on the mouse" \

View File

@ -191,15 +191,19 @@ while [ ${showMenu} -eq 0 ] ; do
fi
elif [ "${opcion}" == "${imagesPath}/mouse-dpi.png" ] ; then
dpi_number=$(zenity --entry --title "Set DPI (from 200 to 8000)" --window-icon=${iconPath} --text "Enter DPI number (from 200 to 8000):" --entry-text "800")
sleep 2 | zenity --progress --title "zenidrv-g203-prodigy ${VERSION} (${M_DATE})" --text "Setting DPI to ${dpi_number}" \
--window-icon=${iconPath} --pulsate --no-cancel --auto-close
g203-led.py dpi ${dpi_number}
device_error=$?
if [ ${device_error} -eq 0 ] ; then
if [ -z ${dpi_number} ] ; then
echo > /dev/null
else
zenity --title "zenidrv-g203-prodigy ${VERSION} ($M_DATE)" --error --window-icon=${iconPath} --width=280 \
--text "Device not found or connected"
sleep 2 | zenity --progress --title "zenidrv-g203-prodigy ${VERSION} (${M_DATE})" --text "Setting DPI to ${dpi_number}" \
--window-icon=${iconPath} --pulsate --no-cancel --auto-close
g203-led.py dpi ${dpi_number}
device_error=$?
if [ ${device_error} -eq 0 ] ; then
echo > /dev/null
else
zenity --title "zenidrv-g203-prodigy ${VERSION} ($M_DATE)" --error --window-icon=${iconPath} --width=280 \
--text "Device not found or connected"
fi
fi
elif [ "${opcion}" == "${imagesPath}/light-off.png" ] ; then
sleep 2 | zenity --progress --title "zenidrv-g203-prodigy ${VERSION} (${M_DATE})" --text "Turning off the light on the mouse" \