Page 1 of 8

XBoard interactive help

Posted: Thu Mar 10, 2016 12:40 pm
by hgm
I am experimenting with a new feature in XBoard, and would like to have some feedback from users to see if it is useful. The idea is to make XBoard's manual file more accessible. Almost noone takes the trouble to read manual files, and, quite frankly, XBoard as grown so extensive, and consequently its man page so long, that I cannot really blame them.

So the idea is to make right-clicking on the names of controls in menu dialogs, or on the menu items themselves, provide direct access to the relevant paragraph in the manual, displaying the text in a popup window. In the experimental implementation I just have it scan the manual file for a header line containing the same text as written next to the dialog control, and as the item headers in the manual usually equal the name of the control or menu item this already works for the majority of cases.

If we decide to go on with this it would just be a matter of re-writing the manual (organizing it more systematically) so that it works in all cases. A nice enhancement could be to apply the lookup of controls clicked in the Engine Settings dialogs in the manual page of the corresponding engine, rather than in XBoard's own manual page.

The XBoard version that does this can be found in the 'help' branch of my on-line source repository:

http://hgm.nubati.net/cgi-bin/gitweb.cg ... heads/help

Only the GTK build (which should be the default build in this version) does this.

Re: XBoard interactive help

Posted: Fri Mar 11, 2016 1:35 am
by styx
12 hours ago H.G.Muller Suppress echo of password in ICS Chat window (GTK)
Is this the right commit? I'm not sure what to download and where to klick. Is the "snapshot" the right link?

If so, it's not working right for me. I downloaded it, compiled it and I cannot right-click in the menu for any help.

Re: XBoard interactive help

Posted: Fri Mar 11, 2016 7:37 am
by hgm
That is the right commit, and clicking 'snapshot' should indeed give you the tar ball. Right clicking should work on items in the menus, after you open those menus. And on the texts in menu dialogs that open after you clicked those menu items. Not on the menu names in the menu bar itself.

Re: XBoard interactive help

Posted: Fri Mar 11, 2016 12:20 pm
by styx
I did that: nothing happens after right clicking.

But I have to mention that I did not installed it. I just compiled it and started it out of the directory. There were other errors like "no pieces were showing". I had to manually set the SVG directory to display them.

Re: XBoard interactive help

Posted: Fri Mar 11, 2016 1:09 pm
by hgm
Ah, that could explain it! I programmed it such that when it cannot open the manual file (which it expects at /usr/local/share/man/man6/xboard.6 ), it does nothing at all. And if you never installed an XBoard from source before, there wouldn't be anything there. (Installing from the distro repositories would place the file at /usr/share/man/man6/xboard.6 .)

Re: XBoard interactive help

Posted: Fri Mar 11, 2016 1:54 pm
by JoshPettus
I'm afraid it didn't work for me either :(

just a quick look at the code but I think it should be in dialog.c

Code: Select all

char *manFile = DATADIR "/../man/man6/xboard.6
not

Code: Select all

char *manFile = DATADIR "/../../man/man6/xboard.6
Based on where the DATADIR is located in the osx app. (I didn't think we made any changes to DATADIR for the app and based the internal structure on the linux install to simplify the build script.)


On the other hand, the ICS password worked great on GTK! (haven't tried XAW yet). Really minor thing is it still stores your password keystrokes in the history, so if you hit up arrow, it will be displayed.

Re: XBoard interactive help

Posted: Fri Mar 11, 2016 2:18 pm
by hgm
JoshPettus wrote:I'm afraid it didn't work for me either :(

just a quick look at the code but I think it should be in dialog.c

Code: Select all

char *manFile = DATADIR "/../man/man6/xboard.6
not

Code: Select all

char *manFile = DATADIR "/../../man/man6/xboard.6
Based on where the DATADIR is located in the osx app. (I didn't think we made any changes to DATADIR for the app and based it on the linux install to simplify the build script.)
DATADIR for me (installing from source) is /usr/local/share/games/xboard. So I have to use twice ".." to undo the xboard and the games, to be left with /usr/local/share, on which it then builds the /usr/local/share/man/man6/xboard.6 .

I agree that this was just an ugly hack, and that a proper solution would be to make $(mandir) available to XBoard during compiling as a preprocessor macro.

On the other hand, the ICS password worked great on GTK! (haven't tried XAW yet). Really minor thing is it still stores your password keystrokes in the history, so if you hit up arrow, it will be displayed.
Oops! I guess I should have EchoOn() also clear the last line from the command history.

Re: XBoard interactive help

Posted: Fri Mar 11, 2016 2:28 pm
by JoshPettus
Ah, I guess I did change it somehow. I dropped the games folder. (not sure why now..) I guess I worked around it and didn't bite me until now..

Re: XBoard interactive help

Posted: Fri Mar 11, 2016 2:40 pm
by hgm
Well, I suppose we will have to find a ./configure solution for this. I think ./configure does set a 'mandir' variable; it would just be a matter of passing it to the compiler as -DMANDIR=$(mandir), and then using it in the source code.

What bites me is that Fairy-Max installs itself with a gzipped man file (fairymax.6.gz). Apparently the man command also understands that, but XBoard would have to unzip it first if it wants to consult it. So I guess I will switch to installing the manual as plain text.

It would be really nice if this help function would also work on the Engine Settings dialogs, by consulting the man files of the currently loaded engines.

I pushed a commit to fix the password recall, BTW.

Re: XBoard interactive help

Posted: Fri Mar 11, 2016 2:44 pm
by JoshPettus
Why gziped? Is the man file really that large?