Re-enable input of non-LyX files (e.g., tex, pgf) (#12056)

This amends [a385b7dc2b58/lyxgit]

(cherry picked from commit 2af8e661a3)
This commit is contained in:
Juergen Spitzmueller 2020-12-28 09:58:30 +01:00
parent 8e53243514
commit 17e4f325f3
2 changed files with 10 additions and 5 deletions

View File

@ -317,14 +317,17 @@ bool GuiInclude::isValid()
okPB->setText(qt_("&OK"));
return true;
}
// Do we have a LyX filename?
if (!isLyXFileName(fromqstr(fname))) {
okPB->setText(qt_("&OK"));
return false;
}
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))) {
okPB->setText(qt_("&OK"));
return absfname.exists();
}
// Set OK button text according to whether file already exists
okPB->setText(absfname.exists() ? qt_("&OK") : qt_("&Create"));
// enable edit button iff file is open in some Buffer

View File

@ -53,6 +53,8 @@ What's new
* USER INTERFACE
- Re-enable input of non-LyX files (e.g., tex, pgf) (bug 12056).
- Fix problem with display of menus on Gnome Wayland (bug 11746).
- Improve error message for VCS file registration when RCS package