KDEUI
configdialog.cpp
Go to the documentation of this file.
00001 00021 #include "configdialog.h" 00022 #include "configwidget.h" 00023 00024 #include <klocale.h> 00025 00026 #include <kvbox.h> 00027 00028 using namespace Sonnet; 00029 00030 class ConfigDialog::Private 00031 { 00032 public: 00033 Private( ConfigDialog *parent ) 00034 : q( parent ) {} 00035 ConfigWidget *ui; 00036 ConfigDialog *q; 00037 void slotConfigChanged(); 00038 }; 00039 00040 void ConfigDialog::Private::slotConfigChanged() 00041 { 00042 emit q->languageChanged( ui->language() ); 00043 } 00044 00045 ConfigDialog::ConfigDialog(KConfig *config, QWidget *parent) 00046 : KDialog(parent), 00047 d(new Private(this)) 00048 { 00049 setObjectName( "SonnetConfigDialog" ); 00050 setModal( true ); 00051 setCaption( i18n( "Spell Checking Configuration" ) ); 00052 setButtons( Help | Ok /*| Apply*/ | Cancel ); 00053 setDefaultButton( Ok ); 00054 00055 init(config); 00056 } 00057 00058 ConfigDialog::~ConfigDialog() 00059 { 00060 delete d; 00061 } 00062 00063 void ConfigDialog::init(KConfig *config) 00064 { 00065 d->ui = new ConfigWidget(config, this); 00066 setMainWidget(d->ui); 00067 setHelp(QString(),"kcontrol/spellchecking"); 00068 connect(this, SIGNAL(okClicked()), 00069 this, SLOT(slotOk())); 00070 /* 00071 connect(this, SIGNAL(applyClicked()), 00072 this, SLOT(slotApply())); 00073 */ 00074 connect(d->ui, SIGNAL(configChanged()), 00075 this, SLOT(slotConfigChanged())); 00076 00077 connect(d->ui, SIGNAL(configChanged()), 00078 this, SIGNAL(configChanged())); 00079 } 00080 00081 void ConfigDialog::slotOk() 00082 { 00083 d->ui->save(); 00084 accept(); 00085 } 00086 00087 void ConfigDialog::slotApply() 00088 { 00089 d->ui->save(); 00090 } 00091 00092 void ConfigDialog::setLanguage( const QString &language ) 00093 { 00094 d->ui->setLanguage( language ); 00095 } 00096 00097 QString ConfigDialog::language() const 00098 { 00099 return d->ui->language(); 00100 } 00101 00102 #include "configdialog.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Wed May 2 2012 17:56:37 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Wed May 2 2012 17:56:37 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.