]> git.lyx.org Git - features.git/commitdiff
warning on revert
authorJohn Levon <levon@movementarian.org>
Sat, 29 Mar 2003 07:44:44 +0000 (07:44 +0000)
committerJohn Levon <levon@movementarian.org>
Sat, 29 Mar 2003 07:44:44 +0000 (07:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6623 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/bufferlist.C
src/lyxfunc.C

index c59c5477ab638c218b24b4304c89a0fc8fab5f74..3405e11785f6c88210f598d19256baf4635d56e2 100644 (file)
@@ -1,3 +1,7 @@
+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:
index 89d9dec90bf7da706278707fdb07fbcda2af5dec..cf4b46cee12cd2b9ddd449170a63347a87a62e2c 100644 (file)
@@ -558,12 +558,12 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
                }
 
 #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"));
index ba063131392a66096c13be1e169285236c8df060..daf01bbad6ff7334f1759079619153165bc6b9e4 100644 (file)
@@ -1023,9 +1023,23 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                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);