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"
16 #include <QListWidget>
17 #include <QPushButton>
18 #include <QCloseEvent>
23 QSpellcheckerDialog::QSpellcheckerDialog(QSpellchecker * form)
28 connect(closePB, SIGNAL(clicked()),
29 form, SLOT(slotClose()));
31 connect( replaceCO, SIGNAL( highlighted(const QString&) ),
32 this, SLOT( replaceChanged(const QString &) ) );
33 connect( replacePB, SIGNAL( clicked() ),
34 this, SLOT( replaceClicked() ) );
35 connect( ignorePB, SIGNAL( clicked() ),
36 this, SLOT( ignoreClicked() ) );
37 connect( replacePB_3, SIGNAL( clicked() ),
38 this, SLOT( acceptClicked() ) );
39 connect( addPB, SIGNAL( clicked() ),
40 this, SLOT( addClicked() ) );
41 connect( suggestionsLW, SIGNAL( itemDoubleClicked(QListWidgetItem*) ),
42 this, SLOT( replaceClicked() ) );
43 connect( suggestionsLW, SIGNAL( itemClicked(QListWidgetItem*) ),
44 this, SLOT( suggestionChanged(QListWidgetItem*) ) );
48 void QSpellcheckerDialog::acceptClicked()
53 void QSpellcheckerDialog::addClicked()
58 void QSpellcheckerDialog::replaceClicked()
63 void QSpellcheckerDialog::ignoreClicked()
68 void QSpellcheckerDialog::suggestionChanged(QListWidgetItem * item)
70 if (replaceCO->count() != 0)
71 replaceCO->changeItem(item->text(), 0);
73 replaceCO->insertItem(item->text());
75 replaceCO->setCurrentItem(0);
78 void QSpellcheckerDialog::replaceChanged(const QString & str)
80 if (suggestionsLW->currentItem()->text() == str)
83 for (int i = 0; i < suggestionsLW->count(); ++i) {
84 if (suggestionsLW->item(i)->text() == str) {
85 suggestionsLW->setCurrentRow(i);
92 void QSpellcheckerDialog::closeEvent(QCloseEvent * e)
99 void QSpellcheckerDialog::reject()
105 } // namespace frontend
108 #include "QSpellcheckerDialog_moc.cpp"