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