]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt3/lyx_gui.C
clean up Abdel's cleanup
[lyx.git] / src / frontends / qt3 / lyx_gui.C
index 64c9b6b0c4497f4cb11fdceb669f4ab3f90ef682..4a95a40739bb25992cfee732af56c37e030203af 100644 (file)
@@ -39,6 +39,7 @@
 #include <boost/signal.hpp> // FIXME: Is this needed? (Lgb)
 #include <boost/bind.hpp>
 #include <boost/shared_ptr.hpp>
+#include "frontends/WorkArea.h"
 
 #include "GuiImplementation.h"
 #include "QtView.h"
@@ -233,8 +234,8 @@ void parse_lyxrc()
 {}
 
 
-int start(string const & batch, vector<string> const & files,
-          unsigned int width, unsigned int height, int posx, int posy, bool maximize)
+LyXView* create_view(unsigned int width, unsigned int height, int posx, int posy,
+             bool maximize)
 {
        // this can't be done before because it needs the Languages object
        initEncodings();
@@ -258,18 +259,21 @@ int start(string const & batch, vector<string> const & files,
        } else
                view.show();
 
+       return &view;
+}
+
+
+int start(LyXView * view, string const & batch)
+{
        // FIXME: some code below needs moving
 
-       lyxserver = new LyXServer(&view.getLyXFunc(), lyxrc.lyxpipes);
-       lyxsocket = new LyXServerSocket(&view.getLyXFunc(),
+       lyxserver = new LyXServer(&view->getLyXFunc(), lyxrc.lyxpipes);
+       lyxsocket = new LyXServerSocket(&view->getLyXFunc(),
                          os::internal_path(package().temp_dir() + "/lyxsocket"));
 
-       for_each(files.begin(), files.end(),
-                bind(&BufferView::loadLyXFile, view.view(), _1, true));
-
        // handle the batch commands the user asked for
        if (!batch.empty()) {
-               view.getLyXFunc().dispatch(lyxaction.lookupFunc(batch));
+               view->getLyXFunc().dispatch(lyxaction.lookupFunc(batch));
        }
 
        int const status = qApp->exec();
@@ -303,10 +307,6 @@ FuncStatus getStatus(FuncRequest const & ev)
 {
        FuncStatus flag;
        switch (ev.action) {
-       case LFUN_DIALOG_SHOW:
-               if (ev.argument == "preamble")
-                       flag.unknown(true);
-               break;
        case LFUN_TOOLTIPS_TOGGLE:
                flag.unknown(true);
                break;