Bug 138906 - [rfe] Grey-out predefined Categories in Delete Category dialog in Template Manager
Summary: [rfe] Grey-out predefined Categories in Delete Category dialog in Template Ma...
Status: VERIFIED FIXED
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: VertD
URL:
Whiteboard: target:7.3.0
Keywords:
Depends on:
Blocks: Template-Manager
  Show dependency treegraph
 
Reported: 2020-12-14 16:56 UTC by sdc.blanco
Modified: 2021-08-04 01:25 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Mockup (46.92 KB, image/png)
2021-05-04 08:48 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sdc.blanco 2020-12-14 16:56:20 UTC
At present, it is not possible to delete predefined categories in the Template Manager, but it is possible for the user to try. => Deactivate (or don't show) the predefined categories in the Delete dialog.
Comment 1 Heiko Tietze 2020-12-15 10:37:44 UTC
This, and maybe we make it clear in the dialog title per "Delete User Category".
Comment 2 VertD 2021-04-07 15:15:53 UTC
I took the names of the built-in categories from sfx2/inc/doctempl.hrc I'm not sure if it is the right approach, some categories are missing (draw category). Is the list incomplete? https://gerrit.libreoffice.org/c/core/+/113712
Comment 3 Heiko Tietze 2021-04-27 13:24:27 UTC
Works for me, including the "draw" category. But UX-wise it's not really nice to list many things that can't be handled in the dialog. I would expect interaction with the currently active category only and close to the selection. Perhaps similar how we realized the CMIS dialog (File > Open Remote...). The view options could be in the settings (the gear icon) menu. Otherwise you should list only user categories or disable the command if none exists. A hurdle might be when the category is currently active and selected. In this case I get a message "could not delete <foo>".

The same applies also to rename, which is not possible for the inbuilt categories.
Comment 4 VertD 2021-04-30 01:49:52 UTC
I uploaded a new patch. I removed the category selection dialog and hid "Delete User Category" menu item for builtin templates. I didn't grey-out it because of the different behaviors of the VCL plugins. https://bugs.documentfoundation.org/show_bug.cgi?id=138246#c12 Or should I do it anyway? Currently rename item is also hidden in some cases (except for builtin categories).
Comment 5 VertD 2021-04-30 01:51:33 UTC
*builtin categories not templates
Comment 6 Heiko Tietze 2021-05-04 08:48:10 UTC
Created attachment 171627 [details]
Mockup

Sorry for not been precise enough, here is a mockup. The point is that view options (thumb or list) are close to the category where actually the management functions belong. If we exchange the positions we do not need to explain a lot, it's pretty straightforward to what the functions belong.

And whether Delete has a User in the label or not is not so important once it's disabled for inbuilt categories. We may go even further and have the template related functions move/im-export/extension with the refresh feature in the same menu.
Comment 7 Heiko Tietze 2021-05-04 08:52:23 UTC
I would also remove to capability to unset a default template on modules that are not yet shown. In case of All Application the command could be "Reset All Default Templates", for Writer "Reset Default Template for Text Documents" etc. Would be shorter but still readable without "Template".
Comment 8 VertD 2021-05-20 04:36:22 UTC
It seems that set_item_visible(false) does not hide menu items in KF5/QT5 also set_sensitive(false) hides the item in KF5,QT5, Gen plugins and grey-outs in GTK3 plugin. You can see the same behavior in the remote files dialog.
*I uploaded a WIP patch that greys-out items in GTK3 and hides them in KF5, QT5, etc.
* "reset default $APP" only shows the option for the selected Application.
*And the buttons are removed and moved to be all in the same menu. Let me know if I misunderstood something.
Comment 10 Commit Notification 2021-07-05 10:54:38 UTC
Vert D committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/06d063a9de41a24922f15cd3aa47411b61d30c23

tdf#138906 prevent built-in category deletion

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 BogdanB 2021-07-11 13:47:59 UTC
It's ok now. Default templates are gray on Delete option.

Verified in
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: eac5977bfc11797eda356560a5e45c51108ef5a1
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 12 Julien Nabet 2021-08-02 10:54:09 UTC
Could you please fix these:
(soffice:16781): Gtk-CRITICAL **: 12:10:38.204: gtk_widget_show: assertion 'GTK_IS_WIDGET (widget)' failed

(soffice:16781): Gtk-CRITICAL **: 12:10:38.204: gtk_widget_show: assertion 'GTK_IS_WIDGET (widget)' failed

(soffice:16781): Gtk-CRITICAL **: 12:10:38.214: gtk_widget_set_sensitive: assertion 'GTK_IS_WIDGET (widget)' failed
?
With gtk3 rendering, launch Writer then File/Templates/Manage Templates.

It's due to https://gerrit.libreoffice.org/c/core/+/113712.

See comment from Caolán in gerrit.
Also, you can use "export G_DEBUG=fatal_warnings" to debug.
Comment 13 VertD 2021-08-04 01:25:13 UTC
I fixed the warnings in this patch https://gerrit.libreoffice.org/c/core/+/119919