3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "QThesaurus.h"
14 #include "QThesaurusDialog.h"
16 #include "qt_helpers.h"
18 #include "controllers/ControlThesaurus.h"
21 #include <QPushButton>
26 typedef QController<ControlThesaurus, QView<QThesaurusDialog> > base_class;
28 QThesaurus::QThesaurus(Dialog & parent)
29 : base_class(parent, _("Thesaurus"))
34 void QThesaurus::build_dialog()
36 dialog_.reset(new QThesaurusDialog(this));
38 bcview().setCancel(dialog_->closePB);
39 bcview().setApply(dialog_->replacePB);
40 bcview().addReadOnly(dialog_->replaceED);
41 bcview().addReadOnly(dialog_->replacePB);
45 void QThesaurus::update_contents()
47 dialog_->entryED->setText(toqstr(controller().text()));
48 dialog_->replaceED->setText("");
49 dialog_->updateLists();
53 void QThesaurus::replace()
55 controller().replace(qstring_to_ucs4(dialog_->replaceED->text()));
58 } // namespace frontend