00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #include "cryptoconfigdialog.h"
00033 #include "cryptoconfigmodule.h"
00034 #include <klocale.h>
00035 #include <kaccelmanager.h>
00036
00037 Kleo::CryptoConfigDialog::CryptoConfigDialog( Kleo::CryptoConfig* config, TQWidget *parent, const char* name )
00038 : KDialogBase( Swallow,
00039
00040 WStyle_Customize | WStyle_DialogBorder | WStyle_Maximize | WStyle_Title | WStyle_SysMenu,
00041 parent, name, true ,
00042 i18n( "Configure" ), Default|Cancel|Apply|Ok|User1,
00043 Ok, true , KGuiItem( i18n( "&Reset" ), "undo" ) )
00044 {
00045 mMainWidget = new CryptoConfigModule( config, this );
00046 setMainWidget( mMainWidget );
00047 connect( mMainWidget, TQT_SIGNAL( changed() ), TQT_SLOT( slotChanged() ) );
00048 enableButton( Apply, false );
00049 if ( mMainWidget->hasError() ) {
00050 showButton( Default, false );
00051 showButton( User1, false );
00052 showButton( Apply, false );
00053 showButton( Ok, false );
00054 }
00055
00056
00057 KAcceleratorManager::manage( this );
00058 }
00059
00060 void Kleo::CryptoConfigDialog::slotOk()
00061 {
00062 slotApply();
00063 accept();
00064 }
00065
00066 void Kleo::CryptoConfigDialog::slotCancel()
00067 {
00068 mMainWidget->cancel();
00069 reject();
00070 }
00071
00072 void Kleo::CryptoConfigDialog::slotDefault()
00073 {
00074 mMainWidget->defaults();
00075 slotChanged();
00076 }
00077
00078 void Kleo::CryptoConfigDialog::slotApply()
00079 {
00080 mMainWidget->save();
00081 enableButton( Apply, false );
00082 }
00083
00084 void Kleo::CryptoConfigDialog::slotUser1()
00085 {
00086 mMainWidget->reset();
00087 enableButton( Apply, false );
00088 }
00089
00090 void Kleo::CryptoConfigDialog::slotChanged()
00091 {
00092 enableButton( Apply, true );
00093 }
00094
00095 #include "cryptoconfigdialog.moc"