author | zautrix <zautrix> | 2005-01-16 14:10:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-16 14:10:42 (UTC) |
commit | de5f08d69c716f85cc92f20700cd24fb1ad41295 (patch) (unidiff) | |
tree | 0a4f5dbbdb4fc24215ab85fa4b5e073d0e8104ef /kaddressbook/filtereditdialog.cpp | |
parent | 3f61f5a339e9c0c67c17b16214abded0d123f246 (diff) | |
download | kdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.zip kdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.tar.gz kdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.tar.bz2 |
added AB filter settings
Diffstat (limited to 'kaddressbook/filtereditdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kaddressbook/filtereditdialog.cpp | 40 |
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 | |||
@@ -36,2 +36,3 @@ $Id$ | |||
36 | #include <qradiobutton.h> | 36 | #include <qradiobutton.h> |
37 | #include <qcheckbox.h> | ||
37 | #include <qregexp.h> | 38 | #include <qregexp.h> |
@@ -92,2 +93,8 @@ void FilterEditDialog::setFilter( const Filter &filter ) | |||
92 | mMatchRuleGroup->setButton( 1 ); | 93 | mMatchRuleGroup->setButton( 1 ); |
94 | |||
95 | int c = filter.criteria() ; | ||
96 | mPublic->setChecked(c &Filter::ShowPublic); | ||
97 | mPrivate->setChecked(c & Filter::ShowPrivate); | ||
98 | mConfidential->setChecked(c & Filter::ShowConfidential); | ||
99 | |||
93 | } | 100 | } |
@@ -116,2 +123,8 @@ Filter FilterEditDialog::filter() | |||
116 | 123 | ||
124 | int c = 0; | ||
125 | if (mPublic->isChecked()) c |= Filter::ShowPublic; | ||
126 | if (mPrivate->isChecked()) c |= Filter::ShowPrivate; | ||
127 | if (mConfidential->isChecked()) c |= Filter::ShowConfidential; | ||
128 | filter.setCriteria( c ) ; | ||
129 | |||
117 | return filter; | 130 | return filter; |
@@ -145,19 +158,20 @@ void FilterEditDialog::initGUI() | |||
145 | 158 | ||
146 | mMatchRuleGroup = new QButtonGroup( page ); | 159 | mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page ); |
147 | mMatchRuleGroup->setExclusive( true ); | 160 | mMatchRuleGroup->setExclusive( true ); |
148 | 161 | QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup ); | |
149 | QBoxLayout *gbLayout = new QVBoxLayout( mMatchRuleGroup ); | ||
150 | gbLayout->setSpacing( KDialog::spacingHint() ); | ||
151 | gbLayout->setMargin( KDialog::marginHint() ); | ||
152 | |||
153 | QRadioButton *radio = new QRadioButton( i18n( "Show only contacts matching\n the selected categories" ), mMatchRuleGroup ); | ||
154 | radio->setChecked( true ); | 162 | radio->setChecked( true ); |
155 | mMatchRuleGroup->insert( radio ); | 163 | //mMatchRuleGroup->insert( radio ); |
156 | gbLayout->addWidget( radio ); | 164 | radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup ); |
165 | //mMatchRuleGroup->insert( radio ); | ||
166 | topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); | ||
157 | 167 | ||
158 | radio = new QRadioButton( i18n( "Show all contacts except those\n matching the selected categories" ), mMatchRuleGroup ); | 168 | QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page ); |
159 | mMatchRuleGroup->insert( radio ); | 169 | mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup ); |
160 | gbLayout->addWidget( radio ); | 170 | mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup ); |
171 | mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup ); | ||
172 | mPublic->setChecked( true ); | ||
173 | mPrivate->setChecked( true ); | ||
174 | mConfidential->setChecked( true ); | ||
175 | topLayout->addMultiCellWidget( mMatchPPCGroup, 3, 3, 0, 1 ); | ||
161 | 176 | ||
162 | topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); | ||
163 | } | 177 | } |