[Solved] Extension featuring Options Dialog

Discussions about using 3rd party extension with OpenOffice.org

[Solved] Extension featuring Options Dialog

Postby Bastien » Fri Mar 08, 2019 5:40 pm

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: 48
Joined: Mon May 12, 2014 2:45 pm

Re: Compile extension using dialog option

Postby Bastien » Mon Mar 18, 2019 6:36 pm

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 ! 
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
 
Posts: 48
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Postby hanya » Tue Mar 19, 2019 6:12 pm

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
hanya
Volunteer
 
Posts: 884
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: [Solved] Extension featuring Options Dialog

Postby Bastien » Tue Mar 19, 2019 6:30 pm

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.
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
 
Posts: 48
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Postby hanya » Tue Mar 19, 2019 7:06 pm

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
hanya
Volunteer
 
Posts: 884
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: [Solved] Extension featuring Options Dialog

Postby Bastien » Tue Mar 19, 2019 7:13 pm

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: 48
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Postby Bastien » Thu Mar 21, 2019 12:18 pm

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: 48
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Postby Bastien » Tue Apr 02, 2019 10:05 pm

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
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
 
Posts: 48
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Postby JeJe » Wed Apr 03, 2019 10:48 am

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.
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 573
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Extension featuring Options Dialog

Postby Bastien » Wed Apr 03, 2019 2:50 pm

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
Bastien
 
Posts: 48
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Postby JeJe » Wed Apr 03, 2019 3:56 pm

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...
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 573
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Extension featuring Options Dialog

Postby Bastien » Wed Apr 03, 2019 6:39 pm

Thanks...
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
 
Posts: 48
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Postby Villeroy » Wed Apr 03, 2019 10:28 pm

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, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27094
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Extension featuring Options Dialog

Postby JeJe » Wed Apr 03, 2019 11:06 pm

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.
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 573
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Extension featuring Options Dialog

Postby Bastien » Thu Apr 04, 2019 12:42 pm

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
Bastien
 
Posts: 48
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved] Extension featuring Options Dialog

Postby Villeroy » Thu Apr 04, 2019 1:27 pm

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, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27094
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to Extensions

Who is online

Users browsing this forum: No registered users and 1 guest