Feature #478
RCP: x.x, Macro parameters remanence
Statut: | Closed | Début: | 06/12/2013 | |
---|---|---|---|---|
Priorité: | Urgent | Echéance: | ||
Assigné à: | - | % réalisé: | 100% |
|
Catégorie: | Macros | Temps passé: | - | |
Version cible: | TXM 0.7.8 |
Description
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.
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
- 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"
Parameter value binding strategy
The macro parameters take their value from 4 different environments:- def: macro script default value, the @Field 'def' attribute (set by the Macro source code)
- properties: .properties parameter file, the <MacroName>.properties file (set by previous call)
- field: parameter field value in dialog box, the parameters dialog box (typed by the user)
- args: value given by the calling macro, the "args" global variable
- if the parameter is defined in args then use that value
- the properties value is not updated
- else:
- if all parameters are set by args don"t show the dialog box
- open the parameters dialog box with all the parameters not defined in args (their default value comes from properties if available otherwise from def)
- use the value given by field
- if all parameters are set by args don"t show the dialog box
Historique
#1 Mis à jour par Serge Heiden il y a plus de 10 ans
- Description mis à jour (diff)
#2 Mis à jour par Serge Heiden il y a environ 10 ans
- Sujet changé de RCP: x.x, Macros parameters remanence à RCP: x.x, Macro parameters remanence
- Description mis à jour (diff)
- Catégorie mis à Toolbox
- Priorité changé de Normal à Urgent
- Version cible mis à TXM 0.7.8
#3 Mis à jour par Serge Heiden il y a environ 10 ans
- Description mis à jour (diff)
#4 Mis à jour par Matthieu Decorde il y a environ 10 ans
- Catégorie changé de Toolbox à Macros
#5 Mis à jour par Matthieu Decorde il y a environ 10 ans
- Description mis à jour (diff)
#6 Mis à jour par Serge Heiden il y a environ 10 ans
- Description mis à jour (diff)
#7 Mis à jour par Serge Heiden il y a environ 10 ans
- Description mis à jour (diff)
#8 Mis à jour par Matthieu Decorde il y a environ 10 ans
- Description mis à jour (diff)
#9 Mis à jour par Matthieu Decorde il y a environ 10 ans
- Description mis à jour (diff)
#10 Mis à jour par Matthieu Decorde il y a environ 10 ans
- % réalisé changé de 0 à 80
#11 Mis à jour par Sebastien Jacquot il y a plus d'un an
- Statut changé de New à Closed
#12 Mis à jour par Sebastien Jacquot il y a plus d'un an
- % réalisé changé de 80 à 100