Dispatch to the options dialog

Discussions about using 3rd party extension with OpenOffice.org
Post Reply
socky
Posts: 2
Joined: Thu Feb 23, 2012 5:32 pm

Dispatch to the options dialog

Post by socky »

Hello,
I'm trying to find a way to dispatch to the options dialog (Tools -> Options...) from a toolbar button, in the same way the Extension manager does it. Means only showing the config Nodes / leafs of a specific extension.
At first I thought it could be a property of the "OptionsTreeDialog" command, but no luck. No idea which properties (if any) are accepted by this command.

Maybe someone knows how the Extension Manager does it...?

Thanks for any help
OpenOffice 3.1 on Arch Linux
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Dispatch to the options dialog

Post by hanya »

Hi, Welcome to this forum.

SfxAbstractDialogFactory#CreateOptionsDialog method which is used in the extension manager is not exported as API.
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
socky
Posts: 2
Joined: Thu Feb 23, 2012 5:32 pm

Re: Dispatch to the options dialog

Post by socky »

Hello,
Thank you, I noticed the same after going through the sources...

I guess, I will then create a customized options dialog containing my option pages.
OpenOffice 3.1 on Arch Linux
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Dispatch to the options dialog

Post by hanya »

So, css.awt.ContainerWindowProvider service can be used to make a window from your existing options page to embed your own option dialog.
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
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Dispatch to the options dialog

Post by hanya »

Here is a way to use OptionsTreeDialog call with OptionsPageURL argument, this call opens specified page as last opened page:

Code: Select all

sub OpenExtensionsOptionPage
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
arg = CreateUnoStruct("com.sun.star.beans.PropertyValue")
arg.Name = "OptionsPageURL"
arg.Value = "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages/svazblta.tmp_/BookmarksMenu-1.0.0.oxt/dialogs/Options.xdl"
dispatcher.executeDispatch(_
  ThisComponent.CurrentController.Frame, _
  ".uno:OptionsTreeDialog", "", 0, Array(arg))
end sub
The OptionsPageURL can be get from its configuration as shown above.
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
prof_milki
Posts: 2
Joined: Thu May 20, 2021 10:23 am

Re: Dispatch to the options dialog

Post by prof_milki »

Wasted quite a bit of time with this approach.
But the link shortcut as documented in [Solved] Opening OptionsDialog UI from the menu does actually work.

The magic ingredient turned out to be the :string suffix for the OptionsPageURL parameter:

Code: Select all

<prop oor:name="URL" oor:type="xs:string"><value>.uno:OptionsTreeDialog?OptionsPageURL:string=%origin%/OptionsDialog.xdl</value></prop>
                                                                                      ↑↑↑↑↑↑↑
AOO 4.1.7 / LO 7.1.0.3 on Ubuntu 20.04 // Working on PageTranslate
Post Reply