]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCompareHistory.cpp
rename buffer parameter math_number_before to math_numbering_side
[lyx.git] / src / frontends / qt4 / GuiCompareHistory.cpp
index b8d26ecd042283feb87932373d38c695b53013ee..d176a387c41c0eda881975cc02a6a9dcfe979289 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <config.h>
 #include <support/debug.h>
+#include <limits>
 
 #include "GuiCompareHistory.h"
 
@@ -51,11 +52,22 @@ bool GuiCompareHistory::initialiseParams(std::string const &)
        int rev=0;
 
        string tmp;
-       // RCS case
-       if (!isStrInt(revstring))
-               revstring = rsplit(revstring, tmp , '.' );
-       if (isStrInt(revstring))
-               rev = convert<int>(revstring);
+       bool enableBetween = true;
+       // GIT case, hash is long
+       if (revstring.length() > 20) {
+               enableBetween = false;
+               rev = numeric_limits<int>::max();
+       } else {
+               // RCS case
+               if (!isStrInt(revstring))
+                       revstring = rsplit(revstring, tmp , '.' );
+               // both SVN & RCS cases
+               if (isStrInt(revstring))
+                       rev = convert<int>(revstring);
+       }
+
+       // later we can provide comparison between two hashes
+       betweenrevRB->setEnabled(enableBetween);
 
        okPB->setEnabled(rev);
        rev1SB->setMaximum(rev);
@@ -95,8 +107,11 @@ void GuiCompareHistory::selectBetweenrev()
 void GuiCompareHistory::enableControls()
 {
        bool rb = revbackRB->isChecked();
+       oldL->setEnabled(!rb);
+       newL->setEnabled(!rb);
        rev1SB->setEnabled(!rb);
        rev2SB->setEnabled(!rb);
+       rev2SB->setEnabled(!rb);
        betweenrevRB->setChecked(!rb);
        revbackSB->setEnabled(rb);
 }