nirea/ocupdater — pull request #22 by SatomiAhn (2011-12-02 12:46:03+00:00)
Title: Auth once - Issue 1432

This implements the ideas I described in issue 1432.
The goal being that a user needs to be authed only once during a thread of commands, and not every time the user presses a dialog button which only they can press anyway.

This involves 2 major architectural changes:
- (SUBMENU, "") messages are replaced by (COMMAND_XXX, "menu "), thus retaining auth data. SUBMENU is therefore deprecated.
- DIALOG and DIALOG_RESPONSE have one more token in their list of parameters which is the auth value of the menu user.

All scripts have been modified to be made compatible with the new messages.
Moreover, these changes made the following improvements possible:
- scripts do not need to use COMMAND_NOAUTH anymore unless they handle initial input events (listen, in "listener" script, or touch, in "menu" script), so they do not use it anymore.
- consequently, most of the time, command handlers have been moved into a new UserCommand() function, which makes it possible to call for commands from within the script without using link messages (which are not needed anymore, since auth data is already known)
- the latter made it possible to get rid of a large proportion of this "remenu" nonsense, since commands are handled synchronously and the menu is recalled just after calling UserCommand(), without having to wait for an event.
- the extent of these changes forced me to review and try to make sense out of all the scripts, several of those had to be reworked in the process.

Note that in some cases it was not possible to remove "remenus" completely. This is when we need to wait for true external events (answer from the dataserver, from a sensor or from the RLV for instance).

I have been using this branch since Nov 23 with no major issue. It was submitted for testing to R&D group this week and all reported bugs (leash script) have been fixed.