Martin Vermeer wrote:
> As I value your friendship, advise me :-/

See Lars' comments.

Lars Gullik Bjønnes wrote:
> |  dispatch_result InsetFloatList::localDispatch(FuncRequest const &
> |  cmd)
> |  {
> |  switch (cmd.action) {
> | -           case LFUN_INSET_EDIT:
> | -                   InsetCommandMailer("toc", *this).showDialog(cmd.view());
> | +           case LFUN_MOUSE_RELEASE:
> | +                   if (buttonBox().contained(cmd.x, cmd.y))
> | +                           InsetCommandMailer("toc",
> |  *this).showDialog(cmd.view());
> 
> I am not sure I agree with these changes... how can I know do stuff
> from lyxserver or from cmdline?

You would invoke a new LFUN_INSET_SHOW_DIALOG. The code above should 
be:

 switch (cmd.action) {
-               case LFUN_INSET_EDIT:
-                       InsetCommandMailer("toc", *this).showDialog(cmd.view());
+               case LFUN_INSET_SHOW_DIALOG:
+               case LFUN_MOUSE_RELEASE:
+                       if (buttonBox().contained(cmd.x, cmd.y))
+                               InsetCommandMailer("toc",
                                                   *this).showDialog(cmd.view());

Ie, it's up to the inset to decide what to do on receipt of an LFUN. 
In this particular case, clicking on the button will have the same 
effect as an outside request that the dialog be opened.

I think that Martin should now add the LFUN.


-- 
Angus

Reply via email to