From 4aed2c8219774f5d797760606b8489a92ddc5163 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kcontrol/spellchecking/spellchecking.cpp | 74 ++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 kcontrol/spellchecking/spellchecking.cpp (limited to 'kcontrol/spellchecking/spellchecking.cpp') diff --git a/kcontrol/spellchecking/spellchecking.cpp b/kcontrol/spellchecking/spellchecking.cpp new file mode 100644 index 000000000..d4e781844 --- /dev/null +++ b/kcontrol/spellchecking/spellchecking.cpp @@ -0,0 +1,74 @@ +/* + Copyright (c) 2001 Laurent Montel + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include + +#include +#include +#include +#include + +#include "spellchecking.h" + +typedef KGenericFactory SpellFactory; +K_EXPORT_COMPONENT_FACTORY (kcm_spellchecking, SpellFactory("kcmspellchecking") ) + + +KSpellCheckingConfig::KSpellCheckingConfig(QWidget *parent, const char *name, const QStringList &): + KCModule(SpellFactory::instance(), parent, name) +{ + QBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint()); + QGroupBox *box = new QVGroupBox( i18n("Spell Checking Settings"), this ); + box->layout()->setSpacing( KDialog::spacingHint() ); + layout->addWidget(box); + + spellConfig = new KSpellConfig(box, 0L ,0L, false ); + layout->addStretch(1); + connect(spellConfig,SIGNAL(configChanged()), SLOT( changed() )); + + setQuickHelp( i18n("

Spell Checker

This control module allows you to configure the KDE spell checking system. You can configure:

  • which spell checking program to use
  • which types of spelling errors are identified
  • which dictionary is used by default.

The KDE spell checking system (KSpell) provides support for two common spell checking utilities: ASpell and ISpell. This allows you to share dictionaries between KDE applications and non-KDE applications.

")); + +} + +void KSpellCheckingConfig::load() +{ + spellConfig->readGlobalSettings(); +} + +void KSpellCheckingConfig::save() +{ + spellConfig->writeGlobalSettings(); + QByteArray data; + if ( !kapp->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send( "konqueror*", "KonquerorIface", "reparseConfiguration()", data ); +} + +void KSpellCheckingConfig::defaults() +{ + spellConfig->setNoRootAffix(0); + spellConfig->setRunTogether(0); + spellConfig->setDictionary(""); + spellConfig->setDictFromList(FALSE); + spellConfig->setEncoding (KS_E_ASCII); + spellConfig->setClient (KS_CLIENT_ISPELL); +} + +#include "spellchecking.moc" -- cgit v1.2.3