Skip to content

Ask user on adding a tag with the same url

I added some question dialogs in some places.

TODO list

  • https://bugs.kde.org/show_bug.cgi?id=439423 - Resources remain assigned to deleted tags.
  • https://bugs.kde.org/show_bug.cgi?id=439422 - Can't name a tag after a deleted tag.
  • Krita will create "All" and "All Untagged" tags if the user chooses "Overwrite" option in the dialog. It won't break the automated tags, it will appear as a new tag, but it's still wrong.
  • In the TagChooser, the option shouldn't be called "Undelete" because we don't know if the tag is deleted or not.
  • In the Tag tool button, it shouldn't show "Undelete X" if it has been undeleted already... ehhh - https://bugs.kde.org/show_bug.cgi?id=440337 - this is only a visual issue, so let's just keep it for now, maybe? It doesn't cause trouble.
  • KisTagModel should have an option "allowOverwrite" when creating a tag
  • Halla's fix for the message
  • Fix the message to be more user-friendly and use Restore, maybe.
  • All commits are buildable.

Test Plan

Test 1

  1. Create a tag "tagA".
  2. Assign some resources.
  3. Delete it using tag tool button popup.
  4. Try to create a tag called "tagA" using one of those three methods:
    • right-click in resource chooser (textbox)
    • tag tool button textbox
    • Resource Manager -> select any resource (of the same type) -> press [+] button -> use the textbox
  5. Choose either "Overwrite", "Undelete" or "Cancel".

Test 2

  1. Create a tag "tagB".
  2. Assign some resources. (optional)
  3. Try to create a tag called "tagB" using the same methods as above.
  4. Choose either "Overwrite", "Undelete" or "Cancel".

(Overwrite = only the new resources are assigned; Undelete = the previously assigned resources are still assigned; Cancel = noop).

Test 3

  1. Create a tag "tagC"
  2. Assign some resources.
  3. (Optional) Delete "tagC"
  4. Create a tag "tagD"
  5. Assign some resources
  6. Rename "tagD" to "tagC"
  7. Choose either "Yes" (it will remove previous tagC, then rename tagD to tagC - so the resources previously assigned to tagC won't be assigned to it anymore) or "Cancel" (no operation)

Test 4

  1. Try to create a tag called "All" (it should show up a warning message) via Tag Tool Button
  2. Try to create a tag called "All Untagged" (it should show up a warning message) in the resource chooser in right-click
  3. Try to rename an existing tag to "All Untagged" (it should show up a warning message) in the Tag Tool Button

I also got this test summary from Alan: https://libera.ems.host/_matrix/media/r0/download/libera.chat/9ee665057d0d0b1d8c71288975a92dc1529831be/message.txt but it seems like all of the objective issues has been addressed.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Edited by Agata Cacko

Merge request reports