]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/GuiInclude.cpp
Make string-widget combination more l7n friendly
[lyx.git] / src / frontends / qt / GuiInclude.cpp
index ad95b9f95dfdb348b9f7246da2bbb5622bcd5473..6120d669ef5072096cfa3fb346a249d58fc38025 100644 (file)
@@ -84,7 +84,9 @@ GuiInclude::GuiInclude(GuiView & lv)
        bc().addReadOnly(typeCO);
        bc().addReadOnly(listingsED);
 
-       bc().addCheckedLineEdit(filenameED, filenameLA);
+       // FIXME does not make sense, as we do not have a validator
+       // for this widget
+       //bc().addCheckedLineEdit(filenameED, filenameLA);
 }
 
 
@@ -318,14 +320,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