X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyX.cpp;h=922cffba22e6f9272e4f7727981d1c9d6df0bb3a;hb=2417d9d911dbca181c48f45d1aad26d31c9aa815;hp=a778d4cb819529a293fc051db037c6e6847becb2;hpb=8a947f63da25582224d20b29fadba6128f271555;p=lyx.git diff --git a/src/LyX.cpp b/src/LyX.cpp index a778d4cb81..922cffba22 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -22,6 +22,7 @@ #include "buffer_funcs.h" #include "BufferList.h" #include "Converter.h" +#include "CutAndPaste.h" #include "debug.h" #include "Encoding.h" #include "ErrorList.h" @@ -365,7 +366,7 @@ void LyX::setGuiLanguage(std::string const & language) } -Buffer const * const LyX::updateInset(Inset const * inset) const +Buffer const * LyX::updateInset(Inset const * inset) const { if (quitting || !inset) return 0; @@ -450,9 +451,6 @@ int LyX::exec(int & argc, char * argv[]) return !final_success; } - // Force adding of font path _before_ Application is initialized - support::os::addFontResources(); - // Let the frontend parse and remove all arguments that it knows pimpl_->application_.reset(createApplication(argc, argv)); @@ -487,15 +485,16 @@ int LyX::exec(int & argc, char * argv[]) prepareExit(); - // Restore original font resources after Application is destroyed. - support::os::restoreFontResources(); - return exit_status; } void LyX::prepareExit() { + // Clear the clipboard and selection stack: + cap::clearCutStack(); + cap::clearSelection(); + // Set a flag that we do quitting from the program, // so no refreshes are necessary. quitting = true; @@ -616,6 +615,32 @@ void LyX::execBatchCommands() // 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; @@ -631,6 +656,10 @@ void LyX::restoreGuiSession() { 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()) {