author | zautrix <zautrix> | 2005-01-17 18:22:47 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-17 18:22:47 (UTC) |
commit | 32479683283fc9f20d369ac9671ba0f8a33d3381 (patch) (side-by-side diff) | |
tree | 0d764657db915bd2d2bf2fb751800eb14515626b /kaddressbook/xxportselectdialog.cpp | |
parent | 11e05160cda1571a208edbabc71f6d94e394d829 (diff) | |
download | kdepimpi-32479683283fc9f20d369ac9671ba0f8a33d3381.zip kdepimpi-32479683283fc9f20d369ac9671ba0f8a33d3381.tar.gz kdepimpi-32479683283fc9f20d369ac9671ba0f8a33d3381.tar.bz2 |
fast set formatted name
Diffstat (limited to 'kaddressbook/xxportselectdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/xxportselectdialog.cpp | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp index 6282453..e7bc8c0 100644 --- a/kaddressbook/xxportselectdialog.cpp +++ b/kaddressbook/xxportselectdialog.cpp @@ -53,9 +53,9 @@ $Id$ #include "xxportselectdialog.h" XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, QWidget* parent, const char* name ) - : KDialogBase( Plain, i18n( "Choose which contacts to select" ), Help | Ok | Cancel, + : KDialogBase( Plain, i18n( "Choose contact selection" ), Help | Ok | Cancel, Ok, parent, name, true, true ), mCore( core ), mUseSorting( sort ) { initGUI(); @@ -108,15 +108,55 @@ QStringList XXPortSelectDialog::uids() for ( it = list.begin(); it != list.end(); ++it ) uidlist.append((*it).uid()); return uidlist; } +void XXPortSelectDialog::tagSelected() +{ + if ( mUseSelection->isChecked() ) { + + QStringList selection = mCore->selectedUIDs(); + KABC::AddressBook::Iterator it; + for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { + if ( selection.findIndex((*it).uid()) >= 0 ) + (*it).setTagged( true ); + } + } else if ( mUseFilters->isChecked() ) { + // find contacts that can pass selected filter + Filter::List::Iterator filterIt; + for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) + if ( (*filterIt).name() == mFiltersCombo->currentText() ) + break; + KABC::AddressBook::Iterator it; + for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { + if ( (*filterIt).filterAddressee( *it ) ) + (*it).setTagged( true ); + } + } else if ( mUseCategories->isChecked() ) { + QStringList categorieList = categories(); + KABC::AddressBook::Iterator it; + for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { + QStringList tmp( (*it).categories() ); + QStringList::Iterator tmpIt; + for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt ) + if ( categorieList.contains( *tmpIt ) ) { + (*it).setTagged( true ); + break; + } + } + } else { + // create a string list of all entries: + KABC::AddressBook::Iterator it; + for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) + (*it).setTagged( true ); + } +} KABC::AddresseeList XXPortSelectDialog::contacts() { - QStringList selection = mCore->selectedUIDs(); KABC::AddresseeList list; if ( mUseSelection->isChecked() ) { QStringList::Iterator it; + QStringList selection = mCore->selectedUIDs(); for ( it = selection.begin(); it != selection.end(); ++it ) { KABC::Addressee addr = mCore->addressBook()->findByUid( *it ); if ( !addr.isEmpty() ) list.append( addr ); @@ -245,10 +285,10 @@ void XXPortSelectDialog::initGUI() mCategoriesView->header()->hide(); QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); groupLayout->addWidget( mCategoriesView, 3, 1 ); - // if (QApplication::desktop()->height() == 480 ) - // mCategoriesView->setMaximumHeight( 240 ); + if (QApplication::desktop()->height() == 480 ) + mCategoriesView->setMaximumHeight( 240 ); topLayout->addWidget( mButtonGroup ); QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page ); sortingGroup->setColumnLayout( 0, Qt::Vertical ); |