QRef.C QRef.h \
QSendto.C QSendto.h \
QShowFile.C QShowFile.h \
- QSpellchecker.C QSpellchecker.h \
QTabular.C QTabular.h \
QTabularCreate.C QTabularCreate.h \
Qt2BC.C Qt2BC.h \
QSendtoDialog.C QSendtoDialog.h \
qsetborder.C qsetborder.h \
QShowFileDialog.C QShowFileDialog.h \
- QSpellcheckerDialog.C QSpellcheckerDialog.h \
+ QSpellchecker.C QSpellchecker.h \
QDialogView.C QDialogView.h \
QTabularCreateDialog.C QTabularCreateDialog.h \
QTabularDialog.C QTabularDialog.h \
#include <config.h>
#include "QSpellchecker.h"
-#include "QSpellcheckerDialog.h"
#include "Qt2BC.h"
#include "qt_helpers.h"
#include <QPushButton>
#include <QListWidget>
#include <QListWidgetItem>
+#include <QCloseEvent>
+#include <QSyntaxHighlighter>
+#include <QTextCharFormat>
+#include <QTextDocument>
+
using std::string;
namespace lyx {
namespace frontend {
-typedef QController<ControlSpellchecker, QView<QSpellcheckerDialog> > spellchecker_base_class;
+/////////////////////////////////////////////////////////////////////
+//
+// QSpellCheckerDialog
+//
+/////////////////////////////////////////////////////////////////////
+
+
+QSpellcheckerDialog::QSpellcheckerDialog(QSpellchecker * form)
+ : form_(form)
+{
+ setupUi(this);
+
+ connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
+
+ connect(replaceCO, SIGNAL(highlighted(const QString &)),
+ this, SLOT(replaceChanged(const QString &)));
+ connect(replacePB, SIGNAL(clicked()),
+ this, SLOT(replaceClicked()));
+ connect(ignorePB, SIGNAL(clicked()),
+ this, SLOT(ignoreClicked()));
+ connect(replacePB_3, SIGNAL(clicked()),
+ this, SLOT(acceptClicked()));
+ connect(addPB, SIGNAL(clicked()),
+ this, SLOT(addClicked()));
+ connect(suggestionsLW, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
+ this, SLOT(replaceClicked() ) );
+ connect(suggestionsLW, SIGNAL(itemClicked(QListWidgetItem*)),
+ this, SLOT(suggestionChanged(QListWidgetItem*)));
+}
+
+
+void QSpellcheckerDialog::acceptClicked()
+{
+ form_->accept();
+}
+
+void QSpellcheckerDialog::addClicked()
+{
+ form_->add();
+}
+
+void QSpellcheckerDialog::replaceClicked()
+{
+ form_->replace();
+}
+
+void QSpellcheckerDialog::ignoreClicked()
+{
+ form_->ignore();
+}
+
+void QSpellcheckerDialog::suggestionChanged(QListWidgetItem * item)
+{
+ if (replaceCO->count() != 0)
+ replaceCO->setItemText(0, item->text());
+ else
+ replaceCO->addItem(item->text());
+
+ replaceCO->setCurrentIndex(0);
+}
+
+void QSpellcheckerDialog::replaceChanged(const QString & str)
+{
+ if (suggestionsLW->currentItem()->text() == str)
+ return;
+
+ for (int i = 0; i < suggestionsLW->count(); ++i) {
+ if (suggestionsLW->item(i)->text() == str) {
+ suggestionsLW->setCurrentRow(i);
+ break;
+ }
+ }
+}
+
+
+void QSpellcheckerDialog::closeEvent(QCloseEvent * e)
+{
+ form_->slotWMHide();
+ e->accept();
+}
+
+
+void QSpellcheckerDialog::reject()
+{
+ form_->slotWMHide();
+ QDialog::reject();
+}
+
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// QSpellChecker
+//
+/////////////////////////////////////////////////////////////////////
+
+typedef QController<ControlSpellchecker, QView<QSpellcheckerDialog> >
+ SpellcheckerBase;
QSpellchecker::QSpellchecker(Dialog & parent)
- : spellchecker_base_class(parent, _("Spellchecker"))
+ : SpellcheckerBase(parent, _("Spellchecker"))
{}
} // namespace frontend
} // namespace lyx
+
+#include "QSpellchecker_moc.cpp"
#define QSPELLCHECKER_H
#include "QDialogView.h"
-#include "QSpellcheckerDialog.h"
+#include "ui/SpellcheckerUi.h"
+
+#include <QDialog>
+#include <QCloseEvent>
+
+class QListWidgetItem;
namespace lyx {
namespace frontend {
+class QSpellchecker;
+
+class QSpellcheckerDialog: public QDialog, public Ui::QSpellcheckerUi {
+ Q_OBJECT
+public:
+ QSpellcheckerDialog(QSpellchecker * form);
+public Q_SLOTS:
+ virtual void suggestionChanged(QListWidgetItem *);
+
+protected Q_SLOTS:
+ virtual void acceptClicked();
+ virtual void addClicked();
+ virtual void replaceClicked();
+ virtual void ignoreClicked();
+ virtual void replaceChanged(const QString &);
+ virtual void reject();
+
+protected:
+ virtual void closeEvent(QCloseEvent * e);
+
+private:
+ QSpellchecker * form_;
+};
+
+
class ControlSpellchecker;
class QSpellchecker
+++ /dev/null
-/**
- * \file QSpellcheckerDialog.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "QSpellcheckerDialog.h"
-#include "QSpellchecker.h"
-
-#include <QListWidget>
-#include <QPushButton>
-#include <QCloseEvent>
-
-namespace lyx {
-namespace frontend {
-
-QSpellcheckerDialog::QSpellcheckerDialog(QSpellchecker * form)
- : form_(form)
-{
- setupUi(this);
-
- connect(closePB, SIGNAL(clicked()),
- form, SLOT(slotClose()));
-
- connect( replaceCO, SIGNAL( highlighted(const QString&) ),
- this, SLOT( replaceChanged(const QString &) ) );
- connect( replacePB, SIGNAL( clicked() ),
- this, SLOT( replaceClicked() ) );
- connect( ignorePB, SIGNAL( clicked() ),
- this, SLOT( ignoreClicked() ) );
- connect( replacePB_3, SIGNAL( clicked() ),
- this, SLOT( acceptClicked() ) );
- connect( addPB, SIGNAL( clicked() ),
- this, SLOT( addClicked() ) );
- connect( suggestionsLW, SIGNAL( itemDoubleClicked(QListWidgetItem*) ),
- this, SLOT( replaceClicked() ) );
- connect( suggestionsLW, SIGNAL( itemClicked(QListWidgetItem*) ),
- this, SLOT( suggestionChanged(QListWidgetItem*) ) );
-}
-
-
-void QSpellcheckerDialog::acceptClicked()
-{
- form_->accept();
-}
-
-void QSpellcheckerDialog::addClicked()
-{
- form_->add();
-}
-
-void QSpellcheckerDialog::replaceClicked()
-{
- form_->replace();
-}
-
-void QSpellcheckerDialog::ignoreClicked()
-{
- form_->ignore();
-}
-
-void QSpellcheckerDialog::suggestionChanged(QListWidgetItem * item)
-{
- if (replaceCO->count() != 0)
- replaceCO->setItemText(0, item->text());
- else
- replaceCO->addItem(item->text());
-
- replaceCO->setCurrentIndex(0);
-}
-
-void QSpellcheckerDialog::replaceChanged(const QString & str)
-{
- if (suggestionsLW->currentItem()->text() == str)
- return;
-
- for (int i = 0; i < suggestionsLW->count(); ++i) {
- if (suggestionsLW->item(i)->text() == str) {
- suggestionsLW->setCurrentRow(i);
- break;
- }
- }
-}
-
-
-void QSpellcheckerDialog::closeEvent(QCloseEvent * e)
-{
- form_->slotWMHide();
- e->accept();
-}
-
-
-void QSpellcheckerDialog::reject()
-{
- form_->slotWMHide();
- QDialog::reject();
-}
-
-} // namespace frontend
-} // namespace lyx
-
-#include "QSpellcheckerDialog_moc.cpp"
+++ /dev/null
-// -*- C++ -*-
-/**
- * \file QSpellcheckerDialog.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef QSPELLCHECKERDIALOG_H
-#define QSPELLCHECKERDIALOG_H
-
-#include "ui/SpellcheckerUi.h"
-
-#include <QDialog>
-#include <QCloseEvent>
-
-class QListWidgetItem;
-
-namespace lyx {
-namespace frontend {
-
-class QSpellchecker;
-
-class QSpellcheckerDialog: public QDialog, public Ui::QSpellcheckerUi {
- Q_OBJECT
-public:
- QSpellcheckerDialog(QSpellchecker * form);
-public Q_SLOTS:
- virtual void suggestionChanged(QListWidgetItem *);
-
-protected Q_SLOTS:
- virtual void acceptClicked();
- virtual void addClicked();
- virtual void replaceClicked();
- virtual void ignoreClicked();
- virtual void replaceChanged(const QString &);
- virtual void reject();
-
-protected:
- virtual void closeEvent(QCloseEvent * e);
-
-private:
- QSpellchecker * form_;
-};
-
-} // namespace frontend
-} // namespace lyx
-
-#endif // QSPELLCHECKERDIALOG_H