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 Mar 29 05:50:44 2007
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 <qpushbutton.h>
00019 #include <qlabel.h>
00020 #include <qlineedit.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     mSaveAs = new QPushButton( this, "mSaveAs" );
00077     mSaveAs->setEnabled( FALSE );
00078 
00079     AddressPickerUILayout->addWidget( mSaveAs, 2, 2 );
00080 
00081     textLabel2 = new QLabel( this, "textLabel2" );
00082     QFont textLabel2_font(  textLabel2->font() );
00083     textLabel2_font.setBold( TRUE );
00084     textLabel2->setFont( textLabel2_font ); 
00085     textLabel2->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
00086 
00087     AddressPickerUILayout->addWidget( textLabel2, 0, 2 );
00088 
00089     textLabel1 = new QLabel( this, "textLabel1" );
00090     QFont textLabel1_font(  textLabel1->font() );
00091     textLabel1_font.setBold( TRUE );
00092     textLabel1->setFont( textLabel1_font ); 
00093     textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
00094 
00095     AddressPickerUILayout->addWidget( textLabel1, 0, 0 );
00096 
00097     layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); 
00098 
00099     TextLabel2 = new QLabel( this, "TextLabel2" );
00100     layout1->addWidget( TextLabel2 );
00101 
00102     mFilterEdit = new QLineEdit( this, "mFilterEdit" );
00103     mFilterEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 1, 0, mFilterEdit->sizePolicy().hasHeightForWidth() ) );
00104     layout1->addWidget( mFilterEdit );
00105 
00106     AddressPickerUILayout->addLayout( layout1, 2, 0 );
00107 
00108     mSelectedView = new KListView( this, "mSelectedView" );
00109     mSelectedView->addColumn( tr2i18n( "Name" ) );
00110     mSelectedView->addColumn( tr2i18n( "Email Address" ) );
00111     mSelectedView->setProperty( "selectionMode", "Extended" );
00112     mSelectedView->setAllColumnsShowFocus( TRUE );
00113     mSelectedView->setShowSortIndicator( TRUE );
00114     mSelectedView->setRootIsDecorated( TRUE );
00115     mSelectedView->setResizeMode( KListView::AllColumns );
00116     mSelectedView->setFullWidth( TRUE );
00117 
00118     AddressPickerUILayout->addWidget( mSelectedView, 1, 2 );
00119     languageChange();
00120     resize( QSize(591, 350).expandedTo(minimumSizeHint()) );
00121     clearWState( WState_Polished );
00122 
00123     // buddies
00124     textLabel2->setBuddy( mSelectedView );
00125     textLabel1->setBuddy( mAvailableView );
00126     TextLabel2->setBuddy( mFilterEdit );
00127 }
00128 
00129 /*
00130  *  Destroys the object and frees any allocated resources
00131  */
00132 AddressPickerUI::~AddressPickerUI()
00133 {
00134     // no need to delete child widgets, Qt does it all for us
00135 }
00136 
00137 /*
00138  *  Sets the strings of the subwidgets using the current
00139  *  language.
00140  */
00141 void AddressPickerUI::languageChange()
00142 {
00143     setCaption( tr2i18n( "Address Selection" ) );
00144     mAvailableView->header()->setLabel( 0, tr2i18n( "Name" ) );
00145     mAvailableView->header()->setLabel( 1, tr2i18n( "Email Address" ) );
00146     mToButton->setText( tr2i18n( "&To >>" ) );
00147     mCCButton->setText( tr2i18n( "&CC >>" ) );
00148     mBCCButton->setText( tr2i18n( "&BCC >>" ) );
00149     mRemoveButton->setText( tr2i18n( "<< &Remove" ) );
00150     mSaveAs->setText( tr2i18n( "Save as &Distribution List..." ) );
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 }
00158 
00159 #include "addresspicker.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys