Help with UI and online help.

Here's the place for discussion related to CAM/CNC and the development of the Path module.
mlampert
Posts: 1379
Joined: Fri Sep 16, 2016 9:28 pm

Help with UI and online help.

Postby mlampert » Sat Aug 12, 2017 10:08 pm

All Qt widgets have a "what's this" field, and as it turns out the field in there ties back as a wiki link into 'the wiki'. The thing is I don't know how this works and I don't know which wiki.

I was wondering if someone could figure out how this works and add the links into the dialogs and create the corresponding wiki pages - at least the basic structure. At this point a single sentence is probably good enough and would help us to track what needs to be fleshed out (like the climb vs. conventional discussion we had, or clarification of the heights ....).

I'll have a change ready in a few days that will reduce the number of dialogs used. As an example all ops using Depths will use the same dialog. The idea is if there is a bug we'll only have to fix it once and all ops benefit from it - and it also means that each "what's this" link only has to be added once.
triplus
Posts: 8791
Joined: Mon Dec 12, 2011 4:45 pm

Re: Help with UI and online help.

Postby triplus » Sat Aug 12, 2017 10:38 pm

I don't know if we use this for dialog purposes ATM. A lot of dialogs in FreeCAD are modal and therefore you can't use FreeCAD What's This command on them directly. ATM help is mostly used for command purposes. But said that i guess there is nothing preventing for the existing system to be used on dialogs (non-modal).

The way this work is rather straightforward:

As a coder you need to use .setWhatsThis("Path_Dialog") on your dialog. And that is basically is. Your dialog will become What's This command aware. When the command is used on it will open a help page with the url set to .../Path_Dialog.html. On the FreeCAD Wiki a page named Path Dialog needs to exist and if it does it will be used when script to create off-line documentation is run. Note that on the Wiki _ is represented as an empty space.
mlampert
Posts: 1379
Joined: Fri Sep 16, 2016 9:28 pm

Re: Help with UI and online help.

Postby mlampert » Sat Aug 12, 2017 11:41 pm

Great, thanks for the explanation - sounds straight forward enough.

My use of the word dialog was a bit misleading/sloppy. Path uses a ToolBox as the main widget in the TaskPanel for all edit views, and what I called "dialog" is actually a single page in that tool box. So going forward we construct the tool box in code and then add standard pages depending on the operations functionality.
triplus
Posts: 8791
Joined: Mon Dec 12, 2011 4:45 pm

Re: Help with UI and online help.

Postby triplus » Sun Aug 13, 2017 12:01 am

mlampert wrote:
Sat Aug 12, 2017 11:41 pm
Great, thanks for the explanation - sounds straight forward enough.
You're welcome.

P.S. I did a quick test and some commands in Path workbench don't have setWhatsThis set (correctly). For example a command named Path_Array.

Wiki documentation:

https://www.freecadweb.org/wiki/Path_Array

Using What's This command on it reveals the url is pointing to .../Creates an array from a selected path.html (it uses a tooltip) but it should point out to .../Path_Array.html.
mlampert
Posts: 1379
Joined: Fri Sep 16, 2016 9:28 pm

Re: Help with UI and online help.

Postby mlampert » Sun Aug 13, 2017 12:09 am

triplus wrote:
Sun Aug 13, 2017 12:01 am
P.S. I did a quick test and some commands in Path workbench don't have setWhatsThis set (correctly). For example a command named Path_Array.
Yes, we' (I) haven't really been paying attention to these. BTW, it was your PR-918 that brought this piece of functionality to our attention ;)
User avatar
sliptonic
Posts: 1577
Joined: Tue Oct 25, 2011 10:46 pm

Re: Help with UI and online help.

Postby sliptonic » Sun Aug 13, 2017 12:17 am

I recently grepped out the path commands. If it helps:
https://github.com/sliptonic/FreeCAD/wiki/Path-Commands
triplus
Posts: 8791
Joined: Mon Dec 12, 2011 4:45 pm

Re: Help with UI and online help.

Postby triplus » Sun Aug 13, 2017 2:10 am

mlampert wrote:
Sun Aug 13, 2017 12:09 am
BTW, it was your PR-918 that brought this piece of functionality to our attention ;)
Yes i had a feeling something like that could be at play here. ;) Anyway i did a quick check and i noticed a lot of Python based commands (basically all) in different workbenches don't seem to work with What's This command. This pull request should add support:

https://github.com/FreeCAD/FreeCAD/pull/925
mlampert
Posts: 1379
Joined: Fri Sep 16, 2016 9:28 pm

Re: Help with UI and online help.

Postby mlampert » Sun Aug 13, 2017 2:16 am

triplus wrote:
Sun Aug 13, 2017 2:10 am
This command. This pull request should add support:

https://github.com/FreeCAD/FreeCAD/pull/925
Sweet! Thanks a lot.
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: Help with UI and online help.

Postby bill » Sun Aug 13, 2017 2:35 pm

mlampert wrote:
Sat Aug 12, 2017 10:08 pm
I'll have a change ready in a few days that will reduce the number of dialogs used. As an example all ops using Depths will use the same dialog. The idea is if there is a bug we'll only have to fix it once and all ops benefit from it - and it also means that each "what's this" link only has to be added once.
Thank You, Thank You, Thank You!

This is the way software was intended to work. Best thing I have heard since reelthndrs Linkage Project. Linkage,embedding, and reuse/reference is what makes the rel-db a megastructure in modern computing; FreeCAD should be doing the same. It is simply good (the best) sw design.

Bravo
triplus
Posts: 8791
Joined: Mon Dec 12, 2011 4:45 pm

Re: Help with UI and online help.

Postby triplus » Mon Aug 14, 2017 7:10 am

mlampert wrote:
Sun Aug 13, 2017 2:16 am
Sweet! Thanks a lot.
You're welcome.

P.S. Just an additional note to clear any potential future confusion when reading the discussion above. You don't have to explicitly provide 'WhatsThis' (in addition to 'Pixmap', 'MenuText' and 'ToolTip'). As the way it works now is command name gets used automatically for 'WhatsThis' purposes if 'WhatsThis' information isn't provided.