Add remove button for user imported templates
Added a Remove button to the Template dialog under the guidance of Kåre Särs, enabling users to delete templates they have imported.
Behavior:
- Enables the Remove button only for user-imported templates.
- Automatically removes the parent category folder if it becomes empty after deletion.
- Displays success/error messages and resets the UI state upon completion.
- Refreshes the template tree to reflect the changes.
Implementation:
- Updated
Template::templateIndexChanged()to handle button state logic based on path writability. - Added
Template::onRemoveClicked()to manage recursive deletion and empty directory pruning. - Applied
clang-format.