directoryservicesconfigurationdialogimpl.cpp
00001 #include <config.h>
00002 #include "directoryservicesconfigurationdialogimpl.h"
00003 #include "adddirectoryservicedialogimpl.h"
00004 #include "cryptplugwrapper.h"
00005
00006 #include <qlistview.h>
00007 #include <qpushbutton.h>
00008 #include <klineedit.h>
00009 #include <qbuttongroup.h>
00010
00011
00012
00013
00014
00015 DirectoryServicesConfigurationDialogImpl::DirectoryServicesConfigurationDialogImpl( QWidget* parent, const char* name, WFlags fl )
00016 : DirectoryServicesConfigurationDialog( parent, name, fl )
00017 {
00018 x500LV->setSorting( -1 );
00019 }
00020
00021
00022
00023
00024
00025 DirectoryServicesConfigurationDialogImpl::~DirectoryServicesConfigurationDialogImpl()
00026 {
00027
00028 }
00029
00030
00035 void DirectoryServicesConfigurationDialogImpl::enableDisable( CryptPlugWrapper* cryptPlug )
00036 {
00037
00038
00039 setEnabled( cryptPlug->hasFeature( Feature_CertificateDirectoryService ) ||
00040 cryptPlug->hasFeature( Feature_CRLDirectoryService ) );
00041
00042 localRemoteCertBG->setEnabled( cryptPlug->hasFeature( Feature_CertificateDirectoryService ) );
00043 localRemoteCRLBG->setEnabled( cryptPlug->hasFeature( Feature_CRLDirectoryService ) );
00044 }
00045
00046
00047
00048
00049
00050 void DirectoryServicesConfigurationDialogImpl::slotServiceChanged( QListViewItem* item )
00051 {
00052 if( item )
00053 removeServicePB->setEnabled( true );
00054 else
00055 removeServicePB->setEnabled( false );
00056 }
00057
00058
00059
00060
00061
00062 void DirectoryServicesConfigurationDialogImpl::slotServiceSelected( QListViewItem* item )
00063 {
00064 AddDirectoryServiceDialogImpl* dlg = new AddDirectoryServiceDialogImpl( this );
00065 dlg->serverNameED->setText( item->text( 0 ) );
00066 dlg->portED->setText( item->text( 1 ) );
00067 dlg->descriptionED->setText( item->text( 2 ) );
00068 if( dlg->exec() == QDialog::Accepted ) {
00069 item->setText( 0, dlg->serverNameED->text() );
00070 item->setText( 1, dlg->portED->text() );
00071 item->setText( 2, dlg->descriptionED->text() );
00072 }
00073 delete dlg;
00074 }
00075
00076
00077
00078
00079
00080 void DirectoryServicesConfigurationDialogImpl::slotAddService()
00081 {
00082 AddDirectoryServiceDialogImpl* dlg = new AddDirectoryServiceDialogImpl( this );
00083 if( dlg->exec() == QDialog::Accepted ) {
00084 (void)new QListViewItem( x500LV, x500LV->lastItem(),
00085 dlg->serverNameED->text(),
00086 dlg->portED->text(),
00087 dlg->descriptionED->text() );
00088 }
00089 }
00090
00091
00092
00093
00094 void DirectoryServicesConfigurationDialogImpl::slotDeleteService()
00095 {
00096 QListViewItem* item = x500LV->selectedItem();
00097 Q_ASSERT( item );
00098 if( !item )
00099 return;
00100 else
00101 delete item;
00102 x500LV->triggerUpdate();
00103 slotServiceChanged( x500LV->selectedItem() );
00104 }
00105
00106
00107 #include "directoryservicesconfigurationdialogimpl.moc"
This file is part of the documentation for kmail Library Version 3.2.2.