[038_limit_curves_selection], issue #38, Limited selection in listbox#43
Merged
Conversation
The listbox widget, where several curves can be selected to be plotted at once, now has a limited number of selectable items. In the 'PlotSettingsListBox', the 'MAX_SELECTABLE_ITEMS' attribute drives how many curves can be plotted. If more items than the admitted one are selected, only the number of items indicated by 'MAX_SELECTABLE_ITEMS' are actually shown as selected and can be plotted. Any further attempt to selected another item in the listbox widget does not produce any result. This limit has been introduced to cope with the fact that the plotting executable can produce a limited number of plot files.
lelaus
reviewed
Jul 4, 2025
| self.stored_indxs = indexes[0:10] | ||
| # Get the indices of the items to be deselected | ||
| indxs = set(indexes) - set(self.stored_indxs) | ||
| if indxs: |
Collaborator
There was a problem hiding this comment.
This if statement seems useless. Actually, if you are here, the indexes in excess are at least one. You are here because lex(indexes) is greater than 10, so ... Please check whether this if statement can be removed.
lelaus
reviewed
Jul 7, 2025
…ogic as requested by reviewer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
To cope with the fact that the TuPlot executable can produce a limited number of plot files (i.e. 10), the listbox widget of the GUI, where several curves can be selected to be plotted at once, has been modified to have a limited number of selectable items.
In the
PlotSettingsListBoxclass, theMAX_SELECTABLE_ITEMSattribute has been introduced to drive how many curves can be selected and then plotted. If more items than the admitted ones are selected, only the firstly 10 selected items will be actually shown as selected and plotted. Any attempt to select an additional item in the listbox widget will produce no changes.