]> git.lyx.org Git - features.git/commitdiff
add status messages to math hull inset
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 26 Nov 2004 13:56:22 +0000 (13:56 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 26 Nov 2004 13:56:22 +0000 (13:56 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9312 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/math_hullinset.C

index 174691e6c964f067d4a28d8b8758bf234f4a3535..e51560bbc6f3115873faccd0137d1664a994a073 100644 (file)
@@ -1,3 +1,7 @@
+2004-11-26  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * math_hullinset.C (getStatus): add status messages
+
 2004-11-24  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * Most insets: rename priv_dispatch to doDispatch
index 64ac084e3d9002081fa818707cc93011dfc0f55d..47bbd258adb48aca22c946319de77a5710d942d0 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "BufferView.h"
 #include "CutAndPaste.h"
+#include "FuncStatus.h"
 #include "LColor.h"
 #include "LaTeXFeatures.h"
 #include "cursor.h"
@@ -48,6 +49,7 @@
 #include <sstream>
 
 using lyx::cap::grabAndEraseSelection;
+using lyx::support::bformat;
 using lyx::support::subst;
 
 using std::endl;
@@ -1102,19 +1104,35 @@ bool MathHullInset::getStatus(LCursor & cur, FuncRequest const & cmd,
                if (!rowChangeOK()
                    && (s == "append-row"
                        || s == "delete-row"
-                       || s == "copy-row"))
-                       return false;
+                       || s == "copy-row")) {
+                       flag.message(bformat(
+                               N_("Can't change number of rows in '%1$s'"),
+                               type_));
+                       flag.enabled(false);
+                       return true;
+               }
                if (nrows() <= 1
-                   && (s == "delete-row" || s == "swap-row"))
-                       return false;
+                   && (s == "delete-row" || s == "swap-row")) {
+                       flag.message(N_("Only one row"));
+                       flag.enabled(false);
+                       return true;
+               }
                if (!colChangeOK()
                    && (s == "append-column"
                        || s == "delete-column"
-                       || s == "copy-column"))
-                       return false;
+                       || s == "copy-column")) {
+                       flag.message(bformat(
+                               N_("Can't change number of columns in '%1$s'"),
+                               type_));
+                       flag.enabled(false);
+                       return true;
+               }
                if (ncols() <= 1
-                   && (s == "delete-column" || s == "swap-column"))
-                       return false;
+                   && (s == "delete-column" || s == "swap-column")) {
+                       flag.message(N_("Only one column"));
+                       flag.enabled(false);
+                       return true;
+               }
                return MathGridInset::getStatus(cur, cmd, flag);
        }
        default: