00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "directoryserviceswidgetbase.h"
00012
00013 #include <qvariant.h>
00014 #include <qpushbutton.h>
00015 #include <qlabel.h>
00016 #include <qheader.h>
00017 #include <qlistview.h>
00018 #include <qtoolbutton.h>
00019 #include <qlayout.h>
00020 #include <qtooltip.h>
00021 #include <qwhatsthis.h>
00022
00023
00024
00025
00026
00027 DirectoryServicesWidgetBase::DirectoryServicesWidgetBase( QWidget* parent, const char* name, WFlags fl )
00028 : QWidget( parent, name, fl )
00029 {
00030 if ( !name )
00031 setName( "DirectoryServicesWidgetBase" );
00032 DirectoryServicesWidgetBaseLayout = new QVBoxLayout( this, 11, 6, "DirectoryServicesWidgetBaseLayout");
00033
00034 x500LA = new QLabel( this, "x500LA" );
00035 x500LA->setFrameShape( QLabel::NoFrame );
00036 x500LA->setFrameShadow( QLabel::Plain );
00037 DirectoryServicesWidgetBaseLayout->addWidget( x500LA );
00038
00039 layout2 = new QHBoxLayout( 0, 0, 6, "layout2");
00040
00041 x500LV = new QListView( this, "x500LV" );
00042 x500LV->addColumn( tr2i18n( "Server Name" ) );
00043 x500LV->addColumn( tr2i18n( "Port" ) );
00044 x500LV->addColumn( tr2i18n( "Base DN" ) );
00045 x500LV->addColumn( tr2i18n( "User Name" ) );
00046 x500LV->addColumn( tr2i18n( "Password" ) );
00047 x500LV->setAllColumnsShowFocus( TRUE );
00048 layout2->addWidget( x500LV );
00049
00050 layout1 = new QVBoxLayout( 0, 0, 6, "layout1");
00051
00052 upButton = new QToolButton( this, "upButton" );
00053 layout1->addWidget( upButton );
00054
00055 downButton = new QToolButton( this, "downButton" );
00056 layout1->addWidget( downButton );
00057 spacer5 = new QSpacerItem( 20, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
00058 layout1->addItem( spacer5 );
00059 layout2->addLayout( layout1 );
00060 DirectoryServicesWidgetBaseLayout->addLayout( layout2 );
00061
00062 layout3 = new QHBoxLayout( 0, 0, 6, "layout3");
00063 Spacer10 = new QSpacerItem( 47, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00064 layout3->addItem( Spacer10 );
00065
00066 addServicePB = new QPushButton( this, "addServicePB" );
00067 layout3->addWidget( addServicePB );
00068 Spacer11 = new QSpacerItem( 47, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00069 layout3->addItem( Spacer11 );
00070
00071 removeServicePB = new QPushButton( this, "removeServicePB" );
00072 removeServicePB->setEnabled( FALSE );
00073 layout3->addWidget( removeServicePB );
00074 Spacer12 = new QSpacerItem( 47, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00075 layout3->addItem( Spacer12 );
00076 DirectoryServicesWidgetBaseLayout->addLayout( layout3 );
00077 Spacer9 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
00078 DirectoryServicesWidgetBaseLayout->addItem( Spacer9 );
00079 languageChange();
00080 resize( QSize(576, 363).expandedTo(minimumSizeHint()) );
00081 clearWState( WState_Polished );
00082
00083
00084 connect( removeServicePB, SIGNAL( clicked() ), this, SLOT( slotDeleteService() ) );
00085 connect( x500LV, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( slotServiceSelected(QListViewItem*) ) );
00086 connect( x500LV, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( slotServiceSelected(QListViewItem*) ) );
00087 connect( x500LV, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( slotServiceChanged(QListViewItem*) ) );
00088 connect( addServicePB, SIGNAL( clicked() ), this, SLOT( slotAddService() ) );
00089 connect( upButton, SIGNAL( clicked() ), this, SLOT( slotMoveUp() ) );
00090 connect( downButton, SIGNAL( clicked() ), this, SLOT( slotMoveDown() ) );
00091
00092
00093 x500LA->setBuddy( x500LV );
00094 }
00095
00096
00097
00098
00099 DirectoryServicesWidgetBase::~DirectoryServicesWidgetBase()
00100 {
00101
00102 }
00103
00104
00105
00106
00107
00108 void DirectoryServicesWidgetBase::languageChange()
00109 {
00110 setCaption( tr2i18n( "Directory Services Configuration" ) );
00111 x500LA->setText( tr2i18n( "X.&500 directory services:" ) );
00112 x500LV->header()->setLabel( 0, tr2i18n( "Server Name" ) );
00113 x500LV->header()->setLabel( 1, tr2i18n( "Port" ) );
00114 x500LV->header()->setLabel( 2, tr2i18n( "Base DN" ) );
00115 x500LV->header()->setLabel( 3, tr2i18n( "User Name" ) );
00116 x500LV->header()->setLabel( 4, tr2i18n( "Password" ) );
00117 QToolTip::add( x500LV, tr2i18n( "Select Directory Services to Use Here" ) );
00118 QWhatsThis::add( x500LV, tr2i18n( "<qt>\n"
00119 "<h1>X.500 Directory Services</h1>\n"
00120 "You can use X.500 directory services to retrieve certificates and certificate revocation lists that are not saved locally. Ask your local administrator if you want to make use of this feature and are unsure which directory service you can use.\n"
00121 "<p>\n"
00122 "If you do not use a directory service, you can still use local certificates.\n"
00123 "</qt>" ) );
00124 upButton->setText( QString::null );
00125 downButton->setText( QString::null );
00126 addServicePB->setText( tr2i18n( "&Add Service..." ) );
00127 QToolTip::add( addServicePB, tr2i18n( "Click to add a service" ) );
00128 QWhatsThis::add( addServicePB, tr2i18n( "<qt>\n"
00129 "<h1>Add a Directory Service</h1>\n"
00130 "By clicking this button, you can select a new directory service to be used for retrieving certificates and CRLs. You will be asked for the server name and an optional description.\n"
00131 "</qt>" ) );
00132 removeServicePB->setText( tr2i18n( "&Remove Service" ) );
00133 QToolTip::add( removeServicePB, tr2i18n( "Click to remove the currently selected service" ) );
00134 QWhatsThis::add( removeServicePB, tr2i18n( "<qt>\n"
00135 "<h1>Remove Directory Service</h1>\n"
00136 "By clicking this button, you can remove the currently selected directory service in the list above. You will have a chance to rethink your decision before the entry is deleted from the list.\n"
00137 "</qt>" ) );
00138 }
00139
00140 void DirectoryServicesWidgetBase::slotAddService()
00141 {
00142 qWarning( "DirectoryServicesWidgetBase::slotAddService(): Not implemented yet" );
00143 }
00144
00145 void DirectoryServicesWidgetBase::slotDeleteService()
00146 {
00147 qWarning( "DirectoryServicesWidgetBase::slotDeleteService(): Not implemented yet" );
00148 }
00149
00150 void DirectoryServicesWidgetBase::slotServiceChanged(QListViewItem*)
00151 {
00152 qWarning( "DirectoryServicesWidgetBase::slotServiceChanged(QListViewItem*): Not implemented yet" );
00153 }
00154
00155 void DirectoryServicesWidgetBase::slotServiceSelected(QListViewItem*)
00156 {
00157 qWarning( "DirectoryServicesWidgetBase::slotServiceSelected(QListViewItem*): Not implemented yet" );
00158 }
00159
00160 void DirectoryServicesWidgetBase::slotMoveUp()
00161 {
00162 qWarning( "DirectoryServicesWidgetBase::slotMoveUp(): Not implemented yet" );
00163 }
00164
00165 void DirectoryServicesWidgetBase::slotMoveDown()
00166 {
00167 qWarning( "DirectoryServicesWidgetBase::slotMoveDown(): Not implemented yet" );
00168 }
00169
00170 #include "directoryserviceswidgetbase.moc"