3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author Allan Rae <rae@lyx.org>
7 * \author Angus Leeming <a.leeming@ic.ac.uk>
13 #pragma implementation
20 qt2BC::qt2BC(string const & cancel, string const & close)
21 : ButtonControllerBase(cancel, close),
22 okay_(0), apply_(0), cancel_(0), restore_(0), read_only_()
29 if (bp().buttonStatus(ButtonPolicy::OKAY)) {
30 okay_->setEnabled( true );
32 okay_->setEnabled( false );
36 if (bp().buttonStatus(ButtonPolicy::APPLY)) {
37 apply_->setEnabled( true );
39 apply_->setEnabled( false );
43 if (bp().buttonStatus(ButtonPolicy::RESTORE)) {
44 restore_->setEnabled( true );
46 restore_->setEnabled( false );
50 if (bp().buttonStatus(ButtonPolicy::CANCEL)) {
51 cancel_->setText( cancel_label_.c_str() );
53 cancel_->setText( close_label_.c_str() );
56 if (!read_only_.empty()) {
58 if (bp().isReadOnly()) enable = false;
60 for (std::list<QWidget *>::iterator iter = read_only_.begin();
61 iter != read_only_.end(); ++iter) {
62 (*iter)->setEnabled( enable );