X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt%2FGuiInclude.cpp;h=3d4f3dde1b9282e64fd62b94a8eea740ecdda3b1;hb=89394bcd0f3b5079a066d8c3f6f7a5e606073db3;hp=ad95b9f95dfdb348b9f7246da2bbb5622bcd5473;hpb=78f457796c87bd86a10c7b24bf70f9bf60894f4f;p=features.git diff --git a/src/frontends/qt/GuiInclude.cpp b/src/frontends/qt/GuiInclude.cpp index ad95b9f95d..3d4f3dde1b 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