Feature #478

Updated by Matthieu Decorde over 3 years ago

It is cumbersome for the user to have to set all the parameters again from scratch (from the macro default values) in case of repetitive calls, which is the most frequent use case of macros.

h3. Solution

Use a file named '<MacroName>.properties' (in the 'parameter_name=value' .properties format), stored in the same directory as the macro, to store previous values given to the parameters in the parameters dialog box; And use those values to initialize the parameters in the parameters dialog box for the next call.

When opening the parameters dialog box of a macro:
* if a file named <MacroName>.properties is present, use its content to initialize the parameters values
* otherwise set the parameters to the default values of the macro

When closing the parameters dialog box:
* store the macro parameters values before execution:
** in a file named <MacroName>.properties (hidden in the macro view)
** in the same directory as the macro file
** with a .properties structure and semantics
** each parameter value is defined by a line pattern "parameterName=value"

The macro parameters are set in 4 different manners :
* With the @Field 'def' attribute (set by the Macro source code)
* With the <MacroName>.properties file (set by previous call)
* With the parameters dialog (set by user)
* With the "args" variable (set by another Macro)