Attached please find a much improved InsetListings patch. The
implementation can now be reviewed...

I will explain more about the params issue.

Herbert's patch has a big dialog which handles around 10 commonly used
parameters. I tried but I was not able to port it to qt4, due to my
limited knowledge of qt. Even if I could, I would still need an
editbox because there are dozens more options.

The best GUI option would be something like the property editor of qt
designer, but this is definitely not what I am capable of doing. Due
to the time limit, I use simple QEditBox'es to hold '\n' separated
parameters. If users can specify the right options, they can get
whatever they want.

In InsetListingsParams, params_ holds the parameters in listings
format (something like "language=Python,float"). Several functions are
provided to

1. encode decode this string, if it needs to be saved/restored and
pass a lyx lexer. There is a " in option value problem that I will
discuss below.

2. transform back and forth to \n separated options, used by the dialogs.

Two problems remains:

1. validation: wrong arguments will be passed to latex, If Abdel can
implement a property editor GUI, validation can do done over there.

2. option value with ". I quote params_ with "" in .lyx file, lexer
can save/restore it correctly even if it has characters like &*%$#_ @.
However, " will stop a lexer and I do not know how to handle this
situation. Currently, " in option value is silently removed. Because "
is rarely used (in language definition AFAIK), ignoring " should not
be a stopper of this feature.

Cheers,
Bo

Reply via email to