00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
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 #include "kpushbutton.h"
00023 #include "klistview.h"
00024 #include "kactivelabel.h"
00025
00026
00027
00028
00029
00030 IMEditorBase::IMEditorBase( QWidget* parent, const char* name, WFlags fl )
00031 : QWidget( parent, name, fl )
00032 {
00033 if ( !name )
00034 setName( "IMEditorBase" );
00035 setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
00036 IMEditorBaseLayout = new QGridLayout( this, 1, 1, 0, KDialog::spacingHint(), "IMEditorBaseLayout");
00037 spacer1 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
00038 IMEditorBaseLayout->addItem( spacer1, 4, 1 );
00039
00040 btnSetStandard = new QPushButton( this, "btnSetStandard" );
00041
00042 IMEditorBaseLayout->addWidget( btnSetStandard, 3, 1 );
00043
00044 btnDelete = new KPushButton( this, "btnDelete" );
00045
00046 IMEditorBaseLayout->addWidget( btnDelete, 2, 1 );
00047
00048 btnEdit = new KPushButton( this, "btnEdit" );
00049
00050 IMEditorBaseLayout->addWidget( btnEdit, 1, 1 );
00051
00052 btnAdd = new KPushButton( this, "btnAdd" );
00053
00054 IMEditorBaseLayout->addWidget( btnAdd, 0, 1 );
00055
00056 lvAddresses = new KListView( this, "lvAddresses" );
00057 lvAddresses->addColumn( tr2i18n( "Protocol" ) );
00058 lvAddresses->addColumn( tr2i18n( "Address" ) );
00059 lvAddresses->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)3, 1, 0, lvAddresses->sizePolicy().hasHeightForWidth() ) );
00060 lvAddresses->setMinimumSize( QSize( 200, 28 ) );
00061 lvAddresses->setProperty( "selectionMode", "Extended" );
00062 lvAddresses->setAllColumnsShowFocus( TRUE );
00063 lvAddresses->setFullWidth( TRUE );
00064
00065 IMEditorBaseLayout->addMultiCellWidget( lvAddresses, 0, 4, 0, 0 );
00066
00067 lblWarning = new KActiveLabel( this, "lblWarning" );
00068 lblWarning->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, lblWarning->sizePolicy().hasHeightForWidth() ) );
00069
00070 IMEditorBaseLayout->addMultiCellWidget( lblWarning, 5, 5, 0, 1 );
00071 languageChange();
00072 resize( QSize(442, 247).expandedTo(minimumSizeHint()) );
00073 clearWState( WState_Polished );
00074 }
00075
00076
00077
00078
00079 IMEditorBase::~IMEditorBase()
00080 {
00081
00082 }
00083
00084
00085
00086
00087
00088 void IMEditorBase::languageChange()
00089 {
00090 setCaption( tr2i18n( "IM Addresses" ) );
00091 btnSetStandard->setText( tr2i18n( "&Set Standard" ) );
00092 QToolTip::add( btnSetStandard, tr2i18n( "The IM Address that is set as the standard is the address that is shown in main editor window." ) );
00093 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>" ) );
00094 btnDelete->setText( tr2i18n( "&Remove" ) );
00095 btnEdit->setText( tr2i18n( "&Edit..." ) );
00096 btnAdd->setText( tr2i18n( "&Add..." ) );
00097 lvAddresses->header()->setLabel( 0, tr2i18n( "Protocol" ) );
00098 lvAddresses->header()->setLabel( 1, tr2i18n( "Address" ) );
00099 lblWarning->setText( tr2i18n( "<em>Note:</em> Please read the help page before adding or editing Instant Messenging Addresses here." ) );
00100 }
00101
00102 #include "imeditorbase.moc"