Georg Baum wrote:
Abdelrazak Younes wrote:

Georg Baum wrote:
Abdelrazak Younes wrote:

OK, the problem is that BufferList was created in Application which is
created only in GUI mode. I wanted to create a "console mode" frontend
to cope with this and with all the lyx::use_gui test but I don't have
the time right now.
While such a frontend would be nice e.g. for batch processing on a
machine that does not have an X server it will not be possible to remove
the lyx::use_gui test, at least not if the GUI version should still be
able to process batch commands.
Why is that?

Because even a qt4 frontend can be run in text-only mode. In that case no
popups should appear, no GUI fonts should be loaded etc.

This is where we disagree then. In text only mode, the qt4 frontend should not be loaded at all.


The batch command processing is done in LyXFunc and it does not need
this use_gui boolean.

There surely is a misunderstanding here. My goal is to remove the use of
lyx::use_gui inside the (qt4) frontend where it is just not needed
because we are obviously using a GUI.

If you could manage to not enter the qt event loop at all if only batch
processing is requested that would be even better. That would mean that we
don't need a separate frontend (== separate executable) for batch
processing.

Exactly. Note that this is already the case, extract from lyx_main.C:

int LyX::priv_exec(int & argc, char * argv[])
{
        // we need to parse for "-dbg" and "-help"
        lyx_gui::use_gui = easyParse(argc, argv);

        [...]

        // Start the real execution loop.
        if (lyx_gui::use_gui) {
                // Force adding of font path _before_ Application is initialized
                lyx::support::addFontResources();
                return lyx_gui::exec(argc, argv);
        }
        else
                return exec2(argc, argv);
}

this means that if use_gui is not set, the GuiApplication instance is not even created.

But it looks to me that there is still a misunderstanding concerning the
fact that even a gui frontend need to behave like a text frontend if only
batch processing is requested.

See above.


But I maybe see the need for an "Application::useGui()" that will return
true for GuiApplication and false for some future ConsoleApplication.

That would not help IMO, since also a GuiApplication could be run in
GUI-less mode.

Nope...

Abdel.

Reply via email to