3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author John Levon <moz@compsoc.man.ac.uk>
12 #pragma implementation
15 #include "ControlThesaurus.h"
16 #include "QThesaurusDialog.h"
17 #include "QThesaurus.h"
21 #include <qlineedit.h>
22 #include <qpushbutton.h>
25 typedef Qt2CB<ControlThesaurus, Qt2DB<QThesaurusDialog> > base_class;
27 QThesaurus::QThesaurus(ControlThesaurus & c)
28 : base_class(c, _("Thesaurus"))
33 void QThesaurus::build_dialog()
35 dialog_.reset(new QThesaurusDialog(this));
37 bc().setCancel(dialog_->closePB);
38 bc().setApply(dialog_->replacePB);
39 bc().addReadOnly(dialog_->replaceED);
40 bc().addReadOnly(dialog_->replacePB);
44 void QThesaurus::update_contents()
46 dialog_->entryED->setText(controller().text().c_str());
47 dialog_->updateLists();
51 void QThesaurus::replace()
53 controller().replace(dialog_->replaceED->text().latin1());