2 * \file QSpellcheckerDialog.C
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 "QSpellcheckerDialog.h"
14 #include "QSpellchecker.h"
17 #include <QPushButton>
19 #include <QCloseEvent>
24 QSpellcheckerDialog::QSpellcheckerDialog(QSpellchecker * form)
29 connect(closePB, SIGNAL(clicked()),
30 form, SLOT(slotClose()));
32 connect( replaceCO, SIGNAL( highlighted(const QString&) ), this, SLOT( replaceChanged(const QString &) ) );
33 connect( replacePB, SIGNAL( clicked() ), this, SLOT( replaceClicked() ) );
34 connect( ignorePB, SIGNAL( clicked() ), this, SLOT( ignoreClicked() ) );
35 connect( replacePB_3, SIGNAL( clicked() ), this, SLOT( acceptClicked() ) );
36 connect( addPB, SIGNAL( clicked() ), this, SLOT( addClicked() ) );
37 connect( suggestionsLB, SIGNAL( doubleClicked(QListBoxItem*) ), this, SLOT( replaceClicked() ) );
38 connect( suggestionsLB, SIGNAL( highlighted(const QString&) ), this, SLOT( suggestionChanged(const QString &) ) );
42 void QSpellcheckerDialog::acceptClicked()
47 void QSpellcheckerDialog::addClicked()
52 void QSpellcheckerDialog::replaceClicked()
57 void QSpellcheckerDialog::ignoreClicked()
62 void QSpellcheckerDialog::suggestionChanged(const QString & str)
64 if (replaceCO->count() != 0)
65 replaceCO->changeItem(str, 0);
67 replaceCO->insertItem(str);
69 replaceCO->setCurrentItem(0);
72 void QSpellcheckerDialog::replaceChanged(const QString & str)
74 if (suggestionsLB->currentText() == str)
78 for (; i < suggestionsLB->count(); ++i) {
79 if (suggestionsLB->text(i) == str)
83 if (i != suggestionsLB->count())
84 suggestionsLB->setCurrentItem(i);
88 void QSpellcheckerDialog::closeEvent(QCloseEvent * e)
95 void QSpellcheckerDialog::reject()
101 } // namespace frontend