Author: lasgouttes
Date: Fri Jan 29 11:42:39 2010
New Revision: 33258
URL: http://www.lyx.org/trac/changeset/33258

Log:
add a dispatchresult parameter to lyxview::dispatch


How do we proceed now ?

As an example, FUN_FILE_INSERT calls:

 GuiView::insertLyXFile, which emits the messages
    message(_("Absolute filename expected.")) or
    message(_("Canceled."))

This function then call BufferView::insertLyXFile which then calls
   message(_("Inserting document %1$s...")); and
   message(_("Could not insert document %1$s""))

The "Inserting... " message is a temporary one, so that's ok, but the other ones need to be visible still after the dispatch has ended.

How do you propose to handle these messages ? We can't pass the dispatchresult all the way to BufferView::insertLyXFile. If we'd do so, we can add this parameter to almost all functions.

Do you want to return the string. This is ugly and again, almost all functions will then have to return a string and can't return anything else, and we can't call them anymore outside the dispatch mechanism.

The only solution I had, namely calling theLyXFunc().setMessage() has been killed too ?

Last resort, we kill the setting op the status message at the end of LyXFunc::dispatch() if the message is empty. Otherwise, this is leading nowhere.

Vincent

Reply via email to