summaryrefslogtreecommitdiffabout
path: root/kaddressbook/filtereditdialog.cpp
authorzautrix <zautrix>2005-01-16 14:10:42 (UTC)
committer zautrix <zautrix>2005-01-16 14:10:42 (UTC)
commitde5f08d69c716f85cc92f20700cd24fb1ad41295 (patch) (side-by-side diff)
tree0a4f5dbbdb4fc24215ab85fa4b5e073d0e8104ef /kaddressbook/filtereditdialog.cpp
parent3f61f5a339e9c0c67c17b16214abded0d123f246 (diff)
downloadkdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.zip
kdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.tar.gz
kdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.tar.bz2
added AB filter settings
Diffstat (limited to 'kaddressbook/filtereditdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/filtereditdialog.cpp40
1 files changed, 27 insertions, 13 deletions
diff --git a/kaddressbook/filtereditdialog.cpp b/kaddressbook/filtereditdialog.cpp
index 063585a..987f234 100644
--- a/kaddressbook/filtereditdialog.cpp
+++ b/kaddressbook/filtereditdialog.cpp
@@ -34,6 +34,7 @@ $Id$
#include <qlayout.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
+#include <qcheckbox.h>
#include <qregexp.h>
#include <qstring.h>
#include <qtoolbutton.h>
@@ -90,6 +91,12 @@ void FilterEditDialog::setFilter( const Filter &filter )
mMatchRuleGroup->setButton( 0 );
else
mMatchRuleGroup->setButton( 1 );
+
+ int c = filter.criteria() ;
+ mPublic->setChecked(c &Filter::ShowPublic);
+ mPrivate->setChecked(c & Filter::ShowPrivate);
+ mConfidential->setChecked(c & Filter::ShowConfidential);
+
}
Filter FilterEditDialog::filter()
@@ -114,6 +121,12 @@ Filter FilterEditDialog::filter()
else
filter.setMatchRule( Filter::NotMatching );
+ int c = 0;
+ if (mPublic->isChecked()) c |= Filter::ShowPublic;
+ if (mPrivate->isChecked()) c |= Filter::ShowPrivate;
+ if (mConfidential->isChecked()) c |= Filter::ShowConfidential;
+ filter.setCriteria( c ) ;
+
return filter;
}
@@ -143,23 +156,24 @@ void FilterEditDialog::initGUI()
mCategoriesView->addColumn( i18n( "Categories" ) );
topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 );
- mMatchRuleGroup = new QButtonGroup( page );
+ mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page );
mMatchRuleGroup->setExclusive( true );
-
- QBoxLayout *gbLayout = new QVBoxLayout( mMatchRuleGroup );
- gbLayout->setSpacing( KDialog::spacingHint() );
- gbLayout->setMargin( KDialog::marginHint() );
-
- QRadioButton *radio = new QRadioButton( i18n( "Show only contacts matching\n the selected categories" ), mMatchRuleGroup );
+ QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup );
radio->setChecked( true );
- mMatchRuleGroup->insert( radio );
- gbLayout->addWidget( radio );
+ //mMatchRuleGroup->insert( radio );
+ radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup );
+ //mMatchRuleGroup->insert( radio );
+ topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 );
- radio = new QRadioButton( i18n( "Show all contacts except those\n matching the selected categories" ), mMatchRuleGroup );
- mMatchRuleGroup->insert( radio );
- gbLayout->addWidget( radio );
+ QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page );
+ mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup );
+ mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup );
+ mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup );
+ mPublic->setChecked( true );
+ mPrivate->setChecked( true );
+ mConfidential->setChecked( true );
+ topLayout->addMultiCellWidget( mMatchPPCGroup, 3, 3, 0, 1 );
- topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 );
}
void FilterEditDialog::filterNameTextChanged( const QString &text )