]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt/GuiInclude.cpp
Show suggestions containing the input in the command buffer
[features.git] / src / frontends / qt / GuiInclude.cpp
index 770c2ac2148762e2dc0a7a72376eadc4251a6b6f..3d4f3dde1b9282e64fd62b94a8eea740ecdda3b1 100644 (file)
@@ -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
@@ -393,9 +396,6 @@ void GuiInclude::dispatchParams()
 }
 
 
-Dialog * createGuiInclude(GuiView & lv) { return new GuiInclude(lv); }
-
-
 } // namespace frontend
 } // namespace lyx