Diffstat (limited to 'kaddressbook/filtereditdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/filtereditdialog.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/kaddressbook/filtereditdialog.cpp b/kaddressbook/filtereditdialog.cpp index ef9b979..40698a7 100644 --- a/kaddressbook/filtereditdialog.cpp +++ b/kaddressbook/filtereditdialog.cpp | |||
@@ -1,315 +1,317 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* | 24 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <qbuttongroup.h> | 31 | #include <q3buttongroup.h> |
32 | #include <qhbox.h> | 32 | #include <q3hbox.h> |
33 | #include <qlabel.h> | 33 | #include <qlabel.h> |
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qpushbutton.h> | 35 | #include <qpushbutton.h> |
36 | #include <qradiobutton.h> | 36 | #include <qradiobutton.h> |
37 | #include <qcheckbox.h> | 37 | #include <qcheckbox.h> |
38 | #include <qregexp.h> | 38 | #include <qregexp.h> |
39 | #include <qstring.h> | 39 | #include <qstring.h> |
40 | #include <qtoolbutton.h> | 40 | #include <qtoolbutton.h> |
41 | #include <qtooltip.h> | 41 | #include <qtooltip.h> |
42 | #include <qwidget.h> | 42 | #include <qwidget.h> |
43 | //Added by qt3to4: | ||
44 | #include <Q3GridLayout> | ||
43 | 45 | ||
44 | #include <kapplication.h> | 46 | #include <kapplication.h> |
45 | #include <kbuttonbox.h> | 47 | #include <kbuttonbox.h> |
46 | #include <kdebug.h> | 48 | #include <kdebug.h> |
47 | #include <kiconloader.h> | 49 | #include <kiconloader.h> |
48 | #include <klineedit.h> | 50 | #include <klineedit.h> |
49 | #include <klistbox.h> | 51 | #include <klistbox.h> |
50 | #include <klistview.h> | 52 | #include <klistview.h> |
51 | #include <klocale.h> | 53 | #include <klocale.h> |
52 | #include <kglobal.h> | 54 | #include <kglobal.h> |
53 | 55 | ||
54 | #include "kabprefs.h" | 56 | #include "kabprefs.h" |
55 | #include "filtereditdialog.h" | 57 | #include "filtereditdialog.h" |
56 | 58 | ||
57 | FilterEditDialog::FilterEditDialog( QWidget *parent, const char *name ) | 59 | FilterEditDialog::FilterEditDialog( QWidget *parent, const char *name ) |
58 | : KDialogBase( Plain, i18n( "Edit Address Book Filter" ), | 60 | : KDialogBase( Plain, i18n( "Edit Address Book Filter" ), |
59 | Help | Ok | Cancel, Ok, parent, name, /*US false*/ true, true ) | 61 | Help | Ok | Cancel, Ok, parent, name, /*US false*/ true, true ) |
60 | { | 62 | { |
61 | initGUI(); | 63 | initGUI(); |
62 | 64 | ||
63 | QStringList cats = KABPrefs::instance()->mCustomCategories; | 65 | QStringList cats = KABPrefs::instance()->mCustomCategories; |
64 | 66 | ||
65 | QStringList::Iterator iter; | 67 | QStringList::Iterator iter; |
66 | for ( iter = cats.begin(); iter != cats.end(); ++iter ) | 68 | for ( iter = cats.begin(); iter != cats.end(); ++iter ) |
67 | mCategoriesView->insertItem( new QCheckListItem( mCategoriesView, (*iter), QCheckListItem::CheckBox ) ); | 69 | mCategoriesView->insertItem( new Q3CheckListItem( mCategoriesView, (*iter), Q3CheckListItem::CheckBox ) ); |
68 | filterNameTextChanged( mNameEdit->text() ); | 70 | filterNameTextChanged( mNameEdit->text() ); |
69 | } | 71 | } |
70 | 72 | ||
71 | FilterEditDialog::~FilterEditDialog() | 73 | FilterEditDialog::~FilterEditDialog() |
72 | { | 74 | { |
73 | } | 75 | } |
74 | 76 | ||
75 | void FilterEditDialog::setFilter( const Filter &filter ) | 77 | void FilterEditDialog::setFilter( const Filter &filter ) |
76 | { | 78 | { |
77 | mNameEdit->setText( filter.name() ); | 79 | mNameEdit->setText( filter.name() ); |
78 | 80 | ||
79 | QStringList categories = filter.categories(); | 81 | QStringList categories = filter.categories(); |
80 | QListViewItem *item = mCategoriesView->firstChild(); | 82 | Q3ListViewItem *item = mCategoriesView->firstChild(); |
81 | while ( item != 0 ) { | 83 | while ( item != 0 ) { |
82 | if ( categories.contains( item->text( 0 ) ) ) { | 84 | if ( categories.contains( item->text( 0 ) ) ) { |
83 | QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); | 85 | Q3CheckListItem *checkItem = static_cast<Q3CheckListItem*>( item ); |
84 | checkItem->setOn( true ); | 86 | checkItem->setOn( true ); |
85 | } | 87 | } |
86 | 88 | ||
87 | item = item->nextSibling(); | 89 | item = item->nextSibling(); |
88 | } | 90 | } |
89 | 91 | ||
90 | if ( filter.matchRule() == Filter::Matching ) | 92 | if ( filter.matchRule() == Filter::Matching ) |
91 | mMatchRuleGroup->setButton( 0 ); | 93 | mMatchRuleGroup->setButton( 0 ); |
92 | else | 94 | else |
93 | mMatchRuleGroup->setButton( 1 ); | 95 | mMatchRuleGroup->setButton( 1 ); |
94 | 96 | ||
95 | int c = filter.criteria() ; | 97 | int c = filter.criteria() ; |
96 | mPublic->setChecked(c &Filter::ShowPublic); | 98 | mPublic->setChecked(c &Filter::ShowPublic); |
97 | mPrivate->setChecked(c & Filter::ShowPrivate); | 99 | mPrivate->setChecked(c & Filter::ShowPrivate); |
98 | mConfidential->setChecked(c & Filter::ShowConfidential); | 100 | mConfidential->setChecked(c & Filter::ShowConfidential); |
99 | } | 101 | } |
100 | 102 | ||
101 | Filter FilterEditDialog::filter() | 103 | Filter FilterEditDialog::filter() |
102 | { | 104 | { |
103 | Filter filter; | 105 | Filter filter; |
104 | 106 | ||
105 | filter.setName( mNameEdit->text() ); | 107 | filter.setName( mNameEdit->text() ); |
106 | 108 | ||
107 | QStringList categories; | 109 | QStringList categories; |
108 | QListViewItem *item = mCategoriesView->firstChild(); | 110 | Q3ListViewItem *item = mCategoriesView->firstChild(); |
109 | while ( item != 0 ) { | 111 | while ( item != 0 ) { |
110 | QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); | 112 | Q3CheckListItem *checkItem = static_cast<Q3CheckListItem*>( item ); |
111 | if ( checkItem->isOn() ) | 113 | if ( checkItem->isOn() ) |
112 | categories.append( item->text( 0 ) ); | 114 | categories.append( item->text( 0 ) ); |
113 | 115 | ||
114 | item = item->nextSibling(); | 116 | item = item->nextSibling(); |
115 | } | 117 | } |
116 | filter.setCategories( categories ); | 118 | filter.setCategories( categories ); |
117 | 119 | ||
118 | if ( mMatchRuleGroup->find( 0 )->isOn() ) | 120 | if ( mMatchRuleGroup->find( 0 )->isOn() ) |
119 | filter.setMatchRule( Filter::Matching ); | 121 | filter.setMatchRule( Filter::Matching ); |
120 | else | 122 | else |
121 | filter.setMatchRule( Filter::NotMatching ); | 123 | filter.setMatchRule( Filter::NotMatching ); |
122 | 124 | ||
123 | int c = 0; | 125 | int c = 0; |
124 | if (mPublic->isChecked()) c |= Filter::ShowPublic; | 126 | if (mPublic->isChecked()) c |= Filter::ShowPublic; |
125 | if (mPrivate->isChecked()) c |= Filter::ShowPrivate; | 127 | if (mPrivate->isChecked()) c |= Filter::ShowPrivate; |
126 | if (mConfidential->isChecked()) c |= Filter::ShowConfidential; | 128 | if (mConfidential->isChecked()) c |= Filter::ShowConfidential; |
127 | filter.setCriteria( c ) ; | 129 | filter.setCriteria( c ) ; |
128 | 130 | ||
129 | return filter; | 131 | return filter; |
130 | } | 132 | } |
131 | 133 | ||
132 | void FilterEditDialog::initGUI() | 134 | void FilterEditDialog::initGUI() |
133 | { | 135 | { |
134 | #ifndef KAB_EMBEDDED | 136 | #ifndef KAB_EMBEDDED |
135 | resize( 490, 300 ); | 137 | resize( 490, 300 ); |
136 | #else //KAB_EMBEDDED | 138 | #else //KAB_EMBEDDED |
137 | resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300)); | 139 | resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300)); |
138 | #endif //KAB_EMBEDDED | 140 | #endif //KAB_EMBEDDED |
139 | 141 | ||
140 | 142 | ||
141 | QWidget *page = plainPage(); | 143 | QWidget *page = plainPage(); |
142 | QLabel *label; | 144 | QLabel *label; |
143 | 145 | ||
144 | QGridLayout *topLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); | 146 | Q3GridLayout *topLayout = new Q3GridLayout( page, 3, 2, 0, spacingHint() ); |
145 | 147 | ||
146 | label = new QLabel( i18n( "Name" ), page ); | 148 | label = new QLabel( i18n( "Name" ), page ); |
147 | mNameEdit = new KLineEdit( page ); | 149 | mNameEdit = new KLineEdit( page ); |
148 | mNameEdit->setFocus(); | 150 | mNameEdit->setFocus(); |
149 | topLayout->addWidget( label, 0, 0 ); | 151 | topLayout->addWidget( label, 0, 0 ); |
150 | topLayout->addWidget( mNameEdit, 0, 1 ); | 152 | topLayout->addWidget( mNameEdit, 0, 1 ); |
151 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), | 153 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), |
152 | SLOT( filterNameTextChanged( const QString&) ) ); | 154 | SLOT( filterNameTextChanged( const QString&) ) ); |
153 | 155 | ||
154 | mCategoriesView = new KListView( page ); | 156 | mCategoriesView = new KListView( page ); |
155 | mCategoriesView->addColumn( i18n( "Categories" ) ); | 157 | mCategoriesView->addColumn( i18n( "Categories" ) ); |
156 | topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 ); | 158 | topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 ); |
157 | 159 | ||
158 | mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page ); | 160 | mMatchRuleGroup = new Q3HButtonGroup( i18n( "Category rule" ), page ); |
159 | mMatchRuleGroup->setExclusive( true ); | 161 | mMatchRuleGroup->setExclusive( true ); |
160 | QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup ); | 162 | QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup ); |
161 | //mMatchRuleGroup->insert( radio ); | 163 | //mMatchRuleGroup->insert( radio ); |
162 | radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup ); | 164 | radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup ); |
163 | radio->setChecked( true ); | 165 | radio->setChecked( true ); |
164 | //mMatchRuleGroup->insert( radio ); | 166 | //mMatchRuleGroup->insert( radio ); |
165 | topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); | 167 | topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); |
166 | 168 | ||
167 | QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page ); | 169 | Q3HButtonGroup * mMatchPPCGroup = new Q3HButtonGroup(i18n( "Include contacts, that are:" ), page ); |
168 | mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup ); | 170 | mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup ); |
169 | mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup ); | 171 | mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup ); |
170 | mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup ); | 172 | mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup ); |
171 | mPublic->setChecked( true ); | 173 | mPublic->setChecked( true ); |
172 | mPrivate->setChecked( true ); | 174 | mPrivate->setChecked( true ); |
173 | mConfidential->setChecked( true ); | 175 | mConfidential->setChecked( true ); |
174 | topLayout->addMultiCellWidget( mMatchPPCGroup, 3, 3, 0, 1 ); | 176 | topLayout->addMultiCellWidget( mMatchPPCGroup, 3, 3, 0, 1 ); |
175 | 177 | ||
176 | } | 178 | } |
177 | 179 | ||
178 | void FilterEditDialog::filterNameTextChanged( const QString &text ) | 180 | void FilterEditDialog::filterNameTextChanged( const QString &text ) |
179 | { | 181 | { |
180 | enableButtonOK( !text.isEmpty() ); | 182 | enableButtonOK( !text.isEmpty() ); |
181 | } | 183 | } |
182 | 184 | ||
183 | void FilterEditDialog::slotHelp() | 185 | void FilterEditDialog::slotHelp() |
184 | { | 186 | { |
185 | #ifndef KAB_EMBEDDED | 187 | #ifndef KAB_EMBEDDED |
186 | kapp->invokeHelp( "using-filters" ); | 188 | kapp->invokeHelp( "using-filters" ); |
187 | #endif //KAB_EMBEDDED | 189 | #endif //KAB_EMBEDDED |
188 | } | 190 | } |
189 | 191 | ||
190 | FilterDialog::FilterDialog( QWidget *parent, const char *name ) | 192 | FilterDialog::FilterDialog( QWidget *parent, const char *name ) |
191 | : KDialogBase( Plain, i18n( "Edit Address Book Filters" ), | 193 | : KDialogBase( Plain, i18n( "Edit Address Book Filters" ), |
192 | Ok | Cancel, Ok, parent, name, /*US false*/true, true ) | 194 | Ok | Cancel, Ok, parent, name, /*US false*/true, true ) |
193 | { | 195 | { |
194 | initGUI(); | 196 | initGUI(); |
195 | } | 197 | } |
196 | 198 | ||
197 | FilterDialog::~FilterDialog() | 199 | FilterDialog::~FilterDialog() |
198 | { | 200 | { |
199 | } | 201 | } |
200 | 202 | ||
201 | void FilterDialog::setFilters( const Filter::List &list ) | 203 | void FilterDialog::setFilters( const Filter::List &list ) |
202 | { | 204 | { |
203 | mFilterList.clear(); | 205 | mFilterList.clear(); |
204 | mInternalFilterList.clear(); | 206 | mInternalFilterList.clear(); |
205 | 207 | ||
206 | Filter::List::ConstIterator it; | 208 | Filter::List::ConstIterator it; |
207 | for ( it = list.begin(); it != list.end(); ++it ) { | 209 | for ( it = list.begin(); it != list.end(); ++it ) { |
208 | if ( (*it).isInternal() ) | 210 | if ( (*it).isInternal() ) |
209 | mInternalFilterList.append( *it ); | 211 | mInternalFilterList.append( *it ); |
210 | else | 212 | else |
211 | mFilterList.append( *it ); | 213 | mFilterList.append( *it ); |
212 | } | 214 | } |
213 | 215 | ||
214 | refresh(); | 216 | refresh(); |
215 | } | 217 | } |
216 | 218 | ||
217 | Filter::List FilterDialog::filters() const | 219 | Filter::List FilterDialog::filters() const |
218 | { | 220 | { |
219 | Filter::List list = mFilterList + mInternalFilterList; | 221 | Filter::List list = mFilterList + mInternalFilterList; |
220 | return list; | 222 | return list; |
221 | } | 223 | } |
222 | 224 | ||
223 | void FilterDialog::add() | 225 | void FilterDialog::add() |
224 | { | 226 | { |
225 | #ifndef KAB_EMBEDDED | 227 | #ifndef KAB_EMBEDDED |
226 | FilterEditDialog dlg( this ); | 228 | FilterEditDialog dlg( this ); |
227 | #else //KAB_EMBEDDED | 229 | #else //KAB_EMBEDDED |
228 | FilterEditDialog dlg( this->parentWidget() ); | 230 | FilterEditDialog dlg( this->parentWidget() ); |
229 | #endif //KAB_EMBEDDED | 231 | #endif //KAB_EMBEDDED |
230 | 232 | ||
231 | if ( dlg.exec() ) | 233 | if ( dlg.exec() ) |
232 | mFilterList.append( dlg.filter() ); | 234 | mFilterList.append( dlg.filter() ); |
233 | 235 | ||
234 | refresh(); | 236 | refresh(); |
235 | 237 | ||
236 | mFilterListBox->setCurrentItem( mFilterListBox->count() - 1 ); | 238 | mFilterListBox->setCurrentItem( mFilterListBox->count() - 1 ); |
237 | } | 239 | } |
238 | 240 | ||
239 | void FilterDialog::edit() | 241 | void FilterDialog::edit() |
240 | { | 242 | { |
241 | FilterEditDialog dlg( this ); | 243 | FilterEditDialog dlg( this ); |
242 | 244 | ||
243 | uint pos = mFilterListBox->currentItem(); | 245 | uint pos = mFilterListBox->currentItem(); |
244 | 246 | ||
245 | dlg.setFilter( mFilterList[ pos ] ); | 247 | dlg.setFilter( mFilterList[ pos ] ); |
246 | 248 | ||
247 | if ( dlg.exec() ) { | 249 | if ( dlg.exec() ) { |
248 | mFilterList.remove( mFilterList.at( pos ) ); | 250 | mFilterList.remove( mFilterList.at( pos ) ); |
249 | mFilterList.insert( mFilterList.at( pos ), dlg.filter() ); | 251 | mFilterList.insert( mFilterList.at( pos ), dlg.filter() ); |
250 | } | 252 | } |
251 | 253 | ||
252 | refresh(); | 254 | refresh(); |
253 | 255 | ||
254 | mFilterListBox->setCurrentItem( pos ); | 256 | mFilterListBox->setCurrentItem( pos ); |
255 | } | 257 | } |
256 | 258 | ||
257 | void FilterDialog::remove() | 259 | void FilterDialog::remove() |
258 | { | 260 | { |
259 | mFilterList.remove( mFilterList.at( mFilterListBox->currentItem() ) ); | 261 | mFilterList.remove( mFilterList.at( mFilterListBox->currentItem() ) ); |
260 | 262 | ||
261 | selectionChanged( 0 ); | 263 | selectionChanged( 0 ); |
262 | 264 | ||
263 | refresh(); | 265 | refresh(); |
264 | } | 266 | } |
265 | 267 | ||
266 | void FilterDialog::refresh() | 268 | void FilterDialog::refresh() |
267 | { | 269 | { |
268 | mFilterListBox->clear(); | 270 | mFilterListBox->clear(); |
269 | 271 | ||
270 | Filter::List::Iterator iter; | 272 | Filter::List::Iterator iter; |
271 | for ( iter = mFilterList.begin(); iter != mFilterList.end(); ++iter ) | 273 | for ( iter = mFilterList.begin(); iter != mFilterList.end(); ++iter ) |
272 | mFilterListBox->insertItem( (*iter).name() ); | 274 | mFilterListBox->insertItem( (*iter).name() ); |
273 | } | 275 | } |
274 | 276 | ||
275 | void FilterDialog::selectionChanged( QListBoxItem *item ) | 277 | void FilterDialog::selectionChanged( Q3ListBoxItem *item ) |
276 | { | 278 | { |
277 | bool state = ( item != 0 ); | 279 | bool state = ( item != 0 ); |
278 | 280 | ||
279 | mEditButton->setEnabled( state ); | 281 | mEditButton->setEnabled( state ); |
280 | mRemoveButton->setEnabled( state ); | 282 | mRemoveButton->setEnabled( state ); |
281 | } | 283 | } |
282 | 284 | ||
283 | void FilterDialog::initGUI() | 285 | void FilterDialog::initGUI() |
284 | { | 286 | { |
285 | #ifndef KAB_EMBEDDED | 287 | #ifndef KAB_EMBEDDED |
286 | resize( 330, 200 ); | 288 | resize( 330, 200 ); |
287 | #else //KAB_EMBEDDED | 289 | #else //KAB_EMBEDDED |
288 | resize( KMIN(KGlobal::getDesktopWidth()-10, 330), KMIN(KGlobal::getDesktopHeight()-50, 200)); | 290 | resize( KMIN(KGlobal::getDesktopWidth()-10, 330), KMIN(KGlobal::getDesktopHeight()-50, 200)); |
289 | #endif //KAB_EMBEDDED | 291 | #endif //KAB_EMBEDDED |
290 | 292 | ||
291 | QWidget *page = plainPage(); | 293 | QWidget *page = plainPage(); |
292 | 294 | ||
293 | QGridLayout *topLayout = new QGridLayout( page, 1, 2, 0, spacingHint() ); | 295 | Q3GridLayout *topLayout = new Q3GridLayout( page, 1, 2, 0, spacingHint() ); |
294 | 296 | ||
295 | mFilterListBox = new KListBox( page ); | 297 | mFilterListBox = new KListBox( page ); |
296 | topLayout->addWidget( mFilterListBox, 0, 0 ); | 298 | topLayout->addWidget( mFilterListBox, 0, 0 ); |
297 | connect( mFilterListBox, SIGNAL( selectionChanged( QListBoxItem * ) ), | 299 | connect( mFilterListBox, SIGNAL( selectionChanged( Q3ListBoxItem * ) ), |
298 | SLOT( selectionChanged( QListBoxItem * ) ) ); | 300 | SLOT( selectionChanged( Q3ListBoxItem * ) ) ); |
299 | connect( mFilterListBox, SIGNAL( doubleClicked ( QListBoxItem * ) ), | 301 | connect( mFilterListBox, SIGNAL( doubleClicked ( Q3ListBoxItem * ) ), |
300 | SLOT( edit() ) ); | 302 | SLOT( edit() ) ); |
301 | 303 | ||
302 | KButtonBox *buttonBox = new KButtonBox( page, Vertical ); | 304 | KButtonBox *buttonBox = new KButtonBox( page, Qt::Vertical ); |
303 | buttonBox->addButton( i18n( "&Add..." ), this, SLOT( add() ) ); | 305 | buttonBox->addButton( i18n( "&Add..." ), this, SLOT( add() ) ); |
304 | mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( edit() ) ); | 306 | mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( edit() ) ); |
305 | mEditButton->setEnabled( false ); | 307 | mEditButton->setEnabled( false ); |
306 | mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( remove() ) ); | 308 | mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( remove() ) ); |
307 | mRemoveButton->setEnabled( false ); | 309 | mRemoveButton->setEnabled( false ); |
308 | 310 | ||
309 | buttonBox->layout(); | 311 | buttonBox->layout(); |
310 | topLayout->addWidget( buttonBox, 0, 1 ); | 312 | topLayout->addWidget( buttonBox, 0, 1 ); |
311 | } | 313 | } |
312 | 314 | ||
313 | #ifndef KAB_EMBEDDED | 315 | #ifndef KAB_EMBEDDED_ |
314 | #include "filtereditdialog.moc" | 316 | #include "moc_filtereditdialog.cpp" |
315 | #endif //KAB_EMBEDDED | 317 | #endif //KAB_EMBEDDED |