]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_cb.C
* lyx_gui: create_view(), start() and exit() functions deleted.
[lyx.git] / src / lyx_cb.C
index 0a54812fc659e22ae395a9be37cce6353de295de..455136b3dfeda597a1ccb7049eb50d26f98a946d 100644 (file)
 #include "paragraph.h"
 
 #include "frontends/Alert.h"
+#include "frontends/Application.h"
 #include "frontends/FileDialog.h"
 #include "frontends/lyx_gui.h"
 
 #include "support/filefilterlist.h"
 #include "support/filetools.h"
+#include "support/fontutils.h"
 #include "support/forkedcall.h"
 #include "support/fs_extras.h"
 #include "support/lyxlib.h"
@@ -88,7 +90,6 @@ using std::ios;
 using std::istream_iterator;
 
 
-extern BufferList bufferlist;
 // this should be static, but I need it in buffer.C
 bool quitting; // flag, that we are quitting the program
 
@@ -192,7 +193,7 @@ void quitLyX(bool noask)
        lyxerr[Debug::INFO] << "Running QuitLyX." << endl;
 
        if (lyx_gui::use_gui) {
-               if (!noask && !bufferlist.quitWriteAll())
+               if (!noask && !theApp->bufferList().quitWriteAll())
                        return;
 
                LyX::cref().session().writeFile();
@@ -203,7 +204,7 @@ void quitLyX(bool noask)
        quitting = true;
 
        // close buffers first
-       bufferlist.closeAll();
+       theApp->bufferList().closeAll();
 
        // do any other cleanup procedures now
        lyxerr[Debug::INFO] << "Deleting tmp dir " << package().temp_dir() << endl;
@@ -215,7 +216,9 @@ void quitLyX(bool noask)
                Alert::warning(_("Unable to remove temporary directory"), msg);
        }
 
-       lyx_gui::exit(0);
+       theApp->exit(0);
+       // Restore original font resources after Application is destroyed.
+       lyx::support::restoreFontResources();
 }