#include "Language.h"
#include "Session.h"
#include "Color.h"
-#include "callback.h"
#include "LyXAction.h"
#include "LyXFunc.h"
#include "Lexer.h"
*/
bool use_gui = true;
+bool quitting; // flag, that we are quitting the program
namespace {
// 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) {
// aknowledged.
restoreGuiSession();
+ // if reconfiguration is needed.
+ if (textclasslist.empty()) {
+ switch (Alert::prompt(
+ _("No textclass is found"),
+ _("LyX cannot continue because no textclass is found. "
+ "You can either reconfigure normally, or reconfigure using "
+ "default textclasses, or quit LyX."),
+ 0, 2,
+ _("&Reconfigure"),
+ _("&Use Default"),
+ _("&Exit LyX")))
+ {
+ case 0:
+ // regular reconfigure
+ pimpl_->lyxfunc_.dispatch(FuncRequest(LFUN_RECONFIGURE, ""));
+ break;
+ case 1:
+ // reconfigure --without-latex-config
+ pimpl_->lyxfunc_.dispatch(FuncRequest(LFUN_RECONFIGURE,
+ " --without-latex-config"));
+ break;
+ }
+ pimpl_->lyxfunc_.dispatch(FuncRequest(LFUN_LYX_QUIT));
+ return;
+ }
+
// Execute batch commands if available
if (batch_command.empty())
return;
{
LyXView * view = newLyXView();
+ // if there is no valid class list, do not load any file.
+ if (textclasslist.empty())
+ return;
+
// if some files were specified at command-line we assume that the
// user wants to edit *these* files and not to restore the session.
if (!pimpl_->files_to_load_.empty()) {