certmanager/lib

directoryserviceswidgetbase.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './directoryserviceswidgetbase.ui'
00005 **
00006 ** Created: Thu Mar 29 05:49:13 2007
00007 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.8   edited Jan 11 14:47 $)
00008 **
00009 ** WARNING! All changes made in this file will be lost!
00010 ****************************************************************************/
00011 
00012 #include "directoryserviceswidgetbase.h"
00013 
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qlabel.h>
00017 #include <qheader.h>
00018 #include <qlistview.h>
00019 #include <qtoolbutton.h>
00020 #include <qlayout.h>
00021 #include <qtooltip.h>
00022 #include <qwhatsthis.h>
00023 
00024 /*
00025  *  Constructs a DirectoryServicesWidgetBase as a child of 'parent', with the
00026  *  name 'name' and widget flags set to 'f'.
00027  */
00028 DirectoryServicesWidgetBase::DirectoryServicesWidgetBase( QWidget* parent, const char* name, WFlags fl )
00029     : QWidget( parent, name, fl )
00030 {
00031     if ( !name )
00032     setName( "DirectoryServicesWidgetBase" );
00033     DirectoryServicesWidgetBaseLayout = new QVBoxLayout( this, 11, 6, "DirectoryServicesWidgetBaseLayout"); 
00034 
00035     x500LA = new QLabel( this, "x500LA" );
00036     x500LA->setFrameShape( QLabel::NoFrame );
00037     x500LA->setFrameShadow( QLabel::Plain );
00038     DirectoryServicesWidgetBaseLayout->addWidget( x500LA );
00039 
00040     layout2 = new QHBoxLayout( 0, 0, 6, "layout2"); 
00041 
00042     x500LV = new QListView( this, "x500LV" );
00043     x500LV->addColumn( tr2i18n( "Server Name" ) );
00044     x500LV->addColumn( tr2i18n( "Port" ) );
00045     x500LV->addColumn( tr2i18n( "Base DN" ) );
00046     x500LV->addColumn( tr2i18n( "User Name" ) );
00047     x500LV->addColumn( tr2i18n( "Password" ) );
00048     x500LV->setAllColumnsShowFocus( TRUE );
00049     layout2->addWidget( x500LV );
00050 
00051     layout1 = new QVBoxLayout( 0, 0, 6, "layout1"); 
00052 
00053     upButton = new QToolButton( this, "upButton" );
00054     layout1->addWidget( upButton );
00055 
00056     downButton = new QToolButton( this, "downButton" );
00057     layout1->addWidget( downButton );
00058     spacer5 = new QSpacerItem( 20, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
00059     layout1->addItem( spacer5 );
00060     layout2->addLayout( layout1 );
00061     DirectoryServicesWidgetBaseLayout->addLayout( layout2 );
00062 
00063     layout3 = new QHBoxLayout( 0, 0, 6, "layout3"); 
00064     Spacer10 = new QSpacerItem( 47, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00065     layout3->addItem( Spacer10 );
00066 
00067     addServicePB = new QPushButton( this, "addServicePB" );
00068     layout3->addWidget( addServicePB );
00069     Spacer11 = new QSpacerItem( 47, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00070     layout3->addItem( Spacer11 );
00071 
00072     removeServicePB = new QPushButton( this, "removeServicePB" );
00073     removeServicePB->setEnabled( FALSE );
00074     layout3->addWidget( removeServicePB );
00075     Spacer12 = new QSpacerItem( 47, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00076     layout3->addItem( Spacer12 );
00077     DirectoryServicesWidgetBaseLayout->addLayout( layout3 );
00078     Spacer9 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
00079     DirectoryServicesWidgetBaseLayout->addItem( Spacer9 );
00080     languageChange();
00081     resize( QSize(576, 363).expandedTo(minimumSizeHint()) );
00082     clearWState( WState_Polished );
00083 
00084     // signals and slots connections
00085     connect( removeServicePB, SIGNAL( clicked() ), this, SLOT( slotDeleteService() ) );
00086     connect( x500LV, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( slotServiceSelected(QListViewItem*) ) );
00087     connect( x500LV, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( slotServiceSelected(QListViewItem*) ) );
00088     connect( x500LV, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( slotServiceChanged(QListViewItem*) ) );
00089     connect( addServicePB, SIGNAL( clicked() ), this, SLOT( slotAddService() ) );
00090     connect( upButton, SIGNAL( clicked() ), this, SLOT( slotMoveUp() ) );
00091     connect( downButton, SIGNAL( clicked() ), this, SLOT( slotMoveDown() ) );
00092 
00093     // buddies
00094     x500LA->setBuddy( x500LV );
00095 }
00096 
00097 /*
00098  *  Destroys the object and frees any allocated resources
00099  */
00100 DirectoryServicesWidgetBase::~DirectoryServicesWidgetBase()
00101 {
00102     // no need to delete child widgets, Qt does it all for us
00103 }
00104 
00105 /*
00106  *  Sets the strings of the subwidgets using the current
00107  *  language.
00108  */
00109 void DirectoryServicesWidgetBase::languageChange()
00110 {
00111     setCaption( tr2i18n( "Directory Services Configuration" ) );
00112     x500LA->setText( tr2i18n( "X.&500 directory services:" ) );
00113     x500LV->header()->setLabel( 0, tr2i18n( "Server Name" ) );
00114     x500LV->header()->setLabel( 1, tr2i18n( "Port" ) );
00115     x500LV->header()->setLabel( 2, tr2i18n( "Base DN" ) );
00116     x500LV->header()->setLabel( 3, tr2i18n( "User Name" ) );
00117     x500LV->header()->setLabel( 4, tr2i18n( "Password" ) );
00118     QToolTip::add( x500LV, tr2i18n( "Select Directory Services to Use Here" ) );
00119     QWhatsThis::add( x500LV, tr2i18n( "<qt>\n"
00120 "<h1>X.500 Directory Services</h1>\n"
00121 "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"
00122 "<p>\n"
00123 "If you do not use a directory service, you can still use local certificates.\n"
00124 "</qt>" ) );
00125     upButton->setText( QString::null );
00126     downButton->setText( QString::null );
00127     addServicePB->setText( tr2i18n( "&Add Service..." ) );
00128     QToolTip::add( addServicePB, tr2i18n( "Click to add a service" ) );
00129     QWhatsThis::add( addServicePB, tr2i18n( "<qt>\n"
00130 "<h1>Add a Directory Service</h1>\n"
00131 "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"
00132 "</qt>" ) );
00133     removeServicePB->setText( tr2i18n( "&Remove Service" ) );
00134     QToolTip::add( removeServicePB, tr2i18n( "Click to remove the currently selected service" ) );
00135     QWhatsThis::add( removeServicePB, tr2i18n( "<qt>\n"
00136 "<h1>Remove Directory Service</h1>\n"
00137 "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"
00138 "</qt>" ) );
00139 }
00140 
00141 void DirectoryServicesWidgetBase::slotAddService()
00142 {
00143     qWarning( "DirectoryServicesWidgetBase::slotAddService(): Not implemented yet" );
00144 }
00145 
00146 void DirectoryServicesWidgetBase::slotDeleteService()
00147 {
00148     qWarning( "DirectoryServicesWidgetBase::slotDeleteService(): Not implemented yet" );
00149 }
00150 
00151 void DirectoryServicesWidgetBase::slotServiceChanged(QListViewItem*)
00152 {
00153     qWarning( "DirectoryServicesWidgetBase::slotServiceChanged(QListViewItem*): Not implemented yet" );
00154 }
00155 
00156 void DirectoryServicesWidgetBase::slotServiceSelected(QListViewItem*)
00157 {
00158     qWarning( "DirectoryServicesWidgetBase::slotServiceSelected(QListViewItem*): Not implemented yet" );
00159 }
00160 
00161 void DirectoryServicesWidgetBase::slotMoveUp()
00162 {
00163     qWarning( "DirectoryServicesWidgetBase::slotMoveUp(): Not implemented yet" );
00164 }
00165 
00166 void DirectoryServicesWidgetBase::slotMoveDown()
00167 {
00168     qWarning( "DirectoryServicesWidgetBase::slotMoveDown(): Not implemented yet" );
00169 }
00170 
00171 #include "directoryserviceswidgetbase.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys