Bug 159084 - I can't make custom toolbar permanently locked
Summary: I can't make custom toolbar permanently locked
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
7.4.6.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-09 10:41 UTC by Alex
Modified: 2024-02-29 14:22 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments
Testcase addon project. (673.29 KB, application/vnd.rar)
2024-01-15 08:27 UTC, Alex
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2024-01-09 10:41:49 UTC
Description:
I want have opportunity to make my toolbar from my addon unlockable for user. I suggest to add such property for toolbar in WindowState.xcu file.

Steps to Reproduce:
1. Create addon with custom toolbar 
2. Make toolbar properties Docked and Locked true in .xcu file
3. Open LibreOffice with addon
4. Click right mouse button on custom toolbar and remove tick from "Lock Toolbar Position" oprion.

Actual Results:
We can't make custom toolbar unlockable for user.

Expected Results:
We can make our custom toolbar from addon unlockable for user


Reproducible: Always


User Profile Reset: No

Additional Info:
.
Comment 1 Heiko Tietze 2024-01-10 08:21:45 UTC
(In reply to Alex from comment #0)
> 1. Create addon with custom toolbar 
Please attach a testcase.
Comment 2 Caolán McNamara 2024-01-11 09:52:22 UTC
This was discussed briefly on irc at the time, so I'll dump in some details from there

<AlexFed>       Hello. I have developed my addon. There is toolbar in my addon. I want to make my toolbar fixed (undetachable) without option to make it unfix. How I can do this?
<caolanm>       AlexFed, there is a "Locked" property "A locked user interface element cannot be moved or undocked by the user" that might be the right one to use
<caolanm>       so looking at odk/examples/cpp/complextoolbarcontrols/CalcWindowState.xcu which has "Docked" of false, then if it was "Docked" of true and an additional "Locked" of true that might do what you want
<AlexFed>       Unfortunately this dosn't do that I want. This attach my toolbar, that is true. But user still can make toolbar unlocked in libreoffice and after that user can undock my toolbar     
<AlexFed>       I want make my toolbar locked unconditionally, wihout option for user make it unlocked in libreofice ui. He can do it by press right mouse button and remove tick from "Lock Toolbar Position" option
<AlexFed>       How I can disable this option for user?
<AlexFed>       I have used both this properties already
<caolanm>       Looks like there might be a global config to make them *all* unlockable via Office/Common/Misc/DisableUICustomization but not an individual one. Sometimes a command can be intercepted by an extension but I don't think so in this case. MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION and MENUITEM_TOOLBAR_DOCKALLTOOLBAR in framework/source/uielement/toolbarmanager.cxx don't look look like they or what the call could be intercepted by an extension. You might 
<caolanm>       be out of luck to permanently lock an individual toolbar unless anyone else knows different 
<vmiklos>       you can also write a mail to the dev mailing list and CC Maxim, he knows this & that about framework/ stuff

maybe @maxim knows if there is a way to make a toolbar provided by an extension "truly" unfloatable, otherwise it looks like a missing feature kind of thing
Comment 3 Alex 2024-01-15 08:27:49 UTC
Created attachment 191943 [details]
Testcase addon project.

Addon consists of toolbar with on plain text.
Comment 4 Alex 2024-01-15 08:28:49 UTC
(In reply to Heiko Tietze from comment #1)
> (In reply to Alex from comment #0)
> > 1. Create addon with custom toolbar 
> Please attach a testcase.

I did attachment.
Comment 5 Heiko Tietze 2024-01-15 09:05:17 UTC
Thanks for the example. Essentially you ask for an option to block the configurability completely, diametral to the idea of LibreOffice (maximum flexibility). Maybe you have a good scenario / use case (we could discuss it), and it could be implemented as a hidden feature for C++ extensions only, but I tend to disagree with the idea.

More opinions welcome.
Comment 6 Stéphane Guillou (stragu) 2024-01-20 12:51:39 UTC
Wondering if Gabor and Balázs have an opinion on this, seeing allotropia's recent work for 24.2 on setting locks for system admins (see bug 157698).
Comment 7 Alex 2024-02-29 14:22:26 UTC
I think bug 157698 similar with this bug. Can we invite Gabor to discussion of the bug somehow to confirm that this bug needs to be fixed