2 * \file QThesaurusDialog.C
3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author John Levon <moz@compsoc.man.ac.uk>
14 #include "ControlThesaurus.h"
15 #include "QThesaurusDialog.h"
17 #include "QThesaurus.h"
20 #include <qpushbutton.h>
22 #include <qlineedit.h>
24 QThesaurusDialog::QThesaurusDialog(QThesaurus * form)
25 : QThesaurusDialogBase(0, 0, false, 0),
28 connect(closePB, SIGNAL(clicked()),
29 form, SLOT(slotClose()));
33 void QThesaurusDialog::change_adaptor()
39 void QThesaurusDialog::closeEvent(QCloseEvent * e)
46 void QThesaurusDialog::entryChanged()
52 void QThesaurusDialog::replaceClicked()
58 void QThesaurusDialog::selectionChanged(const QString & str)
60 string const entry(str.latin1());
61 entryED->setText(entry.c_str());
66 void QThesaurusDialog::updateLists()
68 ControlThesaurus & control(form_->controller());
69 string const entry(entryED->text().latin1());
71 std::vector<string> matches;
73 matches = control.getNouns(entry);
74 for (std::vector<string>::const_iterator cit = matches.begin();
75 cit != matches.end(); ++cit)
76 nounsLB->insertItem(cit->c_str());
77 matches = control.getVerbs(entry);
78 for (std::vector<string>::const_iterator cit = matches.begin();
79 cit != matches.end(); ++cit)
80 verbsLB->insertItem(cit->c_str());
81 matches = control.getAdjectives(entry);
82 for (std::vector<string>::const_iterator cit = matches.begin();
83 cit != matches.end(); ++cit)
84 adjectivesLB->insertItem(cit->c_str());
85 matches = control.getAdverbs(entry);
86 for (std::vector<string>::const_iterator cit = matches.begin();
87 cit != matches.end(); ++cit)
88 adverbsLB->insertItem(cit->c_str());
89 matches = control.getOthers(entry);
90 for (std::vector<string>::const_iterator cit = matches.begin();
91 cit != matches.end(); ++cit)
92 otherLB->insertItem(cit->c_str());