Bug 139708 - On "Delete Category" in Template Manager open the file browser at the location and remove internal handling
Summary: On "Delete Category" in Template Manager open the file browser at the locatio...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: security
Depends on:
Blocks: Template-Manager
  Show dependency treegraph
 
Reported: 2021-01-17 17:20 UTC by sdc.blanco
Modified: 2021-09-09 12:40 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sdc.blanco 2021-01-17 17:20:45 UTC
In Template Manager (Ctrl+Shift+N), open the "Delete category" dialog (use "gear icon", select "Delete category")

One change in the dialog box:

1. Do not show the “system” categories from share directory (because they cannot be deleted)

(plus assuming that bug 138975 is resolved so that "None" does not appear, unless it is a user-created category -- which is already possible).

Three changes in the "action" that results from clicking "OK" after selecting a category. 

1.     If a category subdirectory only has templates in it, then

      a.  show a new dialog box:  

        This category has templates.  Do you want to delete or move them?

        Help    Delete templates     Move templates     Cancel 

      b. If “move templates” is chosen, then show Category dialog box again to choose to which category they should be moved. 

      c.  For both "delete" and "move", delete the subdirectory that corresponds to the category.

2.   If a category has other files then templates, follow same actions as previous point, but do not delete the subdirectory.

    NB.  Use groupuinames.xml so that subdirectory is not shown.

3.   Better handling of category with same name across two directories.

To understand problem.

1.  Make a new category (e.g., NewCat) and move or import some templates to this category. 
2. Add a new path for templates  (i.e., Use Tools - Options (Alt-F12) – LibreOffice – Paths – Templates), Edit Template, add a new path and make this new path as default.
3.  Move/import a template (that you do not mind losing) to “NewCat”

(Before proceeding, look in your file system, to confirm that there is a subdirectory “NewCat” in the “Default” directory that you just set in Options and that the just-imported template is in the subdirectory NewCat.  Look also in your default userprofile, where you should see in templates/NewCat, the templates that you imported.)

4.  Use Template Manager to delete category “NewCat”
    Actual result:  
     - An error message is shown that the category cannot be deleted.
     - the NewCat directory (and its contents) in the “default path” directory is deleted.
     - The NewCat directory in the non-default path is not changed.

Expected result:   (should follow the procedures in nr. 2 and nr.3, with offering to move or delete templates – from both directories).

NB .  From user PoV, if you follow steps 1-4, then you would expect that all templates in “NewCat” are deleted or removed.  At present, this operation only works for the “Default Path”  – (which seems like an arbitrary limitation).
Comment 1 Roman Kuznetsov 2021-09-05 19:57:44 UTC
UX-team, we need your PoV here
Comment 2 Heiko Tietze 2021-09-06 08:52:37 UTC
My take is to not delete anything on the file system. Way too dangerous and off-scope'ish. Imagine users change the template path to ~/Documents... 

If we want to keep the command it could just open a file browser at the respective location.
Comment 3 Heiko Tietze 2021-09-09 12:34:11 UTC
No further opinion, let's open the default file browser at the templates location on "delete". And remove the Delete Category dialog and functions.