Page 1 of 1

[Solved] Extension featuring Options Dialog

PostPosted: Fri Mar 08, 2019 5:40 pm
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. 

Re: Compile extension using dialog option

PostPosted: Mon Mar 18, 2019 6:36 pm
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   Expand viewCollapse view
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 ! 

Re: [Solved] Extension featuring Options Dialog

PostPosted: Tue Mar 19, 2019 6:12 pm
by hanya
Hi,
Id value should be matched to extension identifier defiend in description.xml to show your options dialog in the extension manager.

Re: [Solved] Extension featuring Options Dialog

PostPosted: Tue Mar 19, 2019 6:30 pm
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/cookiecutter_ooo_extension/blob/master/%7B%7Bcookiecutter.extension_name%7D%7D/description.xml

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

https://github.com/bastien34/cookiecutter_ooo_extension/blob/master/%7B%7Bcookiecutter.extension_name%7D%7D/config/%7B%7Bcookiecutter.extension_name%7D%7D_config.xcs

But here, no in the xcu :

https://github.com/bastien34/cookiecutter_ooo_extension/blob/master/%7B%7Bcookiecutter.extension_name%7D%7D/config/%7B%7Bcookiecutter.extension_name%7D%7D_dialog.xcu

I confess that I'm a bit confused with all these vars.

Re: [Solved] Extension featuring Options Dialog

PostPosted: Tue Mar 19, 2019 7:06 pm
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.

Re: [Solved] Extension featuring Options Dialog

PostPosted: Tue Mar 19, 2019 7:13 pm
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 !

Re: [Solved] Extension featuring Options Dialog

PostPosted: Thu Mar 21, 2019 12:18 pm
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

Re: [Solved] Extension featuring Options Dialog

PostPosted: Tue Apr 02, 2019 10:05 pm
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_cookiecutter_OOo_extension

Re: [Solved] Extension featuring Options Dialog

PostPosted: Wed Apr 03, 2019 10:48 am
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.

Re: [Solved] Extension featuring Options Dialog

PostPosted: Wed Apr 03, 2019 2:50 pm
by Bastien
Thanks. I have no idea if it works on Windows system. You could give it a try... I'm curious about it.

Re: [Solved] Extension featuring Options Dialog

PostPosted: Wed Apr 03, 2019 3:56 pm
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...

Re: [Solved] Extension featuring Options Dialog

PostPosted: Wed Apr 03, 2019 6:39 pm
by Bastien
Thanks...

Re: [Solved] Extension featuring Options Dialog

PostPosted: Wed Apr 03, 2019 10:28 pm
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?

Re: [Solved] Extension featuring Options Dialog

PostPosted: Wed Apr 03, 2019 11:06 pm
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.

Re: [Solved] Extension featuring Options Dialog

PostPosted: Thu Apr 04, 2019 12:42 pm
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.

Re: [Solved] Extension featuring Options Dialog

PostPosted: Thu Apr 04, 2019 1:27 pm
by Villeroy
At this point it is getting weird, isn't it?