[ENH] Edit Domain: Change types of multiple variables #6426
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #6088.
Based on #6415 to avoid conflicts.
Description of changes
Allows changing the variable type for multiple variables at once.
As discussed with @markotoplak, editing other properties, even labels, would be confusing because controls would have to be disabled if selected variables differ in those properties. Also, the widget already has over 3000 lines of complex code.
The only feature we could easily add would be a tri-state checkbox for unlinking.
The widget has four separate editors for different variable types, which are stacked into a single editor. This PR implements a fifth editor, which is blank (except for the combo with type) and can handle multiple variables. Existing editors are kept as they are, that is, they accept a single variable. The "top editor" has separate methods for single and multiple variables. One might think that the four editors could accept lists instead of single variables to avoid having duplicated methods in the top editor. I thought so for long time, too, but the code was just getting more and more complex. This solution is simpler.
Includes