kpilot/kpilot

dbSelection_base.cc

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './dbSelection_base.ui'
00005 **
00006 ** Created: Sat Oct 29 17:45:45 2011
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "dbSelection_base.h"
00012 
00013 #include <qvariant.h>
00014 #include <klistview.h>
00015 #include <kpushbutton.h>
00016 #include <klineedit.h>
00017 #include <qheader.h>
00018 #include <qlayout.h>
00019 #include <qtooltip.h>
00020 #include <qwhatsthis.h>
00021 
00022 /*
00023  *  Constructs a KPilotDBSelectionWidget as a child of 'parent', with the
00024  *  name 'name' and widget flags set to 'f'.
00025  */
00026 KPilotDBSelectionWidget::KPilotDBSelectionWidget( QWidget* parent, const char* name, WFlags fl )
00027     : QWidget( parent, name, fl )
00028 {
00029     if ( !name )
00030     setName( "DBSelectionWidgetForm" );
00031     DBSelectionWidgetFormLayout = new QGridLayout( this, 1, 1, 11, 6, "DBSelectionWidgetFormLayout"); 
00032 
00033     fDatabaseList = new KListView( this, "fDatabaseList" );
00034     fDatabaseList->addColumn( tr2i18n( "Database" ) );
00035     fDatabaseList->setResizeMode( KListView::LastColumn );
00036     fDatabaseList->setItemsRenameable( TRUE );
00037 
00038     DBSelectionWidgetFormLayout->addMultiCellWidget( fDatabaseList, 0, 0, 0, 2 );
00039 
00040     fRemoveButton = new KPushButton( this, "fRemoveButton" );
00041 
00042     DBSelectionWidgetFormLayout->addWidget( fRemoveButton, 1, 2 );
00043 
00044     fNameEdit = new KLineEdit( this, "fNameEdit" );
00045 
00046     DBSelectionWidgetFormLayout->addWidget( fNameEdit, 1, 0 );
00047 
00048     fAddButton = new KPushButton( this, "fAddButton" );
00049 
00050     DBSelectionWidgetFormLayout->addWidget( fAddButton, 1, 1 );
00051     languageChange();
00052     resize( QSize(318, 218).expandedTo(minimumSizeHint()) );
00053     clearWState( WState_Polished );
00054 
00055     // signals and slots connections
00056     connect( fNameEdit, SIGNAL( returnPressed() ), fAddButton, SLOT( animateClick() ) );
00057 }
00058 
00059 /*
00060  *  Destroys the object and frees any allocated resources
00061  */
00062 KPilotDBSelectionWidget::~KPilotDBSelectionWidget()
00063 {
00064     // no need to delete child widgets, Qt does it all for us
00065 }
00066 
00067 /*
00068  *  Sets the strings of the subwidgets using the current
00069  *  language.
00070  */
00071 void KPilotDBSelectionWidget::languageChange()
00072 {
00073     fDatabaseList->header()->setLabel( 0, tr2i18n( "Database" ) );
00074     fRemoveButton->setText( tr2i18n( "&Remove" ) );
00075     fAddButton->setText( tr2i18n( "&Add" ) );
00076 }
00077 
00078 #include "dbSelection_base.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys