]> git.tuebingen.mpg.de Git - gsu.git/commitdiff
gui: Conform to $ret and $result conventions.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 1 Sep 2014 22:23:41 +0000 (00:23 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 27 Sep 2014 23:02:00 +0000 (23:02 +0000)
Unlike the rest of gsu, the functions of the gui module did not follow
the rule that functions should always set $ret to indicate error or
success, and $result to either the result of the function (if any)
or to an error context string. This commit makes all functions of
the gui module conform to this rule.

This patch also improves the error handling of _gsu_menu(). This
function should distinguish between three cases, according to the
exit code of dialog(1): OK (user selected the OK button), Cancel
(user pressed the escape key or selected the Cancel button), and error
(dialog(1) failed to execute or returned unsuccessfully).

The old code does not distinguish between the last two cases. Hence one
could not exit the application by pressing CTRL+C from a menu. This
patch changes _gsu_menu() to look more carefully at the exit code of
dialog(1) to tell apart the "error" case and the "cancel" case.


No differences found