KDevelop API Documentation

languages/sql/sqlconfigwidget.cpp

Go to the documentation of this file.
00001 #include <kdialog.h> 00002 #include <klocale.h> 00003 /**************************************************************************** 00004 ** Form implementation generated from reading ui file './sqlconfigwidget.ui' 00005 ** 00006 ** Created: Tue Oct 19 07:57:08 2004 00007 ** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.3 edited Nov 24 2003 $) 00008 ** 00009 ** WARNING! All changes made in this file will be lost! 00010 ****************************************************************************/ 00011 00012 #include "sqlconfigwidget.h" 00013 00014 #include <qvariant.h> 00015 #include <qtable.h> 00016 #include <qlabel.h> 00017 #include <kpushbutton.h> 00018 #include <qlayout.h> 00019 #include <qtooltip.h> 00020 #include <qwhatsthis.h> 00021 #include <qimage.h> 00022 #include <qpixmap.h> 00023 00024 #include "./sqlconfigwidget.ui.h" 00025 00026 /* 00027 * Constructs a SqlConfigWidget as a child of 'parent', with the 00028 * name 'name' and widget flags set to 'f'. 00029 */ 00030 SqlConfigWidget::SqlConfigWidget( QWidget* parent, const char* name, WFlags fl ) 00031 : QWidget( parent, name, fl ) 00032 { 00033 if ( !name ) 00034 setName( "SqlConfigWidget" ); 00035 SqlConfigWidgetLayout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint(), "SqlConfigWidgetLayout"); 00036 00037 dbTable = new QTable( this, "dbTable" ); 00038 dbTable->setNumCols( dbTable->numCols() + 1 ); 00039 dbTable->horizontalHeader()->setLabel( dbTable->numCols() - 1, tr2i18n( "Plugin" ) ); 00040 dbTable->setNumCols( dbTable->numCols() + 1 ); 00041 dbTable->horizontalHeader()->setLabel( dbTable->numCols() - 1, tr2i18n( "Database Name" ) ); 00042 dbTable->setNumCols( dbTable->numCols() + 1 ); 00043 dbTable->horizontalHeader()->setLabel( dbTable->numCols() - 1, tr2i18n( "Host" ) ); 00044 dbTable->setNumCols( dbTable->numCols() + 1 ); 00045 dbTable->horizontalHeader()->setLabel( dbTable->numCols() - 1, tr2i18n( "Port" ) ); 00046 dbTable->setNumCols( dbTable->numCols() + 1 ); 00047 dbTable->horizontalHeader()->setLabel( dbTable->numCols() - 1, tr2i18n( "Username" ) ); 00048 dbTable->setNumCols( dbTable->numCols() + 1 ); 00049 dbTable->horizontalHeader()->setLabel( dbTable->numCols() - 1, tr2i18n( "Password" ) ); 00050 dbTable->setNumRows( 0 ); 00051 dbTable->setNumCols( 6 ); 00052 dbTable->setSelectionMode( QTable::SingleRow ); 00053 SqlConfigWidgetLayout->addWidget( dbTable ); 00054 00055 textLabel1 = new QLabel( this, "textLabel1" ); 00056 SqlConfigWidgetLayout->addWidget( textLabel1 ); 00057 00058 layout5 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "layout5"); 00059 spacer4 = new QSpacerItem( 81, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); 00060 layout5->addItem( spacer4 ); 00061 00062 removeBtn = new KPushButton( this, "removeBtn" ); 00063 layout5->addWidget( removeBtn ); 00064 00065 testBtn = new KPushButton( this, "testBtn" ); 00066 layout5->addWidget( testBtn ); 00067 SqlConfigWidgetLayout->addLayout( layout5 ); 00068 languageChange(); 00069 resize( QSize(578, 367).expandedTo(minimumSizeHint()) ); 00070 clearWState( WState_Polished ); 00071 00072 // signals and slots connections 00073 connect( dbTable, SIGNAL( valueChanged(int,int) ), this, SLOT( valueChanged(int,int) ) ); 00074 connect( removeBtn, SIGNAL( clicked() ), this, SLOT( removeDb() ) ); 00075 connect( testBtn, SIGNAL( clicked() ), this, SLOT( testDb() ) ); 00076 connect( dbTable, SIGNAL( currentChanged(int,int) ), this, SLOT( updateButtons() ) ); 00077 init(); 00078 } 00079 00080 /* 00081 * Destroys the object and frees any allocated resources 00082 */ 00083 SqlConfigWidget::~SqlConfigWidget() 00084 { 00085 // no need to delete child widgets, Qt does it all for us 00086 } 00087 00088 /* 00089 * Sets the strings of the subwidgets using the current 00090 * language. 00091 */ 00092 void SqlConfigWidget::languageChange() 00093 { 00094 setCaption( tr2i18n( "Form2" ) ); 00095 dbTable->horizontalHeader()->setLabel( 0, tr2i18n( "Plugin" ) ); 00096 dbTable->horizontalHeader()->setLabel( 1, tr2i18n( "Database Name" ) ); 00097 dbTable->horizontalHeader()->setLabel( 2, tr2i18n( "Host" ) ); 00098 dbTable->horizontalHeader()->setLabel( 3, tr2i18n( "Port" ) ); 00099 dbTable->horizontalHeader()->setLabel( 4, tr2i18n( "Username" ) ); 00100 dbTable->horizontalHeader()->setLabel( 5, tr2i18n( "Password" ) ); 00101 textLabel1->setText( tr2i18n( "<i>Warning</i>: Password will be saved with weak encryption!" ) ); 00102 removeBtn->setText( tr2i18n( "&Remove" ) ); 00103 testBtn->setText( tr2i18n( "&Test" ) ); 00104 } 00105 00106 #include "sqlconfigwidget.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:01:46 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003