[Solved] Extension featuring Options Dialog

Discussions about using 3rd party extension with OpenOffice.org
Post Reply
Bastien
Posts: 61
Joined: Mon May 12, 2014 2:45 pm

[Solved] Extension featuring Options Dialog

Post by Bastien »

I created an extension that use a conf file outside LibO. I'd like my extension config to be editable and kept in the LibO registry as it seems to be the right way to proceed.

For now, I have added two conf files to the description block in the extension compiler.
- config.xcs
- config.xcu
After compilation they're correctly append to Manifest.xml (which is not bad!).
But how do I build a dialog box to handle these values (for testing purpose, only 2 strings)? And how do I link this dialog box to the config files?
It would be great to have an example of compiler with option ! Examples here https://wiki.openoffice.org/wiki/Extensions_Packager doesn't explain a such feature.
 Edit: I've edited my dialog box using the LibO dialog box editor. The option button is activated now. It's a good point, even if it doesn't show nothing for now. 
Last edited by Bastien on Tue Mar 19, 2019 11:54 am, edited 4 times in total.
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
Posts: 61
Joined: Mon May 12, 2014 2:45 pm

Re: Compile extension using dialog option

Post by Bastien »

I've pushed on a Github public repository a cookiecutter code that creates a starter boilerplate for an OOo extension including options dialog in less than 1 minutes.

https://github.com/bastien34/cookiecutter_ooo_extension

Contributors are welcomed ! I've got a bug for now. Options are only available in Options menubar, not from the extension manager. It's surely easy to fix... And there's in the final extension file some files that shouldn't be there.

So you can create in one command line your extension:

Code: Select all

cookiecutter git@github.com:bastien34/cookiecutter_ooo_extension.git
Again, don't hesitate to try, comment... It's fun!
 Edit: I fixed a bug related to .mo file. Now I can say that it works out of the box, with the default values on my ubuntu. The Options extension is still not activated in the extension manager.
I don't have time to fix it, unfortunately ! 
LibreOffice 6.2.3.2 on Ubuntu 19.04
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: [Solved] Extension featuring Options Dialog

Post by hanya »

Hi,
Id value should be matched to extension identifier defiend in description.xml to show your options dialog in the extension manager.
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
Bastien
Posts: 61
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Post by Bastien »

Id value should be matched to extension identifier defined in description.xml to show your options dialog in the extension manager.
What do you mean by Id value ? If you look at the code, it is defined as {{package_name}} here:

https://github.com/bastien34/cookiecutt ... iption.xml

and it also is defined as {{package_name}} in the xcs config files here:

https://github.com/bastien34/cookiecutt ... config.xcs

But here, no in the xcu :

https://github.com/bastien34/cookiecutt ... dialog.xcu

I confess that I'm a bit confused with all these vars.
LibreOffice 6.2.3.2 on Ubuntu 19.04
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: [Solved] Extension featuring Options Dialog

Post by hanya »

I mean Id node in your node defined under OptionsDialog/Nodes.Leaves. If Id value is the same with the extension identifier of yoru extension package, the extension manager enables option button to show your options 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
Bastien
Posts: 61
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Post by Bastien »

Thank you, just fixed ! It works now and I might say that it takes less than 1 minutes to have a working base !
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
Posts: 61
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Post by Bastien »

New project layout. Now you work on the source and everytime you need to build your extension, just run the executable `oxt_gen.py` and you'll find your fresh extension in `extension/` folder.

README has been adapted in consequence. Again, I insist, every suggestion, any contribution is welcome.

https://github.com/bastien34/cookiecutter_ooo_extension
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
Posts: 61
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Post by Bastien »

New release done! It's far from being finished (see README todo's list) but it works on Linux. Feed back would be nice! GIve it a try here:

https://github.com/bastien34/mastering_ ... _extension
LibreOffice 6.2.3.2 on Ubuntu 19.04
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Extension featuring Options Dialog

Post by JeJe »

Feed back would be nice!
Haven't tried it out - but just to say it sounds a good idea.

Going by the number of extensions published on the extensions site - the number of people writing extensions for OO is close to zero. (so you may not get many responses)
That's a shame because I can think of a whole load of possible extensions that could improve the base suite.

Turning a library into an extension with no settings is just a click... but there's a high bar with adding the other bits. BasicAddonBuilder is great but does take some getting to grips with to begin with.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Bastien
Posts: 61
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Post by Bastien »

Thanks. I have no idea if it works on Windows system. You could give it a try... I'm curious about it.
LibreOffice 6.2.3.2 on Ubuntu 19.04
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Extension featuring Options Dialog

Post by JeJe »

I downloaded it and then the cookiecutter download it looks like it needs and then that looks like its needing Python... all very unfamiliar territory to me as I just write in OOBasic... so sorry I stopped there...

There are some strong advocates of Python in this place... maybe one uses Windows...
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Bastien
Posts: 61
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Post by Bastien »

Thanks...
LibreOffice 6.2.3.2 on Ubuntu 19.04
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Extension featuring Options Dialog

Post by Villeroy »

JeJe wrote:There are some strong advocates of Python in this place... maybe one uses Windows...
I could tell you how to run a Python script on Windows (difficult enough) but I can't tell how to install a github project. You need some github client named "pip". Why should I install that client if github belongs to MS?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Extension featuring Options Dialog

Post by JeJe »

I was just suggesting someone else here might be able to test it who's more into Python.

If you have to download something else as well that's making things even more inaccessible.

The good thing about BasicAddonBuilder is its just an OO document - bit complicated to figure and follow at first, but self-contained and all that's required.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Bastien
Posts: 61
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Post by Bastien »

You need some github client named "pip". Why should I install that client if github belongs to MS?
Brilliant thought inside ! Thanks. It's really helping.
LibreOffice 6.2.3.2 on Ubuntu 19.04
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Extension featuring Options Dialog

Post by Villeroy »

At this point it is getting weird, isn't it?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply