SasView / sasview

Code for the SasView application.
BSD 3-Clause "New" or "Revised" License
50 stars 41 forks source link

Deleting data from the data explorer does not actually remove all vestiges thereof #3015

Closed butlerpd closed 1 month ago

butlerpd commented 1 month ago

Describe the bug Deleting data from the explorer using the Delete Data button loads a pop up stating This operation will remove the checked data from the data explorer. Do you want to continue? Hitting yes removes it from the explorer and any plot that contains only that data (though it will not remove it from plots that contain other data as well). However it seems to keep a record in memory somewhere of at least some of at least the data title. But it is not accessible otherwise. Loading that dataset again from disk (since it is no longer retrievable) appends a [1] at the end of the file title.

However, Deleting the data from the explorer by right clicking on the data set name in the explorer (context menu) and then choosing Delete loads a pop up stating This operation will remove the selected data sets and all the dependents from the data explorer. Do you want to continue? Hitting yes in this case will behave exactly as before (including leaving the data plotted on a plot that contains other data). However, when reloading the data there is no new [x] appended to the title indicating that in this case all vestiges have been removed.

Finally, loading a new project will load a pop up stating This operation will remove all data, plots and analyses from SasView before loading the project. Do you wish to continue? This of course removes everything as it says and reloading one of the datafiles after this also does not append any [x]

Expected behavior

This last may be harder so a first step could be the first two bullets?

SasView version (please complete the following information):

Operating system (please complete the following information):

Additional context Discovered as part the NIST CNR summer school

krzywon commented 1 month ago

The first issue, related to appending the [1] to the data, is new for 6.0 (in fact, it was fixed for some version of 5) and should be fixed for the release. The language in the popups could be fixed at the same time for the release version, but it matches the language used in 5.0.6, so only if it is an easy fix.

rozyczko commented 1 month ago

Selecting a dataset and pressing the Delete Data button is showing the described problem. Right-clicking on the dataset and selecting Delete works properly (subsequent loads don't append [1])

rozyczko commented 1 month ago

Fixed the issue and unified the warning messages.

butlerpd commented 1 month ago

Is there a PR to test this with? Happy to review when ready. Sounds like it should be ready?

rozyczko commented 1 month ago

Fixed the issue and unified the warning messages.

Whoops, looks like I forgot to actually make a PR... Here it is now:

https://github.com/SasView/sasview/pull/3089