]> git.lyx.org Git - lyx.git/blobdiff - src/LyX.cpp
Fix bug #12772
[lyx.git] / src / LyX.cpp
index fc2f87110176850254fcc9e6791e051d39821cfd..04c1dd4f257e49e962cba22f24452b0f94dd96da 100644 (file)
@@ -581,10 +581,11 @@ void LyX::execCommands()
 {
        // The advantage of doing this here is that the event loop
        // is already started. So any need for interaction will be
-       // aknowledged.
+       // acknowledged.
 
        // if reconfiguration is needed.
-       if (LayoutFileList::get().empty()) {
+       const bool noLayouts = LayoutFileList::get().empty();
+       if (noLayouts && os::hasPython()) {
                switch (Alert::prompt(
                        _("No textclass is found"),
                        _("LyX will only have minimal functionality because no textclasses "
@@ -593,7 +594,8 @@ void LyX::execCommands()
                        0, 2,
                        _("&Reconfigure"),
                        _("&Without LaTeX"),
-                       _("&Continue")))
+                       _("&Continue"),
+                       _("&Exit LyX")))
                {
                case 0:
                        // regular reconfigure
@@ -604,6 +606,25 @@ void LyX::execCommands()
                        lyx::dispatch(FuncRequest(LFUN_RECONFIGURE,
                                " --without-latex-config"));
                        break;
+               case 3:
+                       lyx::dispatch(FuncRequest(LFUN_LYX_QUIT, ""));
+                       return;
+               default:
+                       break;
+               }
+       } else if (noLayouts) {
+               switch (Alert::prompt(
+                       _("No python is found"),
+                       _("LyX will only have minimal functionality because no python interpreter "
+                         "has been found. Consider installing python with your software manager "
+                         "or from the python.org website."),
+                       0, 1,
+                       _("&Continue"),
+                       _("&Exit LyX")))
+               {
+               case 1:
+                       lyx::dispatch(FuncRequest(LFUN_LYX_QUIT, ""));
+                       return;
                default:
                        break;
                }
@@ -1103,7 +1124,7 @@ bool LyX::queryUserLyXDir(bool explicit_userdir)
 
        if (!sup.createDirectory(0755)) {
                // Failed, so let's exit.
-               lyxerr << to_utf8(_("Failed to create directory. Perhaps wrong -userdir option?\nExiting."))
+               lyxerr << to_utf8(_("Failed to create directory. Perhaps wrong -userdir command-line option?\nExiting."))
                       << endl;
                earlyExit(EXIT_FAILURE);
        }