Duplicate index handling¶
Once we add the ability for the user to alter sorting/saving indexes, we'll need to be able to prevent duplicate indexes, because we can't save the files if any two will end up with the same filename.
There are two basic strategies: prevention and accommodation
- Whenever the user enters a duplicate index, display a prominent warning message near the edit-box (maybe indicating the current numerical order of the other one?)
- If there are duplicates when the user presses the save-files icon, go to the first duplicate found (which should also draw the user's attention to the fact that it's a duplicate).
- If the user enters text which matches an existing sorting index, then:
- (a) if both are int, just renumber the set but treat user-edited indexes as fixed.
- (b) if the user-text is not an int, then add a numeric suffix to it. (Experimentation will determine whether it should be added to both, or if this just makes more work.)