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