From 9a45f8922cecb4ffc5b87a3e4b45a777528e3d07 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Fri, 26 Nov 2004 13:56:22 +0000 Subject: [PATCH] add status messages to math hull inset git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9312 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 4 ++++ src/mathed/math_hullinset.C | 34 ++++++++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 174691e6c9..e51560bbc6 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,7 @@ +2004-11-26 Georg Baum + + * math_hullinset.C (getStatus): add status messages + 2004-11-24 Lars Gullik Bjønnes * Most insets: rename priv_dispatch to doDispatch diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 64ac084e3d..47bbd258ad 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -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 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: