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