X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFuncStatus.C;h=530b8e893a04c0bd35710b699ca7e88d755890b9;hb=c4320d24cd2d29c2e77958b4a8fd44f2bd587ca7;hp=1998db67d1d0a9f81311606931c334c578d9137e;hpb=5c3d9a254640468e40b2d30467a26222c91d856d;p=lyx.git diff --git a/src/FuncStatus.C b/src/FuncStatus.C index 1998db67d1..530b8e893a 100644 --- a/src/FuncStatus.C +++ b/src/FuncStatus.C @@ -12,7 +12,11 @@ #include "FuncStatus.h" -FuncStatus::FuncStatus() : v_(OK) + +namespace lyx { + +FuncStatus::FuncStatus() + : v_(OK) { } @@ -20,12 +24,15 @@ FuncStatus::FuncStatus() : v_(OK) void FuncStatus::clear() { v_ = OK; + message_.erase(); } void FuncStatus::operator|=(FuncStatus const & f) { v_ |= f.v_; + if (!f.message_.empty()) + message_ = f.message_; } @@ -45,18 +52,18 @@ bool FuncStatus::unknown() const } -void FuncStatus::disabled(bool b) +void FuncStatus::enabled(bool b) { if (b) - v_ |= DISABLED; - else v_ &= !DISABLED; + else + v_ |= DISABLED; } -bool FuncStatus::disabled() const +bool FuncStatus::enabled() const { - return (v_ & DISABLED); + return !(v_ & DISABLED); } @@ -73,3 +80,18 @@ bool FuncStatus::onoff(bool b) const else return (v_ & OFF); } + + +void FuncStatus::message(docstring const & m) +{ + message_ = m; +} + + +docstring const & FuncStatus::message() const +{ + return message_; +} + + +} // namespace lyx