summaryrefslogtreecommitdiffabout
path: root/kaddressbook/xxportselectdialog.cpp
authorzautrix <zautrix>2005-01-17 18:22:47 (UTC)
committer zautrix <zautrix>2005-01-17 18:22:47 (UTC)
commit32479683283fc9f20d369ac9671ba0f8a33d3381 (patch) (side-by-side diff)
tree0d764657db915bd2d2bf2fb751800eb14515626b /kaddressbook/xxportselectdialog.cpp
parent11e05160cda1571a208edbabc71f6d94e394d829 (diff)
downloadkdepimpi-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.cpp48
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
@@ -54,7 +54,7 @@ $Id$
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 )
{
@@ -109,13 +109,53 @@ QStringList XXPortSelectDialog::uids()
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() )
@@ -246,8 +286,8 @@ void XXPortSelectDialog::initGUI()
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 );