Jean-Marc Lasgouttes wrote:

> This is to ensure that the messages sent back to the lyx server are
> not locale-dependant. I am not sure whether it is a good idea, but at
> least we should be consistent.

Ok, I did not know that. I'll change it for consistency reasons, although I
fail to see why messages (as opposed to protocol stuff) should be locale
independant.

> The return value tells whether the inset considers itself
> authoritative on the subject, or not.

Then I think that MathHullInset::getStatus() should return true and set
flag.enabled() to false. Updated patch attached.


Georg
Index: src/mathed/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ChangeLog,v
retrieving revision 1.455
diff -u -p -r1.455 ChangeLog
--- src/mathed/ChangeLog	24 Nov 2004 21:58:41 -0000	1.455
+++ src/mathed/ChangeLog	26 Nov 2004 11:14:19 -0000
@@ -1,3 +1,7 @@
+2004-11-26  Georg Baum  <[EMAIL PROTECTED]>
+
+	* math_hullinset.C (getStatus): add status messages
+
 2004-11-24  Lars Gullik Bjønnes  <[EMAIL PROTECTED]>
 
 	* Most insets: rename priv_dispatch to doDispatch
Index: src/mathed/math_hullinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_hullinset.C,v
retrieving revision 1.159
diff -u -p -r1.159 math_hullinset.C
--- src/mathed/math_hullinset.C	24 Nov 2004 21:58:41 -0000	1.159
+++ src/mathed/math_hullinset.C	26 Nov 2004 11:14:20 -0000
@@ -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 & 
 		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:

Reply via email to