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