libkdepim

addresspicker.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './addresspicker.ui'
00005 **
00006 ** Created: Sat Aug 23 12:26:13 2008
00007 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.8   edited Jan 11 14:47 $)
00008 **
00009 ** WARNING! All changes made in this file will be lost!
00010 ****************************************************************************/
00011 
00012 #include "addresspicker.h"
00013 
00014 #include <qvariant.h>
00015 #include <qheader.h>
00016 #include <klistview.h>
00017 #include <kpushbutton.h>
00018 #include <qlabel.h>
00019 #include <qlineedit.h>
00020 #include <qpushbutton.h>
00021 #include <qlayout.h>
00022 #include <qtooltip.h>
00023 #include <qwhatsthis.h>
00024 #include "klistview.h"
00025 #include "kpushbutton.h"
00026 
00027 /*
00028  *  Constructs a AddressPickerUI as a child of 'parent', with the
00029  *  name 'name' and widget flags set to 'f'.
00030  */
00031 AddressPickerUI::AddressPickerUI( QWidget* parent, const char* name, WFlags fl )
00032     : QWidget( parent, name, fl )
00033 {
00034     if ( !name )
00035     setName( "AddressPickerUI" );
00036     AddressPickerUILayout = new QGridLayout( this, 1, 1, 11, 6, "AddressPickerUILayout"); 
00037 
00038     mAvailableView = new KListView( this, "mAvailableView" );
00039     mAvailableView->addColumn( tr2i18n( "Name" ) );
00040     mAvailableView->addColumn( tr2i18n( "Email Address" ) );
00041     mAvailableView->setProperty( "selectionMode", "Extended" );
00042     mAvailableView->setAllColumnsShowFocus( TRUE );
00043     mAvailableView->setShowSortIndicator( TRUE );
00044     mAvailableView->setRootIsDecorated( TRUE );
00045     mAvailableView->setResizeMode( KListView::AllColumns );
00046     mAvailableView->setFullWidth( TRUE );
00047 
00048     AddressPickerUILayout->addWidget( mAvailableView, 1, 0 );
00049 
00050     layout10 = new QVBoxLayout( 0, 0, 6, "layout10"); 
00051     spacer1 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
00052     layout10->addItem( spacer1 );
00053 
00054     mToButton = new KPushButton( this, "mToButton" );
00055     mToButton->setEnabled( FALSE );
00056     layout10->addWidget( mToButton );
00057 
00058     mCCButton = new KPushButton( this, "mCCButton" );
00059     mCCButton->setEnabled( FALSE );
00060     layout10->addWidget( mCCButton );
00061 
00062     mBCCButton = new KPushButton( this, "mBCCButton" );
00063     mBCCButton->setEnabled( FALSE );
00064     layout10->addWidget( mBCCButton );
00065     spacer2 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
00066     layout10->addItem( spacer2 );
00067 
00068     mRemoveButton = new KPushButton( this, "mRemoveButton" );
00069     mRemoveButton->setEnabled( FALSE );
00070     layout10->addWidget( mRemoveButton );
00071     spacer2_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00072     layout10->addItem( spacer2_2 );
00073 
00074     AddressPickerUILayout->addLayout( layout10, 1, 1 );
00075 
00076     textLabel2 = new QLabel( this, "textLabel2" );
00077     QFont textLabel2_font(  textLabel2->font() );
00078     textLabel2_font.setBold( TRUE );
00079     textLabel2->setFont( textLabel2_font ); 
00080     textLabel2->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
00081 
00082     AddressPickerUILayout->addWidget( textLabel2, 0, 2 );
00083 
00084     textLabel1 = new QLabel( this, "textLabel1" );
00085     QFont textLabel1_font(  textLabel1->font() );
00086     textLabel1_font.setBold( TRUE );
00087     textLabel1->setFont( textLabel1_font ); 
00088     textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
00089 
00090     AddressPickerUILayout->addWidget( textLabel1, 0, 0 );
00091 
00092     layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); 
00093 
00094     TextLabel2 = new QLabel( this, "TextLabel2" );
00095     layout1->addWidget( TextLabel2 );
00096 
00097     mFilterEdit = new QLineEdit( this, "mFilterEdit" );
00098     mFilterEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 1, 0, mFilterEdit->sizePolicy().hasHeightForWidth() ) );
00099     layout1->addWidget( mFilterEdit );
00100 
00101     AddressPickerUILayout->addLayout( layout1, 2, 0 );
00102 
00103     mSelectedView = new KListView( this, "mSelectedView" );
00104     mSelectedView->addColumn( tr2i18n( "Name" ) );
00105     mSelectedView->addColumn( tr2i18n( "Email Address" ) );
00106     mSelectedView->setProperty( "selectionMode", "Extended" );
00107     mSelectedView->setAllColumnsShowFocus( TRUE );
00108     mSelectedView->setShowSortIndicator( TRUE );
00109     mSelectedView->setRootIsDecorated( TRUE );
00110     mSelectedView->setResizeMode( KListView::AllColumns );
00111     mSelectedView->setFullWidth( TRUE );
00112 
00113     AddressPickerUILayout->addWidget( mSelectedView, 1, 2 );
00114 
00115     mSaveAs = new QPushButton( this, "mSaveAs" );
00116     mSaveAs->setEnabled( FALSE );
00117 
00118     AddressPickerUILayout->addWidget( mSaveAs, 2, 2 );
00119 
00120     mLdapSearch = new QPushButton( this, "mLdapSearch" );
00121 
00122     AddressPickerUILayout->addWidget( mLdapSearch, 3, 0 );
00123     languageChange();
00124     resize( QSize(591, 442).expandedTo(minimumSizeHint()) );
00125     clearWState( WState_Polished );
00126 
00127     // buddies
00128     textLabel2->setBuddy( mSelectedView );
00129     textLabel1->setBuddy( mAvailableView );
00130     TextLabel2->setBuddy( mFilterEdit );
00131 }
00132 
00133 /*
00134  *  Destroys the object and frees any allocated resources
00135  */
00136 AddressPickerUI::~AddressPickerUI()
00137 {
00138     // no need to delete child widgets, Qt does it all for us
00139 }
00140 
00141 /*
00142  *  Sets the strings of the subwidgets using the current
00143  *  language.
00144  */
00145 void AddressPickerUI::languageChange()
00146 {
00147     setCaption( tr2i18n( "Address Selection" ) );
00148     mAvailableView->header()->setLabel( 0, tr2i18n( "Name" ) );
00149     mAvailableView->header()->setLabel( 1, tr2i18n( "Email Address" ) );
00150     mToButton->setText( tr2i18n( "&To >>" ) );
00151     mCCButton->setText( tr2i18n( "&CC >>" ) );
00152     mBCCButton->setText( tr2i18n( "&BCC >>" ) );
00153     mRemoveButton->setText( tr2i18n( "<< &Remove" ) );
00154     textLabel2->setText( tr2i18n( "&Selected Addresses" ) );
00155     textLabel1->setText( tr2i18n( "&Address Book" ) );
00156     TextLabel2->setText( tr2i18n( "&Filter on:" ) );
00157     mFilterEdit->setText( QString::null );
00158     mSelectedView->header()->setLabel( 0, tr2i18n( "Name" ) );
00159     mSelectedView->header()->setLabel( 1, tr2i18n( "Email Address" ) );
00160     mSaveAs->setText( tr2i18n( "Save as &Distribution List..." ) );
00161     mSaveAs->setAccel( QKeySequence( tr2i18n( "Alt+D" ) ) );
00162     mLdapSearch->setText( tr2i18n( "&Search Directory Service" ) );
00163 }
00164 
00165 #include "addresspicker.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys