Improve the ID range policy feature #1179
Merged
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.
This PR attempts to fix the problems caused by the incompatibility between the “remember last ID between Protégé sessions” feature and the support for ID range policy files, highlighted in #1108.
First, it adds a new option to the “New entities” settings dialog to disable the support for ID range policy files – that is, to make Protégé ignore such files completely, as it was doing prior to version 5.6.0. This allows users that are annoyed by that feature to be no longer affected by it if they so wish, without having to remove or rename the
-idranges.owl
files in their ontologies.Second, when an ID range policy is in effect and the “remember last ID between Protégé sessions” feature is enabled, the last used ID will now be saved under a name that is dependent on the policy currently in use. This means that Protégé will “remember” not only one single last ID globally, but one last ID for each ID range policy. This fixes the #1108 issue proper.
Third, when an ontology is reloaded (e.g. with File > Reload), the ID range policy will be reloaded as well. This allows to make sure any changes to the policy file is taken into account without having to close Protégé and opening it again. This also allows, for example, users who have more than one range assigned to them (or users who mistakenly selected the wrong range when prompted) to switch to another range by having Protégé display the range selection dialog again, without having to close Protégé and opening it again.