2001-09-01 03:52:21 +00:00
|
|
|
/**
|
|
|
|
* \file QSpellcheckerDialog.C
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-09-01 03:52:21 +00:00
|
|
|
*
|
2002-09-24 13:57:09 +00:00
|
|
|
* \author John Levon
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-09-01 03:52:21 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "QSpellcheckerDialog.h"
|
|
|
|
#include "QSpellchecker.h"
|
|
|
|
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <qlistbox.h>
|
|
|
|
#include <qcombobox.h>
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2001-09-01 03:52:21 +00:00
|
|
|
QSpellcheckerDialog::QSpellcheckerDialog(QSpellchecker * form)
|
|
|
|
: QSpellcheckerDialogBase(0, 0, false, 0),
|
|
|
|
form_(form)
|
|
|
|
{
|
|
|
|
connect(closePB, SIGNAL(clicked()),
|
2003-02-17 18:40:04 +00:00
|
|
|
form, SLOT(slotClose()));
|
2002-09-24 13:57:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QSpellcheckerDialog::acceptClicked()
|
|
|
|
{
|
|
|
|
form_->accept();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QSpellcheckerDialog::addClicked()
|
|
|
|
{
|
|
|
|
form_->add();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QSpellcheckerDialog::replaceClicked()
|
|
|
|
{
|
|
|
|
form_->replace();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QSpellcheckerDialog::ignoreClicked()
|
|
|
|
{
|
|
|
|
form_->ignore();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-06-28 01:23:11 +00:00
|
|
|
void QSpellcheckerDialog::suggestionChanged(const QString & str)
|
2001-09-01 03:52:21 +00:00
|
|
|
{
|
|
|
|
if (replaceCO->count() != 0)
|
|
|
|
replaceCO->changeItem(str, 0);
|
|
|
|
else
|
|
|
|
replaceCO->insertItem(str);
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-09-01 03:52:21 +00:00
|
|
|
replaceCO->setCurrentItem(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-06-28 01:23:11 +00:00
|
|
|
void QSpellcheckerDialog::replaceChanged(const QString & str)
|
2001-09-01 03:52:21 +00:00
|
|
|
{
|
|
|
|
if (suggestionsLB->currentText() == str)
|
|
|
|
return;
|
|
|
|
|
2001-11-06 18:10:55 +00:00
|
|
|
unsigned int i = 0;
|
2001-09-01 03:52:21 +00:00
|
|
|
for (; i < suggestionsLB->count(); ++i) {
|
|
|
|
if (suggestionsLB->text(i) == str)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i != suggestionsLB->count())
|
|
|
|
suggestionsLB->setCurrentItem(i);
|
|
|
|
}
|
2002-03-21 21:21:28 +00:00
|
|
|
|
|
|
|
|
2001-09-01 03:52:21 +00:00
|
|
|
void QSpellcheckerDialog::closeEvent(QCloseEvent * e)
|
|
|
|
{
|
|
|
|
form_->slotWMHide();
|
|
|
|
e->accept();
|
|
|
|
}
|
2002-11-28 16:16:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
void QSpellcheckerDialog::reject()
|
|
|
|
{
|
|
|
|
form_->slotWMHide();
|
|
|
|
QSpellcheckerDialogBase::reject();
|
|
|
|
}
|
2004-05-19 15:11:37 +00:00
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|