Fixes minor bugs in the model editor (PluginDefinition.py and its parent TabbedModelEditor.py) that impede usability or cause undesirable effects.
Generates error message when user neglects to input a model name (84e4ebe)
Fixes behavior where a model syntax error (bad unicode) is thrown instead, which is unintuitive
Allows user to create model even if default function text is unedited (b4c8f8c, bf3b57a)
Fixes bug in which user had to perform an edit action in the function box before model could be saved
Changed behavior of model parameter tables in GUI (01b286c)
Previously would add new rows to tables even if no parameters were changed and would create unnecessary amounts of blank rows that could not be deleted
Previously new rows would be generated only after editing a parameter's value box and not the name of the parameter itself
Fixes #1633 by ensuring both model and syntax checks are applied to user models regardless of whether they are defined using PluginDefinition or ModelEditor (558c7a1, 54a8aaf, 2b71022)
Note: Previously, only syntax was checked when using ModelEditor and only model tests were run when using PluginDefinition. The syntax checks were done using the ast library, which only checks for SyntaxErrors. I have kept this check as the first one that runs because it can often catch SyntaxErrors with more precision than using GuiUtils.checkModel(). In theory we don't need to run the ast check on models generated with the plugin editor, but it doesn't seem to add significant overhead and could even be useful if future changes break the model template.
Fixes bug that prevented user from viewing/editng C model associated with a Python file if the C model contained errors when loading into the model editor. (eb3dee0, 14d1e0a)
New behavior: shows popup warning the user that the model loaded into the editor contains errors and must be fixed before using
Fixes bug causing font to change in the function definition textbox if the user deleted all its text (788433b)
Note: bug was fixed by changing default text in box to Consolas, which is a Microsoft font. The fix still works on my Mac, however, probably because the system knows to substitute a similar monospace font. Even if the fix didn't work on Linux, this change should only make things better and I highly doubt it would create a worse result than before.
How Has This Been Tested?
Verified correct behavior in SasView and checked wide variety of possible user inputs to search for additional bugs. Windows installer tested and verified.
Review Checklist:
Documentation (check at least one)
[x] There is nothing that needs documenting
[ ] Documentation changes are in this PR
[ ] There is an issue open for the documentation (link?)
Installers
[ ] There is a chance this will affect the installers, if so
[x] Windows installer (GH artifact) has been tested (installed and worked)
[ ] MacOSX installer (GH artifact) has been tested (installed and worked)
Licensing (untick if necessary)
[x] The introduced changes comply with SasView license (BSD 3-Clause)
Description
Fixes minor bugs in the model editor (
PluginDefinition.py
and its parentTabbedModelEditor.py
) that impede usability or cause undesirable effects.PluginDefinition
orModelEditor
(558c7a1, 54a8aaf, 2b71022)ModelEditor
and only model tests were run when usingPluginDefinition
. The syntax checks were done using theast
library, which only checks for SyntaxErrors. I have kept this check as the first one that runs because it can often catch SyntaxErrors with more precision than usingGuiUtils.checkModel()
. In theory we don't need to run theast
check on models generated with the plugin editor, but it doesn't seem to add significant overhead and could even be useful if future changes break the model template.How Has This Been Tested?
Verified correct behavior in SasView and checked wide variety of possible user inputs to search for additional bugs. Windows installer tested and verified.
Review Checklist:
Documentation (check at least one)
Installers
Licensing (untick if necessary)