On 02/26/2010 12:13 PM, Steve Litt wrote:
Hi all,

I'm sure it won't come to this, but if nobody else does the outline mode
improvement I'll have to do it.

We'd welcome it. It may not be that bad, and we can help you clean up the code.

Could someone please tell me the source files encompassing the current outline
functionality, as well as the source files implementing an input box with
buttons and a text box? Basically the change involves the addition of a couple
buttons and a text box.

The outliner is in GuiToc.{h,cpp} and TocWidget.{h,cpp}, both in src/frontends/qt4/. You probably need to deal with TocWidget more.

The easiest way to add the buttons is to load src/frontends/ui/TocUi.ui into QtDesigner and put them in. Note that, if you're going to have them add sections, they should only be active when we're in that mode. To get them to do what you want, see such routines as on_MoveDownTB_clicked(). You'll presumably need to do a series of things: Create a new paragraph (you are already in one); type out the section stuff; break the paragraph again (since you may have been in the middle of a paragraph); then set the layout.

The text box could just be a QInputDialog, such as is used in the askForText routine in GuiAlert. Or maybe you could just call askForText. But you may want to allow the user to choose what kind of section to create, and that would be more complex. You could also just create what "makes sense" at that point and then the user can change it if it isn't right.

rh

PS Obviously, future questions should go to devel.

Reply via email to