mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Rename is_valid_ as validated_, which is a bit more informative.
This commit is contained in:
parent
afee2488cb
commit
94b9da328b
@ -574,7 +574,7 @@ void PreambleModule::closeEvent(QCloseEvent * e)
|
|||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
LocalLayout::LocalLayout() : current_id_(0), is_valid_(false)
|
LocalLayout::LocalLayout() : current_id_(0), validated_(false)
|
||||||
{
|
{
|
||||||
connect(locallayoutTE, SIGNAL(textChanged()), this, SLOT(textChanged()));
|
connect(locallayoutTE, SIGNAL(textChanged()), this, SLOT(textChanged()));
|
||||||
connect(validatePB, SIGNAL(clicked()), this, SLOT(validatePressed()));
|
connect(validatePB, SIGNAL(clicked()), this, SLOT(validatePressed()));
|
||||||
@ -612,7 +612,7 @@ void LocalLayout::textChanged()
|
|||||||
fromqstr(locallayoutTE->document()->toPlainText().trimmed());
|
fromqstr(locallayoutTE->document()->toPlainText().trimmed());
|
||||||
|
|
||||||
if (layout.empty()) {
|
if (layout.empty()) {
|
||||||
is_valid_ = true;
|
validated_ = true;
|
||||||
validatePB->setEnabled(false);
|
validatePB->setEnabled(false);
|
||||||
validLB->setText("");
|
validLB->setText("");
|
||||||
convertPB->hide();
|
convertPB->hide();
|
||||||
@ -620,7 +620,7 @@ void LocalLayout::textChanged()
|
|||||||
changed();
|
changed();
|
||||||
} else if (!validatePB->isEnabled()) {
|
} else if (!validatePB->isEnabled()) {
|
||||||
// if that's already enabled, we shouldn't need to do anything.
|
// if that's already enabled, we shouldn't need to do anything.
|
||||||
is_valid_ = false;
|
validated_ = false;
|
||||||
validLB->setText(message);
|
validLB->setText(message);
|
||||||
validatePB->setEnabled(true);
|
validatePB->setEnabled(true);
|
||||||
convertPB->setEnabled(false);
|
convertPB->setEnabled(false);
|
||||||
@ -664,9 +664,9 @@ void LocalLayout::validate() {
|
|||||||
fromqstr(locallayoutTE->document()->toPlainText().trimmed());
|
fromqstr(locallayoutTE->document()->toPlainText().trimmed());
|
||||||
if (!layout.empty()) {
|
if (!layout.empty()) {
|
||||||
TextClass::ReturnValues const ret = TextClass::validate(layout);
|
TextClass::ReturnValues const ret = TextClass::validate(layout);
|
||||||
is_valid_ = (ret == TextClass::OK) || (ret == TextClass::OK_OLDFORMAT);
|
validated_ = (ret == TextClass::OK) || (ret == TextClass::OK_OLDFORMAT);
|
||||||
validatePB->setEnabled(false);
|
validatePB->setEnabled(false);
|
||||||
validLB->setText(is_valid_ ? vtext : ivtext);
|
validLB->setText(validated_ ? vtext : ivtext);
|
||||||
if (ret == TextClass::OK_OLDFORMAT) {
|
if (ret == TextClass::OK_OLDFORMAT) {
|
||||||
convertPB->show();
|
convertPB->show();
|
||||||
convertPB->setEnabled(true);
|
convertPB->setEnabled(true);
|
||||||
|
@ -287,7 +287,7 @@ public:
|
|||||||
LocalLayout();
|
LocalLayout();
|
||||||
void update(BufferParams const & params, BufferId id);
|
void update(BufferParams const & params, BufferId id);
|
||||||
void apply(BufferParams & params);
|
void apply(BufferParams & params);
|
||||||
bool isValid() const { return is_valid_; }
|
bool isValid() const { return validated_; }
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
/// signal that something's changed in the Widget.
|
/// signal that something's changed in the Widget.
|
||||||
@ -303,7 +303,7 @@ private Q_SLOTS:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
BufferId current_id_;
|
BufferId current_id_;
|
||||||
bool is_valid_;
|
bool validated_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user