+2003-03-29 John Levon <levon@movementarian.org>
+
+ * lyxfunc.C: safety check for C-r (revert)
+
2003-03-29 John Levon <levon@movementarian.org>
* bufferlist.h:
}
#if USE_BOOST_FORMAT
- boost::format fmt(_("The document %1$s does not yet exist. Do you want to create a new document?"));
+ boost::format fmt(_("The document %1$s does not yet exist.\n\nDo you want to create a new document?"));
fmt % file;
string text = fmt.str();
#else
string text = _("The document ");
- text += file + _(" does not yet exist. Do you want to create a new document?");
+ text += file + _(" does not yet exist.\n\nDo you want to create a new document?");
#endif
int const ret = Alert::prompt(_("Create new document?"),
text, 0, _("&Create"), _("Cancel"));
WriteAs(view(), owner->buffer(), argument);
break;
- case LFUN_MENURELOAD:
- view()->reload();
+ case LFUN_MENURELOAD: {
+ string const file = MakeDisplayPath(view()->buffer()->fileName(), 20);
+#if USE_BOOST_FORMAT
+ boost::format fmt(_("Any changes will be lost. Are you sure you want to revert to the saved version of the document %1$s?"));
+ fmt % file;
+ string text = fmt.str();
+#else
+ string text = _("Any changes will be lost. Are you sure you want to revert to the saved version of the document");
+ text += file + _("?");
+#endif
+ int const ret = Alert::prompt(_("Revert to saved document?"),
+ text, 1, _("&Revert"), _("&Cancel"));
+
+ if (ret == 0)
+ view()->reload();
break;
+ }
case LFUN_UPDATE:
Exporter::Export(owner->buffer(), argument, true);