Hi!
I have been working on an extension and I wanted to add my own menu entry to Calc, while I can do this with addons.xcu file, I can't later find that menu entry with service com.sun.star.ui.ModuleUIConfigurationManagerSupplier. I can mess with every default menu entry (like with say File/New), add my own menu and entries, but I can't find the entry, that was added with addons.xcu.
Anyone knows if it is possible access those entries with some other UNO service? And If it is possible to manipulate them at runtime?
[Solved] Addon - Manipulation of Menu added with addons.xcu
[Solved] Addon - Manipulation of Menu added with addons.xcu
Last edited by JulianR on Fri Oct 11, 2019 4:00 pm, edited 1 time in total.
Apache OpenOffice 4.1.1 / LibreOffice 5.3 / LibreOffice 6.0 / LibreOffice 6.2 on Windows 7
Re: Addon - Manipulation of Menubar added with addons.xcu
Not possible to edit the menu added by addons.xcu at runtime.
I have used to add a menu by addons.xcu with popup menu controller which can be edit while at runtime, see: https://github.com/hanya/BookmarksMenu
I have used to add a menu by addons.xcu with popup menu controller which can be edit while at runtime, see: https://github.com/hanya/BookmarksMenu
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Apache OpenOffice 4-dev on Xubuntu 14.04
Re: Addon - Manipulation of Menubar added with addons.xcu
Thanks.
Apache OpenOffice 4.1.1 / LibreOffice 5.3 / LibreOffice 6.0 / LibreOffice 6.2 on Windows 7
-
- Posts: 145
- Joined: Mon Jun 13, 2016 10:50 am
Re: Addon - Manipulation of Menubar added with addons.xcu
Hi,
A menu added by configuration file is merge in the global configuration registry. Some changes can be made by directly accessing the later.
A simple example in basic, that modifies the item name in the menu bar:[tested on LibreOffice only]
Regards.
A menu added by configuration file is merge in the global configuration registry. Some changes can be made by directly accessing the later.
A simple example in basic, that modifies the item name in the menu bar:
Code: Select all
sub accessCustomMenuItem
globalscope.BasicLibraries.loadLibrary("Tools")
key = "org.openoffice.Office.Addons/AddonUI/OfficeMenuBar/"
menuID = "name.of.custom.menu" '--> adapt here with the real name of the menu as defined in addons.xcu file
keyaccess = getRegistryKeyContent(key + menuID, True)
keyaccess.replaceByName("Title", "NEW NAME")
keyaccess.commitChanges()
keyaccess.dispose()
' Update the current frame if needed.
' You may also need to update other active frames
wait 100 ' this is sometimes needed before update, don't know why
layouter = stardesktop.ActiveFrame.LayoutManager
layouter.getElement("private:resource/menubar/menubar").updateSettings()
end sub
Regards.
AOOo 4.1.2 on Win7 | LibreOffice on various Linux systems
Re: [SOLVED] Addon - Manipulation of Menu added with addons.
Looks promising, but I will need to dig deeper into that keyaccess object.Thanks.
Apache OpenOffice 4.1.1 / LibreOffice 5.3 / LibreOffice 6.0 / LibreOffice 6.2 on Windows 7