]> git.tuebingen.mpg.de Git - gsu.git/commit
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)
commit2925cf7299f958ed6c52ba1ba9d42a841d86c8f2
treee8a45b66bc035be25074de1cfc8a553ab7db411c
parent4e70cf69ed41bbf2cf1983cdae4ea3f6d2f1c684
gui: Conform to $ret and $result conventions.

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.
common
gui