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( 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 connect(this, SIGNAL(okClicked()), 00068 this, SLOT(slotOk())); 00069 /* 00070 connect(this, SIGNAL(applyClicked()), 00071 this, SLOT(slotApply())); 00072 */ 00073 connect(d->ui, SIGNAL(configChanged()), 00074 this, SLOT(slotConfigChanged())); 00075 } 00076 00077 void ConfigDialog::slotOk() 00078 { 00079 d->ui->save(); 00080 accept(); 00081 } 00082 00083 void ConfigDialog::slotApply() 00084 { 00085 d->ui->save(); 00086 } 00087 00088 void ConfigDialog::setLanguage( const QString &language ) 00089 { 00090 d->ui->setLanguage( language ); 00091 } 00092 00093 #include "configdialog.moc"
KDE 4.6 API Reference