On 10/28/2010 06:31 PM, Richard Heck wrote:
On 10/28/2010 12:04 PM, Richard Heck wrote:

The changeover to InsetParamsWidget has borked the label dialog in ways I cannot seem to understand. Try this: Create a new section heading, and give it the title "Hello". Now Insert>Label. You ought to get a dialog with "sec:Hello", but you get an empty dialog.

Worse problem: If you had something in the dialog previously, you get it back again. I.e., LyX invites you to create a duplicate label.

The source of this is that InsetParamsDialog::initializeParams() ignores its argument and restores the previous state of the dialog. I don't see how this could be over-ridden.

OK, I think I've fixed this at r35886, but please check.

Yes thanks, that's what I wanted to do. But it can be generalized into InsetParamsWidget, no need to implement it in each class:

bool InsetParamsWidget::initialiseParams(std::string const&  data)
{
        InsetCommandParams p(insetCode());
        if (!InsetCommand::string2params(insetName(), data, p))
                return false;
        paramsToDialog(params);
        return true;
}

The insetName() bit could go once Vincent has committed his change about 
string2params().

Of course this also means that a new virtual method needs to be created:

InsetParamsWidget::paramsToDialog(InsetCommandParams const&)

I resisted doing this because I thought not all InsetParamsWidget based class 
would use InsetCommandParams.

Abdel.


Reply via email to