View Issue Details

IDProjectCategoryView StatusLast Update
0002852The Dark ModCodingpublic02.09.2011 17:04
Reportertels Assigned Totels  
PrioritynormalSeveritynormalReproducibilitysometimes
Status resolvedResolutionfixed 
Product VersionTDM 1.06 
Target VersionTDM 1.07Fixed in VersionTDM 1.07 
Summary0002852: fix GUI command handling with args in HandleMainMenuCommands()
DescriptionHandleMainMenuCommands() is called for each command or argument from the GUI:

 set "cmd" "log 'argument'"

results in the following calls:

 HandleMainMenuCommands("log")
 HandleMainMenuCommands("argument")

and this:

 set "cmd" "mainmenu_heartbeat"

results in:

  HandleMainMenuCommands("mainmenu_heartbeat")
  HandleMainMenuCommands(";")


this makes it impossible to recover arguments to commands (except for "log", which is special-cased in the code).
Additional InformationThe code needs to be changed so that it keeps a stack of "command" "arg1" "arg2" etc, and when it sees ";", then it executes the first command (and the arguments are then available).

This also means adding ";" to each command in the gui, otherwise the final ";" call might be missing and we are not able to distinguish the command "log" from the argument "log"; Alternatively, we could also hard-code the number of arguments for each command, and ignore stray ";" commands.
TagsNo tags attached.

Activities

tels

tels

02.09.2011 17:03

reporter   ~0004013

Resolved this by completely rewriting the logic in HandleMainMenuCommands(), checked in as revision 0004964.

* We watch for the first command, ignoring any stray ";".
* Once seen, we deduce the number of arguments (a small hard-coded list, with the default being 0)
* we then collect arguments until we have enough
* then handle (or ignore) the command

A few special cases are handled, too, like 'set "notime" "1"' resulting in three calls with "set", "notime" and "1".

Issue History

Date Modified Username Field Change
02.09.2011 14:06 tels New Issue
02.09.2011 14:06 tels Assigned To => tels
02.09.2011 17:03 tels Note Added: 0004013
02.09.2011 17:03 tels Status new => resolved
02.09.2011 17:03 tels Fixed in Version => TDM 1.07
02.09.2011 17:03 tels Resolution open => fixed
02.09.2011 17:04 tels Target Version => TDM 1.07