Ouch... this is a big, non obvious, patch Bo... I am not sure we will
find the time to properly review it and add the missing bits before
1.5.0 :-(

InsetListings ~= InsetERT so you do not have to pay much attention to
it, other than the InsetListingsParams part.

Many other small changes are startard methods to add dialog, add
require('listings') and add the inset itself. They can be ignored as
well.

I'll try to have a look this week-end. But do we really need this dialog
now?

What I need from you is the qt4/QListings.* and qt4/ui/ListingUi.ui
part. You can get the parameters and put them to the listWidget, when
one of the items is clicked, its value goes to the editbox and when
the focus leaves the editbox, its value should be saved in the
listwidget. Then, the parameters are returned to the inset. If you are
not sure how parameters are passed, I am not sure either, but I copied
the code from QWrap. :-) InsetWrap has something like InsetWrapParams
as well.

If you can find a clever way to put this dialog to insert -> include
(as the fourth file type), then we can easily have \lstinputlisting.
If you can put it also to file -> settings, then we can have proper
\lstset in the preamble.

It sounds like you are doing most of the work, but I am really not
familiar with qt4 to do them. Maybe Peter can also help?

Regarding file format changes, there will be

1. InsetListings...

\begin_inset Listings
language Python
xleftmargin 10pt
status open

\begin_layout Standard
program
\end_layout
\end_inset

There will be MANY listings options. (see later)

2. inputlisting

\begin_inset Include \lstinputlisting{file.py}
language Python
startnumber 10
\end_inset

3. preamble changes if we add a listings panel in document settings dialog.

\language Python
\....

Due to the large number of options, I propose that we combine all of
them to something like:

\lstparams language=Python,float,whatever=value

in InsetListings, include and preamble. In this way, all the
adjustments of  parameters can be done without breaking lyx format.

Cheers,
Bo

Reply via email to