certmanager/lib

adddirectoryservicedialog.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './adddirectoryservicedialog.ui'
00005 **
00006 ** Created: Fri Sep 9 20:27:38 2011
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "adddirectoryservicedialog.h"
00012 
00013 #include <qvariant.h>
00014 #include <qlabel.h>
00015 #include <qlineedit.h>
00016 #include <qpushbutton.h>
00017 #include <qframe.h>
00018 #include <qlayout.h>
00019 #include <qtooltip.h>
00020 #include <qwhatsthis.h>
00021 
00022 /*
00023  *  Constructs a AddDirectoryServiceDialog as a child of 'parent', with the
00024  *  name 'name' and widget flags set to 'f'.
00025  *
00026  *  The dialog will by default be modeless, unless you set 'modal' to
00027  *  TRUE to construct a modal dialog.
00028  */
00029 AddDirectoryServiceDialog::AddDirectoryServiceDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
00030     : QDialog( parent, name, modal, fl )
00031 {
00032     if ( !name )
00033     setName( "AddDirectoryServiceDialog" );
00034     AddDirectoryServiceDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "AddDirectoryServiceDialogLayout"); 
00035 
00036     serverNameLA = new QLabel( this, "serverNameLA" );
00037 
00038     AddDirectoryServiceDialogLayout->addWidget( serverNameLA, 0, 0 );
00039 
00040     descriptionED = new QLineEdit( this, "descriptionED" );
00041 
00042     AddDirectoryServiceDialogLayout->addMultiCellWidget( descriptionED, 2, 2, 1, 3 );
00043 
00044     portED = new QLineEdit( this, "portED" );
00045 
00046     AddDirectoryServiceDialogLayout->addMultiCellWidget( portED, 1, 1, 1, 3 );
00047 
00048     serverNameED = new QLineEdit( this, "serverNameED" );
00049 
00050     AddDirectoryServiceDialogLayout->addMultiCellWidget( serverNameED, 0, 0, 1, 3 );
00051 
00052     usernameLA = new QLabel( this, "usernameLA" );
00053 
00054     AddDirectoryServiceDialogLayout->addWidget( usernameLA, 3, 0 );
00055     spacer23 = new QSpacerItem( 20, 60, QSizePolicy::Minimum, QSizePolicy::Expanding );
00056     AddDirectoryServiceDialogLayout->addItem( spacer23, 5, 3 );
00057 
00058     passwordLA = new QLabel( this, "passwordLA" );
00059 
00060     AddDirectoryServiceDialogLayout->addWidget( passwordLA, 4, 0 );
00061 
00062     PushButton3 = new QPushButton( this, "PushButton3" );
00063     PushButton3->setDefault( TRUE );
00064 
00065     AddDirectoryServiceDialogLayout->addWidget( PushButton3, 8, 2 );
00066 
00067     PushButton4 = new QPushButton( this, "PushButton4" );
00068 
00069     AddDirectoryServiceDialogLayout->addWidget( PushButton4, 8, 3 );
00070 
00071     line1 = new QFrame( this, "line1" );
00072     line1->setFrameShape( QFrame::HLine );
00073     line1->setFrameShadow( QFrame::Sunken );
00074     line1->setFrameShape( QFrame::HLine );
00075 
00076     AddDirectoryServiceDialogLayout->addMultiCellWidget( line1, 6, 6, 0, 3 );
00077     spacer21 = new QSpacerItem( 260, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00078     AddDirectoryServiceDialogLayout->addMultiCell( spacer21, 7, 8, 0, 1 );
00079 
00080     usernameED = new QLineEdit( this, "usernameED" );
00081 
00082     AddDirectoryServiceDialogLayout->addMultiCellWidget( usernameED, 3, 3, 1, 3 );
00083 
00084     passwordED = new QLineEdit( this, "passwordED" );
00085     passwordED->setEchoMode( QLineEdit::Password );
00086 
00087     AddDirectoryServiceDialogLayout->addMultiCellWidget( passwordED, 4, 4, 1, 3 );
00088 
00089     descriptionLA = new QLabel( this, "descriptionLA" );
00090 
00091     AddDirectoryServiceDialogLayout->addWidget( descriptionLA, 2, 0 );
00092 
00093     portLA = new QLabel( this, "portLA" );
00094 
00095     AddDirectoryServiceDialogLayout->addWidget( portLA, 1, 0 );
00096     languageChange();
00097     resize( QSize(389, 257).expandedTo(minimumSizeHint()) );
00098     clearWState( WState_Polished );
00099 
00100     // signals and slots connections
00101     connect( PushButton3, SIGNAL( clicked() ), this, SLOT( accept() ) );
00102     connect( PushButton4, SIGNAL( clicked() ), this, SLOT( reject() ) );
00103 
00104     // tab order
00105     setTabOrder( serverNameED, portED );
00106     setTabOrder( portED, descriptionED );
00107     setTabOrder( descriptionED, usernameED );
00108     setTabOrder( usernameED, passwordED );
00109     setTabOrder( passwordED, PushButton3 );
00110     setTabOrder( PushButton3, PushButton4 );
00111 
00112     // buddies
00113     serverNameLA->setBuddy( serverNameED );
00114     usernameLA->setBuddy( usernameED );
00115     passwordLA->setBuddy( passwordED );
00116     descriptionLA->setBuddy( descriptionED );
00117     portLA->setBuddy( portED );
00118 }
00119 
00120 /*
00121  *  Destroys the object and frees any allocated resources
00122  */
00123 AddDirectoryServiceDialog::~AddDirectoryServiceDialog()
00124 {
00125     // no need to delete child widgets, Qt does it all for us
00126 }
00127 
00128 /*
00129  *  Sets the strings of the subwidgets using the current
00130  *  language.
00131  */
00132 void AddDirectoryServiceDialog::languageChange()
00133 {
00134     setCaption( tr2i18n( "Add or Change Directory Service" ) );
00135     serverNameLA->setText( tr2i18n( "&Server name:" ) );
00136     portED->setText( tr2i18n( "389" ) );
00137     usernameLA->setText( tr2i18n( "&User name (optional):" ) );
00138     passwordLA->setText( tr2i18n( "Pass&word (optional):" ) );
00139     PushButton3->setText( tr2i18n( "&OK" ) );
00140     PushButton4->setText( tr2i18n( "&Cancel" ) );
00141     descriptionLA->setText( tr2i18n( "&Base DN:" ) );
00142     portLA->setText( tr2i18n( "&Port:" ) );
00143 }
00144 
00145 #include "adddirectoryservicedialog.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys