commit 2af8e661a3a7652f31bbef4890a4b9290bf0febd
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Mon Dec 28 09:58:30 2020 +0100

    Re-enable input of non-LyX files (e.g., tex, pgf) (#12056)
    
    This amends [a385b7dc2b58/lyxgit]
---
 src/frontends/qt/GuiInclude.cpp |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/frontends/qt/GuiInclude.cpp b/src/frontends/qt/GuiInclude.cpp
index ad95b9f..3d4f3dd 100644
--- a/src/frontends/qt/GuiInclude.cpp
+++ b/src/frontends/qt/GuiInclude.cpp
@@ -318,14 +318,17 @@ bool GuiInclude::isValid()
                okbutton->setText(qt_("&OK"));
                return true;
        }
+
+       string const bpath = buffer().filePath();
+       // Path might be relative to current Buffer, so make absolute
+       FileName const absfname = support::makeAbsPath(fromqstr(fname), bpath);
+
        // Do we have a LyX filename?
        if (!isLyXFileName(fromqstr(fname))) {
                okbutton->setText(qt_("&OK"));
-               return false;
+               return absfname.exists();
        }
-       string const bpath = buffer().filePath();
-       // Path might be relative to current Buffer, so make absolute
-       FileName const absfname = support::makeAbsPath(fromqstr(fname), bpath);
+
        // Set OK button text according to whether file already exists
        okbutton->setText(absfname.exists() ? qt_("&OK") : qt_("&Create"));
        // enable edit button iff file is open in some Buffer
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to