kaddressbook

imeditorbase.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './imeditorbase.ui'
00005 **
00006 ** Created: Tue Apr 28 13:21:57 2009
00007 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.7   edited Aug 31 2005 $)
00008 **
00009 ** WARNING! All changes made in this file will be lost!
00010 ****************************************************************************/
00011 
00012 #include "imeditorbase.h"
00013 
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <kpushbutton.h>
00017 #include <qheader.h>
00018 #include <klistview.h>
00019 #include <kactivelabel.h>
00020 #include <qlayout.h>
00021 #include <qtooltip.h>
00022 #include <qwhatsthis.h>
00023 
00024 /*
00025  *  Constructs a IMEditorBase as a child of 'parent', with the
00026  *  name 'name' and widget flags set to 'f'.
00027  */
00028 IMEditorBase::IMEditorBase( QWidget* parent, const char* name, WFlags fl )
00029     : QWidget( parent, name, fl )
00030 {
00031     if ( !name )
00032     setName( "IMEditorBase" );
00033     setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
00034     IMEditorBaseLayout = new QGridLayout( this, 1, 1, 0, KDialog::spacingHint(), "IMEditorBaseLayout"); 
00035     spacer1 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
00036     IMEditorBaseLayout->addItem( spacer1, 4, 1 );
00037 
00038     btnSetStandard = new QPushButton( this, "btnSetStandard" );
00039 
00040     IMEditorBaseLayout->addWidget( btnSetStandard, 3, 1 );
00041 
00042     btnDelete = new KPushButton( this, "btnDelete" );
00043 
00044     IMEditorBaseLayout->addWidget( btnDelete, 2, 1 );
00045 
00046     btnEdit = new KPushButton( this, "btnEdit" );
00047 
00048     IMEditorBaseLayout->addWidget( btnEdit, 1, 1 );
00049 
00050     btnAdd = new KPushButton( this, "btnAdd" );
00051 
00052     IMEditorBaseLayout->addWidget( btnAdd, 0, 1 );
00053 
00054     lvAddresses = new KListView( this, "lvAddresses" );
00055     lvAddresses->addColumn( tr2i18n( "Protocol" ) );
00056     lvAddresses->addColumn( tr2i18n( "Address" ) );
00057     lvAddresses->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)3, 1, 0, lvAddresses->sizePolicy().hasHeightForWidth() ) );
00058     lvAddresses->setMinimumSize( QSize( 200, 28 ) );
00059     lvAddresses->setProperty( "selectionMode", "Extended" );
00060     lvAddresses->setAllColumnsShowFocus( TRUE );
00061     lvAddresses->setFullWidth( TRUE );
00062 
00063     IMEditorBaseLayout->addMultiCellWidget( lvAddresses, 0, 4, 0, 0 );
00064 
00065     lblWarning = new KActiveLabel( this, "lblWarning" );
00066     lblWarning->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, lblWarning->sizePolicy().hasHeightForWidth() ) );
00067 
00068     IMEditorBaseLayout->addMultiCellWidget( lblWarning, 5, 5, 0, 1 );
00069     languageChange();
00070     resize( QSize(442, 247).expandedTo(minimumSizeHint()) );
00071     clearWState( WState_Polished );
00072 }
00073 
00074 /*
00075  *  Destroys the object and frees any allocated resources
00076  */
00077 IMEditorBase::~IMEditorBase()
00078 {
00079     // no need to delete child widgets, Qt does it all for us
00080 }
00081 
00082 /*
00083  *  Sets the strings of the subwidgets using the current
00084  *  language.
00085  */
00086 void IMEditorBase::languageChange()
00087 {
00088     setCaption( tr2i18n( "IM Addresses" ) );
00089     btnSetStandard->setText( tr2i18n( "&Set Standard" ) );
00090     QToolTip::add( btnSetStandard, tr2i18n( "The IM Address that is set as the standard is the address that is shown in main editor window." ) );
00091     QWhatsThis::add( btnSetStandard, tr2i18n( "<qt>Only one IM Address can be set as the standard IM Address.<br>The standard IM Address is shown in the main editor window, and other programs may use this as hint for deciding which IM Address to show.</qt>" ) );
00092     btnDelete->setText( tr2i18n( "&Remove" ) );
00093     btnEdit->setText( tr2i18n( "&Edit..." ) );
00094     btnAdd->setText( tr2i18n( "&Add..." ) );
00095     lvAddresses->header()->setLabel( 0, tr2i18n( "Protocol" ) );
00096     lvAddresses->header()->setLabel( 1, tr2i18n( "Address" ) );
00097     lblWarning->setText( tr2i18n( "<em>Note:</em> Please read the help page before adding or editing Instant Messenging Addresses here." ) );
00098 }
00099 
00100 #include "imeditorbase.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys