]> git.lyx.org Git - lyx.git/blobdiff - src/LyX.cpp
adjust
[lyx.git] / src / LyX.cpp
index fa03e2550c049628cab48cd4181b6ceafcbace9a..81acf9f6cf3f5ae5423d3a3c59898fa27f58aaa6 100644 (file)
@@ -32,7 +32,6 @@
 #include "Language.h"
 #include "Session.h"
 #include "Color.h"
-#include "callback.h"
 #include "LyXAction.h"
 #include "LyXFunc.h"
 #include "Lexer.h"
@@ -118,6 +117,7 @@ namespace os = support::os;
 */
 bool use_gui = true;
 
+bool quitting; // flag, that we are quitting the program
 
 namespace {
 
@@ -405,7 +405,8 @@ int LyX::exec(int & argc, char * argv[])
        // we need to parse for "-dbg" and "-help"
        easyParse(argc, argv);
 
-       try { support::init_package(to_utf8(from_local8bit(argv[0])),
+       try {
+               support::init_package(to_utf8(from_local8bit(argv[0])),
                              cl_system_support, cl_user_support,
                              support::top_build_dir_is_one_level_up);
        } catch (support::ExceptionMessage const & message) {
@@ -619,9 +620,9 @@ void LyX::execBatchCommands()
        if (textclasslist.empty()) {
            switch (Alert::prompt(
                    _("No textclass is found"),
-                   _("LyX can not continue because no textclass is found. "
+                   _("LyX cannot continue because no textclass is found. "
                      "You can either reconfigure normally, or reconfigure using "
-                     "default text classes, or quit lyx."),
+                     "default textclasses, or quit LyX."),
                    0, 2,
                    _("&Reconfigure"),
                    _("&Use Default"),
@@ -958,21 +959,23 @@ bool LyX::init()
        //...and the modules
        moduleList.load();
 
-       if (use_gui) {
-               // Set the language defined by the user.
-               //setGuiLanguage(lyxrc.gui_language);
+       // read keymap and ui files in batch mode as well
+       // because InsetInfo needs to know these to produce
+       // the correct output
 
-               // Set up bindings
-               pimpl_->toplevel_keymap_.reset(new KeyMap);
-               defaultKeyBindings(pimpl_->toplevel_keymap_.get());
-               pimpl_->toplevel_keymap_->read(lyxrc.bind_file);
+       // Set the language defined by the user.
+       //setGuiLanguage(lyxrc.gui_language);
 
-               pimpl_->lyxfunc_.initKeySequences(pimpl_->toplevel_keymap_.get());
+       // Set up bindings
+       pimpl_->toplevel_keymap_.reset(new KeyMap);
+       defaultKeyBindings(pimpl_->toplevel_keymap_.get());
+       pimpl_->toplevel_keymap_->read(lyxrc.bind_file);
 
-               // Read menus
-               if (!readUIFile(lyxrc.ui_file))
-                       return false;
-       }
+       pimpl_->lyxfunc_.initKeySequences(pimpl_->toplevel_keymap_.get());
+
+       // Read menus
+       if (!readUIFile(lyxrc.ui_file))
+               return false;
 
        if (lyxerr.debugging(Debug::LYXRC))
                lyxrc.print();
@@ -1561,7 +1564,6 @@ ServerSocket & theServerSocket()
 
 KeyMap & theTopLevelKeymap()
 {
-       BOOST_ASSERT(use_gui);
        return LyX::ref().topLevelKeymap();
 }