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 | |||
@@ -28,8 +28,8 @@ Copyright (c) 2004 Ulf Schenk | |||
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> |
@@ -40,6 +40,8 @@ $Id$ | |||
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> |
@@ -64,7 +66,7 @@ FilterEditDialog::FilterEditDialog( QWidget *parent, const char *name ) | |||
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 | ||
@@ -77,10 +79,10 @@ void FilterEditDialog::setFilter( const Filter &filter ) | |||
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 | ||
@@ -105,9 +107,9 @@ Filter FilterEditDialog::filter() | |||
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 | ||
@@ -141,7 +143,7 @@ void FilterEditDialog::initGUI() | |||
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 ); |
@@ -155,7 +157,7 @@ void FilterEditDialog::initGUI() | |||
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 ); |
@@ -164,7 +166,7 @@ void FilterEditDialog::initGUI() | |||
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 ); |
@@ -272,7 +274,7 @@ void FilterDialog::refresh() | |||
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 | ||
@@ -290,16 +292,16 @@ void FilterDialog::initGUI() | |||
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 ); |
@@ -310,6 +312,6 @@ void FilterDialog::initGUI() | |||
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 |