]> git.lyx.org Git - lyx.git/blobdiff - src/lyxvc.C
Collapse all those LFUN_XYZ_APPLY to a single LFUN_INSET_APPLY.
[lyx.git] / src / lyxvc.C
index a181ec96b4da783e6e44bc9ce16eef974a93c51e..629e6daebf117943803b158fb3af723fe0efd31d 100644 (file)
@@ -1,16 +1,12 @@
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "lyxvc.h"
 #include "vc-backend.h"
 #include "debug.h"
 #include "buffer.h"
 #include "BufferView.h"
-#include "lyxfunc.h"
 #include "gettext.h"
+#include "funcrequest.h"
 
 #include "frontends/Alert.h"
 #include "frontends/LyXView.h"
@@ -76,7 +72,7 @@ void LyXVC::buffer(Buffer * buf)
 void LyXVC::registrer()
 {
        string const filename = owner_->fileName();
+
        // there must be a file to save
        if (!IsFileReadable(filename)) {
                Alert::alert(_("File not saved"),
@@ -108,19 +104,18 @@ void LyXVC::registrer()
        }
 
        // If the document is changed, we might want to save it
-       if (!vcs->owner()->isLyxClean() &&
+       if (!vcs->owner()->isClean() &&
            Alert::askQuestion(_("Changes in document:"),
                        MakeDisplayPath(filename, 50),
                        _("Save document and proceed?"))) {
                vcs->owner()->getUser()->owner()
-                       ->getLyXFunc()->dispatch(LFUN_MENUWRITE);
+                       ->dispatch(FuncRequest(LFUN_MENUWRITE));
        }
 
        // Maybe the save fails, or we answered "no". In both cases,
        // the document will be dirty, and we abort.
-       if (!vcs->owner()->isLyxClean()) {
+       if (!vcs->owner()->isClean())
                return;
-       }
 
        lyxerr[Debug::LYXVC] << "LyXVC: registrer" << endl;
        pair<bool, string> tmp =
@@ -141,19 +136,18 @@ void LyXVC::registrer()
 void LyXVC::checkIn()
 {
        // If the document is changed, we might want to save it
-       if (!vcs->owner()->isLyxClean() &&
+       if (!vcs->owner()->isClean() &&
            Alert::askQuestion(_("Changes in document:"),
                        MakeDisplayPath(vcs->owner()->fileName(), 50),
                        _("Save document and proceed?"))) {
                vcs->owner()->getUser()->owner()
-                       ->getLyXFunc()->dispatch(LFUN_MENUWRITE);
+                       ->dispatch(FuncRequest(LFUN_MENUWRITE));
        }
 
        // Maybe the save fails, or we answered "no". In both cases,
        // the document will be dirty, and we abort.
-       if (!vcs->owner()->isLyxClean()) {
+       if (!vcs->owner()->isClean())
                return;
-       }
 
        lyxerr[Debug::LYXVC] << "LyXVC: checkIn" << endl;
        pair<bool, string> tmp = Alert::askForText(_("LyX VC: Log Message"));
@@ -171,7 +165,7 @@ void LyXVC::checkIn()
 void LyXVC::checkOut()
 {
        lyxerr[Debug::LYXVC] << "LyXVC: checkOut" << endl;
-       if (!vcs->owner()->isLyxClean()
+       if (!vcs->owner()->isClean()
            && !Alert::askQuestion(_("Changes in document:"),
                           MakeDisplayPath(vcs->owner()->fileName(), 50),
                           _("Ignore changes and proceed with check out?"))) {