#include "support/debug.h"
#include "support/foreach.h"
+#include <QCheckBox>
#include <QPushButton>
#include <QLineEdit>
#include <QLabel>
typedef QList<CheckedLineEdit> CheckedWidgetList;
Private()
- : okay_(0), apply_(0), cancel_(0), restore_(0),
+ : okay_(0), apply_(0), cancel_(0), restore_(0), auto_apply_(0),
policy_(ButtonPolicy::IgnorantPolicy)
{}
QPushButton * apply_;
QPushButton * cancel_;
QPushButton * restore_;
+ QCheckBox * auto_apply_;
typedef QList<QWidget *> Widgets;
Widgets read_only_;
}
+void ButtonController::autoApply()
+{
+ input(ButtonPolicy::SMI_AUTOAPPLY);
+}
+
+
void ButtonController::cancel()
{
input(ButtonPolicy::SMI_CANCEL);
else
d->cancel_->setText(qt_("Close"));
}
+ if (d->auto_apply_) {
+ bool const enabled = policy().buttonStatus(ButtonPolicy::AUTOAPPLY);
+ d->auto_apply_->setEnabled(enabled);
+ }
+
}
}
+void ButtonController::setAutoApply(QCheckBox * obj)
+{
+ d->auto_apply_ = obj;
+}
+
+
void ButtonController::setCancel(QPushButton * obj)
{
d->cancel_ = obj;