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 00078 void ConfigDialog::slotOk() 00079 { 00080 d->ui->save(); 00081 accept(); 00082 } 00083 00084 void ConfigDialog::slotApply() 00085 { 00086 d->ui->save(); 00087 } 00088 00089 void ConfigDialog::setLanguage( const QString &language ) 00090 { 00091 d->ui->setLanguage( language ); 00092 } 00093 00094 #include "configdialog.moc"
KDE 4.7 API Reference