diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kmail/recipientspicker.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/recipientspicker.cpp')
-rw-r--r-- | kmail/recipientspicker.cpp | 208 |
1 files changed, 104 insertions, 104 deletions
diff --git a/kmail/recipientspicker.cpp b/kmail/recipientspicker.cpp index 7f0d8fa36..839898cbf 100644 --- a/kmail/recipientspicker.cpp +++ b/kmail/recipientspicker.cpp @@ -40,11 +40,11 @@ #include <kwin.h> #include <kmessagebox.h> -#include <qlayout.h> -#include <qcombobox.h> -#include <qpushbutton.h> -#include <qtoolbutton.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqcombobox.h> +#include <tqpushbutton.h> +#include <tqtoolbutton.h> +#include <tqlabel.h> #ifdef KDEPIM_NEW_DISTRLISTS RecipientItem::RecipientItem( KABC::AddressBook *ab ) @@ -95,15 +95,15 @@ void RecipientItem::setDistributionList( KABC::DistributionList *list ) #endif void RecipientItem::setAddressee( const KABC::Addressee &a, - const QString &email ) + const TQString &email ) { mAddressee = a; mEmail = email; mRecipient = mAddressee.fullEmail( mEmail ); - QImage img = a.photo().data(); + TQImage img = a.photo().data(); if ( !img.isNull() ) - mIcon = img.smoothScale( 20, 20, QImage::ScaleMin ); + mIcon = img.smoothScale( 20, 20, TQImage::ScaleMin ); else mIcon = KGlobal::iconLoader()->loadIcon( "personal", KIcon::Small ); @@ -117,27 +117,27 @@ void RecipientItem::setAddressee( const KABC::Addressee &a, mTooltip += "<b>" + mEmail + "</b>"; } -QPixmap RecipientItem::icon() const +TQPixmap RecipientItem::icon() const { return mIcon; } -QString RecipientItem::name() const +TQString RecipientItem::name() const { return mName; } -QString RecipientItem::email() const +TQString RecipientItem::email() const { return mEmail; } -QString RecipientItem::recipient() const +TQString RecipientItem::recipient() const { return mRecipient; } -QString RecipientItem::tooltip() const +TQString RecipientItem::tooltip() const { return mTooltip; } @@ -153,9 +153,9 @@ KABC::DistributionList * RecipientItem::distributionList() { #endif #ifdef KDEPIM_NEW_DISTRLISTS -QString RecipientItem::createTooltip( KPIM::DistributionList &distributionList ) const +TQString RecipientItem::createTooltip( KPIM::DistributionList &distributionList ) const { - QString txt = "<qt>"; + TQString txt = "<qt>"; txt += "<b>" + i18n( "Distribution List %1" ).arg ( distributionList.name() ) + "</b>"; txt += "<ul>"; @@ -176,9 +176,9 @@ QString RecipientItem::createTooltip( KPIM::DistributionList &distributionList ) return txt; } #else -QString RecipientItem::createTooltip( KABC::DistributionList *distributionList ) const +TQString RecipientItem::createTooltip( KABC::DistributionList *distributionList ) const { - QString txt = "<qt>"; + TQString txt = "<qt>"; txt += "<b>" + i18n("Distribution List %1" ).arg ( distributionList->name() ) + "</b>"; txt += "<ul>"; @@ -200,12 +200,12 @@ QString RecipientItem::createTooltip( KABC::DistributionList *distributionList ) } #endif -void RecipientItem::setRecipientType( const QString &type ) +void RecipientItem::setRecipientType( const TQString &type ) { mType = type; } -QString RecipientItem::recipientType() const +TQString RecipientItem::recipientType() const { return mType; } @@ -227,22 +227,22 @@ RecipientItem *RecipientViewItem::recipientItem() const } -RecipientsListToolTip::RecipientsListToolTip( QWidget *parent, +RecipientsListToolTip::RecipientsListToolTip( TQWidget *parent, KListView *listView ) - : QToolTip( parent ) + : TQToolTip( parent ) { mListView = listView; } -void RecipientsListToolTip::maybeTip( const QPoint & pos ) +void RecipientsListToolTip::maybeTip( const TQPoint & pos ) { - QRect r; - QListViewItem *item = mListView->itemAt( pos ); + TQRect r; + TQListViewItem *item = mListView->itemAt( pos ); RecipientViewItem *i = static_cast<RecipientViewItem *>( item ); if( item ) { r = mListView->itemRect( item ); - QString tipText( i->recipientItem()->tooltip() ); + TQString tipText( i->recipientItem()->tooltip() ); if ( !tipText.isEmpty() ) { tip( r, tipText ); } @@ -250,7 +250,7 @@ void RecipientsListToolTip::maybeTip( const QPoint & pos ) } -RecipientsCollection::RecipientsCollection( const QString &id ) +RecipientsCollection::RecipientsCollection( const TQString &id ) { mId = id; mTitle = id; @@ -272,12 +272,12 @@ bool RecipientsCollection::isReferenceContainer() const return mIsReferenceContainer; } -void RecipientsCollection::setTitle( const QString &title ) +void RecipientsCollection::setTitle( const TQString &title ) { mTitle = title; } -QString RecipientsCollection::title() const +TQString RecipientsCollection::title() const { return mTitle; } @@ -299,7 +299,7 @@ bool RecipientsCollection::hasEquivalentItem( RecipientItem *item ) const RecipientItem * RecipientsCollection::getEquivalentItem( RecipientItem *item) const { - QMap<QString, RecipientItem *>::ConstIterator it; + TQMap<TQString, RecipientItem *>::ConstIterator it; it = mKeyMap.find( item->key() ); if ( it == mKeyMap.end() ) return 0; @@ -314,7 +314,7 @@ void RecipientsCollection::clear() void RecipientsCollection::deleteAll() { if ( !isReferenceContainer() ) { - QMap<QString, RecipientItem *>::ConstIterator it; + TQMap<TQString, RecipientItem *>::ConstIterator it; for( it = mKeyMap.begin(); it != mKeyMap.end(); ++it ) { delete *it; } @@ -322,17 +322,17 @@ void RecipientsCollection::deleteAll() clear(); } -QString RecipientsCollection::id() const +TQString RecipientsCollection::id() const { return mId; } -SearchLine::SearchLine( QWidget *parent, KListView *listView ) +SearchLine::SearchLine( TQWidget *parent, KListView *listView ) : KListViewSearchLine( parent, listView ) { } -void SearchLine::keyPressEvent( QKeyEvent *ev ) +void SearchLine::keyPressEvent( TQKeyEvent *ev ) { if ( ev->key() == Key_Down ) emit downPressed(); @@ -340,8 +340,8 @@ void SearchLine::keyPressEvent( QKeyEvent *ev ) } -RecipientsPicker::RecipientsPicker( QWidget *parent ) - : QDialog( parent, "RecipientsPicker" ) +RecipientsPicker::RecipientsPicker( TQWidget *parent ) + : TQDialog( parent, "RecipientsPicker" ) #ifndef KDEPIM_NEW_DISTRLISTS , mDistributionListManager( 0 ) #endif @@ -351,86 +351,86 @@ RecipientsPicker::RecipientsPicker( QWidget *parent ) setCaption( i18n("Select Recipient") ); - QBoxLayout *topLayout = new QVBoxLayout( this ); + TQBoxLayout *topLayout = new TQVBoxLayout( this ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHint() ); - QBoxLayout *resLayout = new QHBoxLayout( topLayout ); + TQBoxLayout *resLayout = new TQHBoxLayout( topLayout ); - QLabel *label = new QLabel( i18n("Address book:"), this ); + TQLabel *label = new TQLabel( i18n("Address book:"), this ); resLayout->addWidget( label ); - mCollectionCombo = new QComboBox( this ); + mCollectionCombo = new TQComboBox( this ); resLayout->addWidget( mCollectionCombo ); - resLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding)); + resLayout->addItem(new TQSpacerItem(1, 1, TQSizePolicy::Expanding)); -// connect( mCollectionCombo, SIGNAL( highlighted( int ) ), -// SLOT( updateList() ) ); - connect( mCollectionCombo, SIGNAL( activated( int ) ), - SLOT( updateList() ) ); +// connect( mCollectionCombo, TQT_SIGNAL( highlighted( int ) ), +// TQT_SLOT( updateList() ) ); + connect( mCollectionCombo, TQT_SIGNAL( activated( int ) ), + TQT_SLOT( updateList() ) ); - QBoxLayout *searchLayout = new QHBoxLayout( topLayout ); + TQBoxLayout *searchLayout = new TQHBoxLayout( topLayout ); - QToolButton *button = new QToolButton( this ); + TQToolButton *button = new TQToolButton( this ); button->setIconSet( KGlobal::iconLoader()->loadIconSet( KApplication::reverseLayout() ? "clear_left":"locationbar_erase", KIcon::Small, 0 ) ); searchLayout->addWidget( button ); - connect( button, SIGNAL( clicked() ), SLOT( resetSearch() ) ); + connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( resetSearch() ) ); - label = new QLabel( i18n("&Search:"), this ); + label = new TQLabel( i18n("&Search:"), this ); searchLayout->addWidget( label ); mRecipientList = new KListView( this ); - mRecipientList->setSelectionMode( QListView::Extended ); + mRecipientList->setSelectionMode( TQListView::Extended ); mRecipientList->setAllColumnsShowFocus( true ); mRecipientList->setFullWidth( true ); topLayout->addWidget( mRecipientList ); mRecipientList->addColumn( i18n("->") ); mRecipientList->addColumn( i18n("Name") ); mRecipientList->addColumn( i18n("Email") ); - connect( mRecipientList, SIGNAL( doubleClicked( QListViewItem *, - const QPoint &, int ) ), SLOT( slotPicked() ) ); - connect( mRecipientList, SIGNAL( returnPressed( QListViewItem * ) ), - SLOT( slotPicked() ) ); + connect( mRecipientList, TQT_SIGNAL( doubleClicked( TQListViewItem *, + const TQPoint &, int ) ), TQT_SLOT( slotPicked() ) ); + connect( mRecipientList, TQT_SIGNAL( returnPressed( TQListViewItem * ) ), + TQT_SLOT( slotPicked() ) ); new RecipientsListToolTip( mRecipientList->viewport(), mRecipientList ); mSearchLine = new SearchLine( this, mRecipientList ); searchLayout->addWidget( mSearchLine ); label->setBuddy( label ); - connect( mSearchLine, SIGNAL( downPressed() ), SLOT( setFocusList() ) ); + connect( mSearchLine, TQT_SIGNAL( downPressed() ), TQT_SLOT( setFocusList() ) ); - mSearchLDAPButton = new QPushButton( i18n("Search &Directory Service"), this ); + mSearchLDAPButton = new TQPushButton( i18n("Search &Directory Service"), this ); searchLayout->addWidget( mSearchLDAPButton ); - connect( mSearchLDAPButton, SIGNAL( clicked() ), SLOT( slotSearchLDAP() ) ); + connect( mSearchLDAPButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotSearchLDAP() ) ); - QBoxLayout *buttonLayout = new QHBoxLayout( topLayout ); + TQBoxLayout *buttonLayout = new TQHBoxLayout( topLayout ); buttonLayout->addStretch( 1 ); - mToButton = new QPushButton( i18n("Add as To"), this ); + mToButton = new TQPushButton( i18n("Add as To"), this ); buttonLayout->addWidget( mToButton ); - connect( mToButton, SIGNAL( clicked() ), SLOT( slotToClicked() ) ); + connect( mToButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotToClicked() ) ); - mCcButton = new QPushButton( i18n("Add as CC"), this ); + mCcButton = new TQPushButton( i18n("Add as CC"), this ); buttonLayout->addWidget( mCcButton ); - connect( mCcButton, SIGNAL( clicked() ), SLOT( slotCcClicked() ) ); + connect( mCcButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotCcClicked() ) ); - mBccButton = new QPushButton( i18n("Add as BCC"), this ); + mBccButton = new TQPushButton( i18n("Add as BCC"), this ); buttonLayout->addWidget( mBccButton ); - connect( mBccButton, SIGNAL( clicked() ), SLOT( slotBccClicked() ) ); + connect( mBccButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotBccClicked() ) ); // BCC isn't commonly used, so hide it for now //mBccButton->hide(); - QPushButton *closeButton = new QPushButton( i18n("&Cancel"), this ); + TQPushButton *closeButton = new TQPushButton( i18n("&Cancel"), this ); buttonLayout->addWidget( closeButton ); - connect( closeButton, SIGNAL( clicked() ), SLOT( close() ) ); + connect( closeButton, TQT_SIGNAL( clicked() ), TQT_SLOT( close() ) ); { using namespace KABC; mAddressBook = KABC::StdAddressBook::self( true ); - connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), - this, SLOT( insertAddressBook( AddressBook * ) ) ); + connect( mAddressBook, TQT_SIGNAL( addressBookChanged( AddressBook * ) ), + this, TQT_SLOT( insertAddressBook( AddressBook * ) ) ); } initCollections(); @@ -456,7 +456,7 @@ RecipientsPicker::~RecipientsPicker() delete mDistributionListManager; #endif - QMap<int,RecipientsCollection *>::ConstIterator it; + TQMap<int,RecipientsCollection *>::ConstIterator it; for( it = mCollectionMap.begin(); it != mCollectionMap.end(); ++it ) { delete *it; } @@ -480,9 +480,9 @@ void RecipientsPicker::initCollections() void RecipientsPicker::insertAddressBook( KABC::AddressBook *addressbook ) { - QMap<KABC::Resource *,RecipientsCollection *> collectionMap; + TQMap<KABC::Resource *,RecipientsCollection *> collectionMap; - QPtrList<KABC::Resource> resources = addressbook->resources(); + TQPtrList<KABC::Resource> resources = addressbook->resources(); KABC::Resource *res; for( res = resources.first(); res; res = resources.next() ) { RecipientsCollection *collection = new RecipientsCollection( res->identifier() ); @@ -490,12 +490,12 @@ void RecipientsPicker::insertAddressBook( KABC::AddressBook *addressbook ) collection->setTitle( res->resourceName() ); } - QMap<QString,RecipientsCollection *> categoryMap; + TQMap<TQString,RecipientsCollection *> categoryMap; KABC::AddressBook::Iterator it; for( it = addressbook->begin(); it != addressbook->end(); ++it ) { - QStringList emails = (*it).emails(); - QStringList::ConstIterator it3; + TQStringList emails = (*it).emails(); + TQStringList::ConstIterator it3; for( it3 = emails.begin(); it3 != emails.end(); ++it3 ) { #ifdef KDEPIM_NEW_DISTRLISTS RecipientItem *item = new RecipientItem( mAddressBook ); @@ -504,16 +504,16 @@ void RecipientsPicker::insertAddressBook( KABC::AddressBook *addressbook ) #endif item->setAddressee( *it, *it3 ); - QMap<KABC::Resource *,RecipientsCollection *>::ConstIterator collIt; + TQMap<KABC::Resource *,RecipientsCollection *>::ConstIterator collIt; collIt = collectionMap.find( it->resource() ); if ( collIt != collectionMap.end() ) { (*collIt)->addItem( item ); } - QStringList categories = (*it).categories(); - QStringList::ConstIterator catIt; + TQStringList categories = (*it).categories(); + TQStringList::ConstIterator catIt; for( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { - QMap<QString, RecipientsCollection *>::ConstIterator catMapIt; + TQMap<TQString, RecipientsCollection *>::ConstIterator catMapIt; catMapIt = categoryMap.find( *catIt ); RecipientsCollection *collection; if ( catMapIt == categoryMap.end() ) { @@ -528,12 +528,12 @@ void RecipientsPicker::insertAddressBook( KABC::AddressBook *addressbook ) } } - QMap<KABC::Resource *,RecipientsCollection *>::ConstIterator it2; + TQMap<KABC::Resource *,RecipientsCollection *>::ConstIterator it2; for( it2 = collectionMap.begin(); it2 != collectionMap.end(); ++it2 ) { insertCollection( *it2 ); } - QMap<QString, RecipientsCollection *>::ConstIterator it3; + TQMap<TQString, RecipientsCollection *>::ConstIterator it3; for( it3 = categoryMap.begin(); it3 != categoryMap.end(); ++it3 ) { insertCollection( *it3 ); } @@ -548,7 +548,7 @@ void RecipientsPicker::insertDistributionLists() mDistributionLists->deleteAll(); #ifdef KDEPIM_NEW_DISTRLISTS - QValueList<KPIM::DistributionList> lists = KPIM::DistributionList::allDistributionLists( mAddressBook ); + TQValueList<KPIM::DistributionList> lists = KPIM::DistributionList::allDistributionLists( mAddressBook ); for ( uint i = 0; i < lists.count(); ++i ) { RecipientItem *item = new RecipientItem( mAddressBook ); item->setDistributionList( lists[ i ] ); @@ -561,9 +561,9 @@ void RecipientsPicker::insertDistributionLists() mDistributionListManager->load(); - QStringList lists = mDistributionListManager->listNames(); + TQStringList lists = mDistributionListManager->listNames(); - QStringList::Iterator listIt; + TQStringList::Iterator listIt; for ( listIt = lists.begin(); listIt != lists.end(); ++listIt ) { KABC::DistributionList *list = mDistributionListManager->list( *listIt ); RecipientItem *item = new RecipientItem; @@ -598,7 +598,7 @@ void RecipientsPicker::insertRecentAddresses() void RecipientsPicker::insertCollection( RecipientsCollection *coll ) { int index = 0; - QMap<int,RecipientsCollection *>::ConstIterator it; + TQMap<int,RecipientsCollection *>::ConstIterator it; for ( it = mCollectionMap.begin(); it != mCollectionMap.end(); ++it ) { if ( (*it)->id() == coll->id() ) { delete *it; @@ -655,8 +655,8 @@ void RecipientsPicker::setRecipients( const Recipient::List &recipients ) if ( !item ) { KABC::Addressee a; - QString name; - QString email; + TQString name; + TQString email; KABC::Addressee::parseEmailAddress( (*it).email(), name, email ); a.setNameFromString( name ); a.insertEmail( email ); @@ -676,7 +676,7 @@ void RecipientsPicker::setRecipients( const Recipient::List &recipients ) updateList(); } -void RecipientsPicker::setDefaultButton( QPushButton *button ) +void RecipientsPicker::setDefaultButton( TQPushButton *button ) { // button->setText( "<qt><b>" + button->text() + "</b></qt>" ); button->setDefault( true ); @@ -699,7 +699,7 @@ void RecipientsPicker::rebuildAllRecipientsList() { mAllRecipients->clear(); - QMap<int,RecipientsCollection *>::ConstIterator it; + TQMap<int,RecipientsCollection *>::ConstIterator it; for( it = mCollectionMap.begin(); it != mCollectionMap.end(); ++it ) { // skip self if ( (*it) == mAllRecipients ) @@ -728,7 +728,7 @@ void RecipientsPicker::updateList() if ( selItem ) { (*it)->setRecipientType( selItem->recipientType() ); } else { - (*it)->setRecipientType( QString() ); + (*it)->setRecipientType( TQString() ); } } new RecipientViewItem( *it, mRecipientList ); @@ -752,7 +752,7 @@ void RecipientsPicker::slotBccClicked() pick( Recipient::Bcc ); } -void RecipientsPicker::slotPicked( QListViewItem *viewItem ) +void RecipientsPicker::slotPicked( TQListViewItem *viewItem ) { RecipientViewItem *item = static_cast<RecipientViewItem *>( viewItem ); if ( item ) { @@ -772,8 +772,8 @@ void RecipientsPicker::pick( Recipient::Type type ) kdDebug() << "RecipientsPicker::pick " << int( type ) << endl; int count = 0; - QListViewItemIterator it( mRecipientList , - QListViewItemIterator::Visible | QListViewItemIterator::Selected ); + TQListViewItemIterator it( mRecipientList , + TQListViewItemIterator::Visible | TQListViewItemIterator::Selected ); for ( ; it.current(); ++it ) ++count; @@ -787,8 +787,8 @@ void RecipientsPicker::pick( Recipient::Type type ) return; } - it = QListViewItemIterator( mRecipientList , - QListViewItemIterator::Visible | QListViewItemIterator::Selected ); + it = TQListViewItemIterator( mRecipientList , + TQListViewItemIterator::Visible | TQListViewItemIterator::Selected ); for ( ; it.current(); ++it ) { RecipientViewItem *item = static_cast<RecipientViewItem *>( it.current() ); if ( item ) { @@ -801,18 +801,18 @@ void RecipientsPicker::pick( Recipient::Type type ) close(); } -void RecipientsPicker::keyPressEvent( QKeyEvent *ev ) +void RecipientsPicker::keyPressEvent( TQKeyEvent *ev ) { if ( ev->key() == Key_Escape ) close(); - QWidget::keyPressEvent( ev ); + TQWidget::keyPressEvent( ev ); } void RecipientsPicker::readConfig() { KConfig *cfg = KGlobal::config(); cfg->setGroup( "RecipientsPicker" ); - QSize size = cfg->readSizeEntry( "Size" ); + TQSize size = cfg->readSizeEntry( "Size" ); if ( !size.isEmpty() ) { resize( size ); } @@ -838,15 +838,15 @@ void RecipientsPicker::setFocusList() void RecipientsPicker::resetSearch() { - mSearchLine->setText( QString::null ); + mSearchLine->setText( TQString::null ); } void RecipientsPicker::slotSearchLDAP() { if ( !mLdapSearchDialog ) { mLdapSearchDialog = new KPIM::LDAPSearchDialog( this ); - connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), - SLOT(ldapSearchResult() ) ); + connect( mLdapSearchDialog, TQT_SIGNAL( addresseesAdded() ), + TQT_SLOT(ldapSearchResult() ) ); } mLdapSearchDialog->setSearchText( mSearchLine->text() ); mLdapSearchDialog->show(); @@ -855,12 +855,12 @@ void RecipientsPicker::slotSearchLDAP() void RecipientsPicker::ldapSearchResult() { - QStringList emails = QStringList::split(',', mLdapSearchDialog->selectedEMails() ); - QStringList::iterator it( emails.begin() ); - QStringList::iterator end( emails.end() ); + TQStringList emails = TQStringList::split(',', mLdapSearchDialog->selectedEMails() ); + TQStringList::iterator it( emails.begin() ); + TQStringList::iterator end( emails.end() ); for ( ; it != end; ++it ){ - QString name; - QString email; + TQString name; + TQString email; KPIM::getNameAndMail( (*it), name, email ); KABC::Addressee ad; ad.setNameFromString( name ); |