summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kcmconfigs
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/kcmconfigs
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-p1.zip
kdepimpi-p1.tar.gz
kdepimpi-p1.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/kcmconfigs') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kcmconfigs/addresseewidget.cpp36
-rw-r--r--kaddressbook/kcmconfigs/addresseewidget.h8
-rw-r--r--kaddressbook/kcmconfigs/extensionconfigdialog.cpp11
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp59
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.h6
-rw-r--r--kaddressbook/kcmconfigs/kcmkabconfig.cpp8
6 files changed, 70 insertions, 58 deletions
diff --git a/kaddressbook/kcmconfigs/addresseewidget.cpp b/kaddressbook/kcmconfigs/addresseewidget.cpp
index 168d39e..8055085 100644
--- a/kaddressbook/kcmconfigs/addresseewidget.cpp
+++ b/kaddressbook/kcmconfigs/addresseewidget.cpp
@@ -1,238 +1,242 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
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#include <qgroupbox.h> 24#include <q3groupbox.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlistbox.h> 27#include <q3listbox.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qapplication.h> 29#include <qapplication.h>
30#include <QDesktopWidget>
31//Added by qt3to4:
32#include <Q3GridLayout>
33#include <Q3HBoxLayout>
30 34
31#include <kbuttonbox.h> 35#include <kbuttonbox.h>
32#include <kcombobox.h> 36#include <kcombobox.h>
33#include <kconfig.h> 37#include <kconfig.h>
34#include <kdialog.h> 38#include <kdialog.h>
35#include <klocale.h> 39#include <klocale.h>
36#include <kglobal.h> 40#include <kglobal.h>
37#include <klineedit.h> 41#include <klineedit.h>
38#include <kstandarddirs.h> 42#include <kstandarddirs.h>
39 43
40#include "addresseewidget.h" 44#include "addresseewidget.h"
41 45
42NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, 46NamePartWidget::NamePartWidget( const QString &title, QWidget *parent,
43 const char *name ) 47 const char *name )
44 : QWidget( parent, name ) 48 : QWidget( parent, name )
45{ 49{
46 if (KGlobal::getOrientation() == KGlobal::Portrait) 50 if (KGlobal::getOrientation() == KGlobal::Portrait)
47 { 51 {
48 QGridLayout* layout = new QGridLayout( this, 1, 1, KDialog::marginHintSmall(), 52 Q3GridLayout* layout = new Q3GridLayout( this, 1, 1, KDialog::marginHintSmall(),
49 KDialog::spacingHintSmall() ); 53 KDialog::spacingHintSmall() );
50 54
51 QLabel *label = new QLabel( i18n( title ), this ); 55 QLabel *label = new QLabel( i18n( title ), this );
52 layout->addWidget( label, 0, 1 ); 56 layout->addWidget( label, 0, 1 );
53 57
54 mBox = new QListBox( this ); 58 mBox = new Q3ListBox( this );
55 mBox->setMaximumSize(70, 70); 59 mBox->setMaximumSize(70, 70);
56 layout->addMultiCellWidget( mBox, 0, 1, 0, 0 ); 60 layout->addMultiCellWidget( mBox, 0, 1, 0, 0 );
57 61
58 KButtonBox *bbox = new KButtonBox( this, Qt::Vertical ); 62 KButtonBox *bbox = new KButtonBox( this, Qt::Vertical );
59 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); 63 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) );
60 mRemoveButton = bbox->addButton( i18n( "Rem" ), this, SLOT( remove() ) ); 64 mRemoveButton = bbox->addButton( i18n( "Rem" ), this, SLOT( remove() ) );
61 bbox->layout(); 65 bbox->layout();
62 layout->addMultiCellWidget( bbox, 0, 1, 2,2); 66 layout->addMultiCellWidget( bbox, 0, 1, 2,2);
63 67
64 mEdit = new KLineEdit( this ); 68 mEdit = new KLineEdit( this );
65 layout->addWidget( mEdit, 1, 1 ); 69 layout->addWidget( mEdit, 1, 1 );
66 //mEdit->setMinimumWidth(50); 70 //mEdit->setMinimumWidth(50);
67 71
68// layout->addWidget( group ); 72// layout->addWidget( group );
69 73
70 } 74 }
71 else 75 else
72 { 76 {
73 QHBoxLayout *layout = new QHBoxLayout( this ); 77 Q3HBoxLayout *layout = new Q3HBoxLayout( this );
74 78
75 QGroupBox *group = new QGroupBox( 0, Qt::Vertical, title, this ); 79 Q3GroupBox *group = new Q3GroupBox( 0, Qt::Vertical, title, this );
76 QGridLayout *groupLayout = new QGridLayout( group->layout(), 2, 2, 80 Q3GridLayout *groupLayout = new Q3GridLayout( group->layout(), 2, 2,
77 KDialog::spacingHint() ); 81 KDialog::spacingHint() );
78 82
79 mBox = new QListBox( group ); 83 mBox = new Q3ListBox( group );
80 84
81 groupLayout->addWidget( mBox, 0, 0 ); 85 groupLayout->addWidget( mBox, 0, 0 );
82 86
83 KButtonBox *bbox = new KButtonBox( group, Qt::Vertical ); 87 KButtonBox *bbox = new KButtonBox( group, Qt::Vertical );
84 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); 88 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) );
85 mRemoveButton = bbox->addButton( i18n( "Remove" ), this, SLOT( remove() ) ); 89 mRemoveButton = bbox->addButton( i18n( "Remove" ), this, SLOT( remove() ) );
86 bbox->layout(); 90 bbox->layout();
87 groupLayout->addWidget( bbox, 0, 1 ); 91 groupLayout->addWidget( bbox, 0, 1 );
88 92
89 mEdit = new KLineEdit( group ); 93 mEdit = new KLineEdit( group );
90 groupLayout->addMultiCellWidget( mEdit, 1, 1, 0, 1 ); 94 groupLayout->addMultiCellWidget( mEdit, 1, 1, 0, 1 );
91 95
92 layout->addWidget( group ); 96 layout->addWidget( group );
93 97
94 } 98 }
95 99
96 mAddButton->setEnabled( false ); 100 mAddButton->setEnabled( false );
97 mRemoveButton->setEnabled( false ); 101 mRemoveButton->setEnabled( false );
98 102
99 103
100 connect( mBox, SIGNAL( selectionChanged( QListBoxItem* ) ), 104 connect( mBox, SIGNAL( selectionChanged( Q3ListBoxItem* ) ),
101 SLOT( selectionChanged( QListBoxItem* ) ) ); 105 SLOT( selectionChanged( Q3ListBoxItem* ) ) );
102 connect( mEdit, SIGNAL( textChanged( const QString& ) ), 106 connect( mEdit, SIGNAL( textChanged( const QString& ) ),
103 SLOT( textChanged( const QString& ) ) ); 107 SLOT( textChanged( const QString& ) ) );
104 connect( mEdit, SIGNAL( returnPressed() ), SLOT( add() ) ); 108 connect( mEdit, SIGNAL( returnPressed() ), SLOT( add() ) );
105 109
106} 110}
107 111
108NamePartWidget::~NamePartWidget() 112NamePartWidget::~NamePartWidget()
109{ 113{
110} 114}
111 115
112void NamePartWidget::setNameParts( const QStringList &list ) 116void NamePartWidget::setNameParts( const QStringList &list )
113{ 117{
114 mBox->clear(); 118 mBox->clear();
115 mBox->insertStringList( list ); 119 mBox->insertStringList( list );
116} 120}
117 121
118QStringList NamePartWidget::nameParts() const 122QStringList NamePartWidget::nameParts() const
119{ 123{
120 QStringList parts; 124 QStringList parts;
121 for ( uint i = 0; i < mBox->count(); ++i ) 125 for ( uint i = 0; i < mBox->count(); ++i )
122 parts.append( mBox->text( i ) ); 126 parts.append( mBox->text( i ) );
123 127
124 return parts; 128 return parts;
125} 129}
126 130
127void NamePartWidget::add() 131void NamePartWidget::add()
128{ 132{
129 if ( !mEdit->text().isEmpty() ) { 133 if ( !mEdit->text().isEmpty() ) {
130 mBox->insertItem( mEdit->text() ); 134 mBox->insertItem( mEdit->text() );
131 emit modified(); 135 emit modified();
132 } 136 }
133 137
134 mEdit->setText( "" ); 138 mEdit->setText( "" );
135} 139}
136 140
137void NamePartWidget::remove() 141void NamePartWidget::remove()
138{ 142{
139 mBox->removeItem( mBox->currentItem() ); 143 mBox->removeItem( mBox->currentItem() );
140 if ( mBox->count() == 0 ) 144 if ( mBox->count() == 0 )
141 selectionChanged( 0 ); 145 selectionChanged( 0 );
142 146
143 emit modified(); 147 emit modified();
144} 148}
145 149
146void NamePartWidget::selectionChanged( QListBoxItem *item ) 150void NamePartWidget::selectionChanged( Q3ListBoxItem *item )
147{ 151{
148 mRemoveButton->setEnabled( item != 0 ); 152 mRemoveButton->setEnabled( item != 0 );
149} 153}
150 154
151void NamePartWidget::textChanged( const QString& text ) 155void NamePartWidget::textChanged( const QString& text )
152{ 156{
153 mAddButton->setEnabled( !text.isEmpty() ); 157 mAddButton->setEnabled( !text.isEmpty() );
154} 158}
155 159
156 160
157AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) 161AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name )
158 : QWidget( parent, name ) 162 : QWidget( parent, name )
159{ 163{
160 QGridLayout *layout; 164 Q3GridLayout *layout;
161 165
162 mPrefix = new NamePartWidget( i18n( "Prefixes" ), this ); 166 mPrefix = new NamePartWidget( i18n( "Prefixes" ), this );
163 mInclusion = new NamePartWidget( i18n( "Inclusions" ), this ); 167 mInclusion = new NamePartWidget( i18n( "Inclusions" ), this );
164 mSuffix = new NamePartWidget( i18n( "Suffixes" ), this ); 168 mSuffix = new NamePartWidget( i18n( "Suffixes" ), this );
165 QString dfn; 169 QString dfn;
166 if (QApplication::desktop()->width() > 320 ) 170 if (QApplication::desktop()->width() > 320 )
167 dfn = i18n( "Default formatted name:" ); 171 dfn = i18n( "Default formatted name:" );
168 else 172 else
169 dfn = i18n( "Def. formatted name:" ); 173 dfn = i18n( "Def. formatted name:" );
170 174
171 QLabel *label = new QLabel( dfn, this ); 175 QLabel *label = new QLabel( dfn, this );
172 176
173 mFormattedNameCombo = new KComboBox( this ); 177 mFormattedNameCombo = new KComboBox( this );
174 mFormattedNameCombo->insertItem( i18n( "Empty" ) ); 178 mFormattedNameCombo->insertItem( i18n( "Empty" ) );
175 mFormattedNameCombo->insertItem( i18n( "Simple Name" ) ); 179 mFormattedNameCombo->insertItem( i18n( "Simple Name" ) );
176 mFormattedNameCombo->insertItem( i18n( "Full Name" ) ); 180 mFormattedNameCombo->insertItem( i18n( "Full Name" ) );
177 mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) ); 181 mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) );
178 182
179 if (KGlobal::getOrientation() == KGlobal::Portrait) 183 if (KGlobal::getOrientation() == KGlobal::Portrait)
180 { 184 {
181 layout = new QGridLayout( this, 4, 2, KDialog::marginHintSmall(), 185 layout = new Q3GridLayout( this, 4, 2, KDialog::marginHintSmall(),
182 KDialog::spacingHintSmall() ); 186 KDialog::spacingHintSmall() );
183 187
184 layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 ); 188 layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 );
185 layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 ); 189 layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 );
186 layout->addMultiCellWidget( mSuffix, 2, 2, 0, 1 ); 190 layout->addMultiCellWidget( mSuffix, 2, 2, 0, 1 );
187 layout->addWidget( label, 3, 0 ); 191 layout->addWidget( label, 3, 0 );
188 layout->addWidget( mFormattedNameCombo, 3, 1 ); 192 layout->addWidget( mFormattedNameCombo, 3, 1 );
189 193
190 } 194 }
191 else 195 else
192 { 196 {
193 layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), 197 layout = new Q3GridLayout( this, 2, 3, KDialog::marginHint(),
194 KDialog::spacingHint() ); 198 KDialog::spacingHint() );
195 199
196 layout->addWidget( mPrefix, 0, 0 ); 200 layout->addWidget( mPrefix, 0, 0 );
197 layout->addWidget( mInclusion, 0, 1 ); 201 layout->addWidget( mInclusion, 0, 1 );
198 layout->addWidget( mSuffix, 0, 2 ); 202 layout->addWidget( mSuffix, 0, 2 );
199 layout->addWidget( label, 1, 0 ); 203 layout->addWidget( label, 1, 0 );
200 layout->addMultiCellWidget( mFormattedNameCombo, 1, 1, 1, 2 ); 204 layout->addMultiCellWidget( mFormattedNameCombo, 1, 1, 1, 2 );
201 } 205 }
202 206
203 connect( mPrefix, SIGNAL( modified() ), SIGNAL( modified() ) ); 207 connect( mPrefix, SIGNAL( modified() ), SIGNAL( modified() ) );
204 connect( mInclusion, SIGNAL( modified() ), SIGNAL( modified() ) ); 208 connect( mInclusion, SIGNAL( modified() ), SIGNAL( modified() ) );
205 connect( mSuffix, SIGNAL( modified() ), SIGNAL( modified() ) ); 209 connect( mSuffix, SIGNAL( modified() ), SIGNAL( modified() ) );
206 connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SIGNAL( modified() ) ); 210 connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SIGNAL( modified() ) );
207} 211}
208 212
209AddresseeWidget::~AddresseeWidget() 213AddresseeWidget::~AddresseeWidget()
210{ 214{
211} 215}
212 216
213void AddresseeWidget::restoreSettings() 217void AddresseeWidget::restoreSettings()
214{ 218{
215 KConfig config( locateLocal("config", "kabcrc") ); 219 KConfig config( locateLocal("config", "kabcrc") );
216 config.setGroup( "General" ); 220 config.setGroup( "General" );
217 221
218 mPrefix->setNameParts( config.readListEntry( "Prefixes" ) ); 222 mPrefix->setNameParts( config.readListEntry( "Prefixes" ) );
219 mInclusion->setNameParts( config.readListEntry( "Inclusions" ) ); 223 mInclusion->setNameParts( config.readListEntry( "Inclusions" ) );
220 mSuffix->setNameParts( config.readListEntry( "Suffixes" ) ); 224 mSuffix->setNameParts( config.readListEntry( "Suffixes" ) );
221 mFormattedNameCombo->setCurrentItem( config.readNumEntry( "FormattedNameType", 1 ) ); 225 mFormattedNameCombo->setCurrentItem( config.readNumEntry( "FormattedNameType", 1 ) );
222} 226}
223 227
224void AddresseeWidget::saveSettings() 228void AddresseeWidget::saveSettings()
225{ 229{
226 qDebug("AddresseeWidget::saveSettings() "); 230 qDebug("AddresseeWidget::saveSettings() ");
227 KConfig config( locateLocal("config","kabcrc") ); 231 KConfig config( locateLocal("config","kabcrc") );
228 config.setGroup( "General" ); 232 config.setGroup( "General" );
229 233
230 config.writeEntry( "Prefixes", mPrefix->nameParts() ); 234 config.writeEntry( "Prefixes", mPrefix->nameParts() );
231 config.writeEntry( "Inclusions", mInclusion->nameParts() ); 235 config.writeEntry( "Inclusions", mInclusion->nameParts() );
232 config.writeEntry( "Suffixes", mSuffix->nameParts() ); 236 config.writeEntry( "Suffixes", mSuffix->nameParts() );
233 config.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); 237 config.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() );
234} 238}
235 239
236#ifndef KAB_EMBEDDED 240#ifndef KAB_EMBEDDED_
237#include "addresseewidget.moc" 241#include "moc_addresseewidget.cpp"
238#endif //KAB_EMBEDDED 242#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kcmconfigs/addresseewidget.h b/kaddressbook/kcmconfigs/addresseewidget.h
index 09330c8..f2a95a8 100644
--- a/kaddressbook/kcmconfigs/addresseewidget.h
+++ b/kaddressbook/kcmconfigs/addresseewidget.h
@@ -1,87 +1,87 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
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#ifndef ADDRESSEEWIDGET_H 24#ifndef ADDRESSEEWIDGET_H
25#define ADDRESSEEWIDGET_H 25#define ADDRESSEEWIDGET_H
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28 28
29class KComboBox; 29class KComboBox;
30class KLineEdit; 30class KLineEdit;
31 31
32class QListBox; 32class Q3ListBox;
33class QListBoxItem; 33class Q3ListBoxItem;
34class QPushButton; 34class QPushButton;
35 35
36class NamePartWidget : public QWidget 36class NamePartWidget : public QWidget
37{ 37{
38 Q_OBJECT 38 Q_OBJECT
39 39
40 public: 40 public:
41 NamePartWidget( const QString &title, QWidget *parent, 41 NamePartWidget( const QString &title, QWidget *parent,
42 const char *name = 0 ); 42 const char *name = 0 );
43 ~NamePartWidget(); 43 ~NamePartWidget();
44 44
45 void setNameParts( const QStringList &list ); 45 void setNameParts( const QStringList &list );
46 QStringList nameParts() const; 46 QStringList nameParts() const;
47 47
48 signals: 48 signals:
49 void modified(); 49 void modified();
50 50
51 private slots: 51 private slots:
52 void add(); 52 void add();
53 void remove(); 53 void remove();
54 54
55 void selectionChanged( QListBoxItem* ); 55 void selectionChanged( Q3ListBoxItem* );
56 void textChanged( const QString& ); 56 void textChanged( const QString& );
57 57
58 private: 58 private:
59 KLineEdit *mEdit; 59 KLineEdit *mEdit;
60 60
61 QListBox *mBox; 61 Q3ListBox *mBox;
62 QPushButton *mAddButton; 62 QPushButton *mAddButton;
63 QPushButton *mRemoveButton; 63 QPushButton *mRemoveButton;
64}; 64};
65 65
66class AddresseeWidget : public QWidget 66class AddresseeWidget : public QWidget
67{ 67{
68 Q_OBJECT 68 Q_OBJECT
69 69
70 public: 70 public:
71 AddresseeWidget( QWidget *parent, const char *name = 0 ); 71 AddresseeWidget( QWidget *parent, const char *name = 0 );
72 ~AddresseeWidget(); 72 ~AddresseeWidget();
73 73
74 void restoreSettings(); 74 void restoreSettings();
75 void saveSettings(); 75 void saveSettings();
76 76
77 signals: 77 signals:
78 void modified(); 78 void modified();
79 79
80 private: 80 private:
81 KComboBox *mFormattedNameCombo; 81 KComboBox *mFormattedNameCombo;
82 NamePartWidget *mPrefix; 82 NamePartWidget *mPrefix;
83 NamePartWidget *mInclusion; 83 NamePartWidget *mInclusion;
84 NamePartWidget *mSuffix; 84 NamePartWidget *mSuffix;
85}; 85};
86 86
87#endif 87#endif
diff --git a/kaddressbook/kcmconfigs/extensionconfigdialog.cpp b/kaddressbook/kcmconfigs/extensionconfigdialog.cpp
index e87b000..33b66ad 100644
--- a/kaddressbook/kcmconfigs/extensionconfigdialog.cpp
+++ b/kaddressbook/kcmconfigs/extensionconfigdialog.cpp
@@ -1,59 +1,62 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
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#include <qlayout.h> 24#include <qlayout.h>
25//Added by qt3to4:
26#include <Q3GridLayout>
27#include <Q3Frame>
25 28
26#include <klocale.h> 29#include <klocale.h>
27 30
28#include "configurewidget.h" 31#include "configurewidget.h"
29 32
30#include "extensionconfigdialog.h" 33#include "extensionconfigdialog.h"
31 34
32ExtensionConfigDialog::ExtensionConfigDialog( ExtensionFactory *factory, KConfig *config, 35ExtensionConfigDialog::ExtensionConfigDialog( ExtensionFactory *factory, KConfig *config,
33 QWidget *parent, const char *name ) 36 QWidget *parent, const char *name )
34 : KDialogBase( Plain, i18n( "Extension Settings" ), Ok | Cancel, Ok, parent, 37 : KDialogBase( Plain, i18n( "Extension Settings" ), Ok | Cancel, Ok, parent,
35 name, true, true ), mWidget( 0 ), mConfig( config ) 38 name, true, true ), mWidget( 0 ), mConfig( config )
36{ 39{
37 QFrame *page = plainPage(); 40 Q3Frame *page = plainPage();
38 QGridLayout *layout = new QGridLayout( page, 1, 1, marginHint(), spacingHint() ); 41 Q3GridLayout *layout = new Q3GridLayout( page, 1, 1, marginHint(), spacingHint() );
39 42
40 mWidget = factory->configureWidget( page, "ExtensionConfigWidget" ); 43 mWidget = factory->configureWidget( page, "ExtensionConfigWidget" );
41 layout->addWidget( mWidget, 0, 0 ); 44 layout->addWidget( mWidget, 0, 0 );
42 45
43 mWidget->restoreSettings( mConfig ); 46 mWidget->restoreSettings( mConfig );
44} 47}
45 48
46ExtensionConfigDialog::~ExtensionConfigDialog() 49ExtensionConfigDialog::~ExtensionConfigDialog()
47{ 50{
48} 51}
49 52
50void ExtensionConfigDialog::slotOk() 53void ExtensionConfigDialog::slotOk()
51{ 54{
52 mWidget->saveSettings( mConfig ); 55 mWidget->saveSettings( mConfig );
53 56
54 KDialogBase::slotOk(); 57 KDialogBase::slotOk();
55} 58}
56 59
57#ifndef KAB_EMBEDDED 60#ifndef KAB_EMBEDDED_
58#include "extensionconfigdialog.moc" 61#include "moc_extensionconfigdialog.cpp"
59#endif //KAB_EMBEDDED 62#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
index 9e4db74..d2b7ef1 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
@@ -1,424 +1,427 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
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#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qframe.h> 25#include <q3frame.h>
26#include <qgroupbox.h> 26#include <q3groupbox.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qtabwidget.h> 29#include <qtabwidget.h>
30#include <qcombobox.h> 30#include <qcombobox.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qvbox.h> 34#include <q3vbox.h>
35//Added by qt3to4:
36#include <Q3HBoxLayout>
37#include <Q3PtrList>
38#include <Q3VBoxLayout>
35 39
36#include <kconfig.h> 40#include <kconfig.h>
37#include <kdebug.h> 41#include <kdebug.h>
38#include <kdialog.h> 42#include <kdialog.h>
39#include <klistview.h> 43#include <klistview.h>
40#include <klocale.h> 44#include <klocale.h>
41#include <kglobal.h> 45#include <kglobal.h>
42#include <kmessagebox.h> 46#include <kmessagebox.h>
43#include <kstandarddirs.h> 47#include <kstandarddirs.h>
44 48
45#ifndef KAB_EMBEDDED 49#ifndef KAB_EMBEDDED
46#include <ktrader.h> 50#include <ktrader.h>
47#else // KAB_EMBEDDED 51#else // KAB_EMBEDDED
48#include <mergewidget.h> 52#include <mergewidget.h>
49#include <distributionlistwidget.h> 53#include <distributionlistwidget.h>
50#endif // KAB_EMBEDDED 54#endif // KAB_EMBEDDED
51 55
52#include "addresseewidget.h" 56#include "addresseewidget.h"
53#include "extensionconfigdialog.h" 57#include "extensionconfigdialog.h"
54#include "extensionwidget.h" 58#include "extensionwidget.h"
55#include "kabprefs.h" 59#include "kabprefs.h"
56 60
57#include "kabconfigwidget.h" 61#include "kabconfigwidget.h"
58#include <kglobalsettings.h> 62#include <kglobalsettings.h>
59 63
60class ExtensionItem : public QCheckListItem 64class ExtensionItem : public Q3CheckListItem
61{ 65{
62 public: 66 public:
63 67
64#ifndef KAB_EMBEDDED 68#ifndef KAB_EMBEDDED
65 ExtensionItem( QListView *parent, const QString &text ); 69 ExtensionItem( Q3ListView *parent, const QString &text );
66 void setService( const KService::Ptr &ptr ); 70 void setService( const KService::Ptr &ptr );
67#else //KAB_EMBEDDED 71#else //KAB_EMBEDDED
68 ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ); 72 ExtensionItem( Q3ListView *parent, const QString &text, const QString &name, const QString &comment );
69 void setFactory( ExtensionFactory* fac ); 73 void setFactory( ExtensionFactory* fac );
70#endif //KAB_EMBEDDED 74#endif //KAB_EMBEDDED
71 75
72 bool configWidgetAvailable() const; 76 bool configWidgetAvailable() const;
73 ExtensionFactory *factory() const; 77 ExtensionFactory *factory() const;
74 78
75 virtual QString text( int column ) const; 79 virtual QString text( int column ) const;
76 80
77 private: 81 private:
78#ifndef KAB_EMBEDDED 82#ifndef KAB_EMBEDDED
79 KService::Ptr mPtr; 83 KService::Ptr mPtr;
80#else //KAB_EMBEDDED 84#else //KAB_EMBEDDED
81 ExtensionFactory* mFactory; 85 ExtensionFactory* mFactory;
82 QString mName; 86 QString mName;
83 QString mComment; 87 QString mComment;
84 88
85#endif //KAB_EMBEDDED 89#endif //KAB_EMBEDDED
86 90
87}; 91};
88 92
89KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name ) 93KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name )
90 : KPrefsWidget( prefs, parent, name ) 94 : KPrefsWidget( prefs, parent, name )
91{ 95{
92 96
93 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 97 Q3VBoxLayout *topLayout = new Q3VBoxLayout( this, 0,
94 KDialog::spacingHintSmall() ); 98 KDialog::spacingHintSmall() );
95 99
96 QTabWidget *tabWidget = new QTabWidget( this ); 100 QTabWidget *tabWidget = new QTabWidget( this );
97 topLayout->addWidget( tabWidget ); 101 topLayout->addWidget( tabWidget );
98 102
99 // General page 103 // General page
100 QWidget *generalPage = new QWidget( this ); 104 QWidget *generalPage = new QWidget( this );
101 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(), 105 Q3VBoxLayout *layout = new Q3VBoxLayout( generalPage, KDialog::marginHintSmall(),
102 KDialog::spacingHintSmall() ); 106 KDialog::spacingHintSmall() );
103 107
104 108
105 QWidget *hBox = new QWidget( generalPage, "qhbox" ); 109 QWidget *hBox = new QWidget( generalPage, "qhbox" );
106 QHBoxLayout *hboxLayout = new QHBoxLayout( hBox); 110 Q3HBoxLayout *hboxLayout = new Q3HBoxLayout( hBox);
107 KPrefsWidFont *detailsFont = 111 KPrefsWidFont *detailsFont =
108 addWidFont(i18n("phone:123"),i18n("Details view font"), 112 addWidFont(i18n("phone:123"),i18n("Details view font"),
109 &(KABPrefs::instance()->mDetailsFont),hBox); 113 &(KABPrefs::instance()->mDetailsFont),hBox);
110 hboxLayout->addWidget(detailsFont->label()); 114 hboxLayout->addWidget(detailsFont->label());
111 hboxLayout->addWidget(detailsFont->preview()); 115 hboxLayout->addWidget(detailsFont->preview());
112 hboxLayout->addWidget(detailsFont->button()); 116 hboxLayout->addWidget(detailsFont->button());
113 hboxLayout->setMargin(KDialog::marginHintSmall() ); 117 hboxLayout->setMargin(KDialog::marginHintSmall() );
114 hboxLayout->setSpacing(KDialog::spacingHintSmall()); 118 hboxLayout->setSpacing(KDialog::spacingHintSmall());
115 //hBox->setBackgroundColor( black); 119 //hBox->setBackgroundColor( black);
116 layout->addWidget( hBox ); 120 layout->addWidget( hBox );
117 121
118 //general groupbox 122 //general groupbox
119 QWidget *vBox = new QWidget( generalPage, "qvbox" ); 123 QWidget *vBox = new QWidget( generalPage, "qvbox" );
120 QVBoxLayout *boxLayout = new QVBoxLayout( vBox ); 124 Q3VBoxLayout *boxLayout = new Q3VBoxLayout( vBox );
121 boxLayout->setAlignment( Qt::AlignTop ); 125 boxLayout->setAlignment( Qt::AlignTop );
122 boxLayout->setMargin(KDialog::marginHintSmall() ); 126 boxLayout->setMargin(KDialog::marginHintSmall() );
123 boxLayout->setSpacing( KDialog::spacingHintSmall() ); 127 boxLayout->setSpacing( KDialog::spacingHintSmall() );
124 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" ); 128 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" );
125 boxLayout->addWidget( mMenuBarBox ); 129 boxLayout->addWidget( mMenuBarBox );
126 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" ); 130 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" );
127 boxLayout->addWidget( mSearchReturnBox ); 131 boxLayout->addWidget( mSearchReturnBox );
128 mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" ); 132 mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" );
129 boxLayout->addWidget( mAutoSearchWithWildcardBox); 133 boxLayout->addWidget( mAutoSearchWithWildcardBox);
130 mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" ); 134 mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" );
131 boxLayout->addWidget( mHideSearchOnSwitchBox ); 135 boxLayout->addWidget( mHideSearchOnSwitchBox );
132 136
133#ifdef DESKTOP_VERSION 137#ifdef DESKTOP_VERSION
134 mHideSearchOnSwitchBox->hide(); 138 mHideSearchOnSwitchBox->hide();
135#endif 139#endif
136 mViewsSingleClickBox = new QCheckBox( i18n( "Show edit dialog on single click" ), vBox, "msingle" ); 140 mViewsSingleClickBox = new QCheckBox( i18n( "Show edit dialog on single click" ), vBox, "msingle" );
137 boxLayout->addWidget( mViewsSingleClickBox ); 141 boxLayout->addWidget( mViewsSingleClickBox );
138 142
139 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new contacts" ), vBox, "mparse" ); 143 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new contacts" ), vBox, "mparse" );
140 boxLayout->addWidget( mNameParsing ); 144 boxLayout->addWidget( mNameParsing );
141 145
142 mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" ); 146 mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" );
143 boxLayout->addWidget( mMultipleViewsAtOnce ); 147 boxLayout->addWidget( mMultipleViewsAtOnce );
144 148
145 mAskForDelete = new QCheckBox( i18n( "Ask before delete contact" ), vBox, "mdel" ); 149 mAskForDelete = new QCheckBox( i18n( "Ask before delete contact" ), vBox, "mdel" );
146 boxLayout->addWidget( mAskForDelete ); 150 boxLayout->addWidget( mAskForDelete );
147 151
148 mAskForQuit = new QCheckBox( i18n( "Show exit confirmation" ), vBox, "mquit" ); 152 mAskForQuit = new QCheckBox( i18n( "Show exit confirmation" ), vBox, "mquit" );
149 boxLayout->addWidget( mAskForQuit ); 153 boxLayout->addWidget( mAskForQuit );
150 154
151 layout->addWidget( vBox ); 155 layout->addWidget( vBox );
152 156
153 tabWidget->addTab( generalPage, i18n( "General" ) ); 157 tabWidget->addTab( generalPage, i18n( "General" ) );
154 158
155 // Extension page 159 // Extension page
156 QWidget *extensionPage = new QWidget( this ); 160 QWidget *extensionPage = new QWidget( this );
157 QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(), 161 Q3VBoxLayout *extensionLayout = new Q3VBoxLayout( extensionPage, KDialog::marginHintSmall(),
158 KDialog::spacingHintSmall() ); 162 KDialog::spacingHintSmall() );
159 163
160 //extensions groupbox 164 //extensions groupbox
161 165
162 QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage ); 166 Q3GroupBox* groupBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage );
163 boxLayout = new QVBoxLayout( groupBox->layout() ); 167 boxLayout = new Q3VBoxLayout( groupBox->layout() );
164 boxLayout->setAlignment( Qt::AlignTop ); 168 boxLayout->setAlignment( Qt::AlignTop );
165 boxLayout->setMargin(KDialog::marginHintSmall()); 169 boxLayout->setMargin(KDialog::marginHintSmall());
166 boxLayout->setSpacing(KDialog::spacingHintSmall()); 170 boxLayout->setSpacing(KDialog::spacingHintSmall());
167 groupBox->layout()->setMargin(1) ; 171 groupBox->layout()->setMargin(1) ;
168 groupBox->layout()->setSpacing(0); 172 groupBox->layout()->setSpacing(0);
169 mExtensionView = new KListView( groupBox ); 173 mExtensionView = new KListView( groupBox );
170 mExtensionView->setAllColumnsShowFocus( true ); 174 mExtensionView->setAllColumnsShowFocus( true );
171 mExtensionView->addColumn( i18n( "Name" ) ); 175 mExtensionView->addColumn( i18n( "Name" ) );
172 mExtensionView->addColumn( i18n( "Description" ) ); 176 mExtensionView->addColumn( i18n( "Description" ) );
173 //mExtensionView->setMaximumHeight(80); 177 //mExtensionView->setMaximumHeight(80);
174 178
175 boxLayout->addWidget( mExtensionView ); 179 boxLayout->addWidget( mExtensionView );
176 180
177 mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); 181 mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox );
178 mConfigureButton->setEnabled( false ); 182 mConfigureButton->setEnabled( false );
179 boxLayout->addWidget( mConfigureButton ); 183 boxLayout->addWidget( mConfigureButton );
180 184
181 extensionLayout->addWidget( groupBox ); 185 extensionLayout->addWidget( groupBox );
182 186
183 connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 187 connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
184 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 188 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
185 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 189 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
186 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 190 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
187 connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 191 connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
188 connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 192 connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
189 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 193 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
190 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 194 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
191 connect( mAskForDelete, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 195 connect( mAskForDelete, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
192 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), 196 connect( mExtensionView, SIGNAL( selectionChanged( Q3ListViewItem* ) ),
193 SLOT( selectionChanged( QListViewItem* ) ) ); 197 SLOT( selectionChanged( Q3ListViewItem* ) ) );
194 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), 198 connect( mExtensionView, SIGNAL( clicked( Q3ListViewItem* ) ),
195 SLOT( itemClicked( QListViewItem* ) ) ); 199 SLOT( itemClicked( Q3ListViewItem* ) ) );
196 connect( mConfigureButton, SIGNAL( clicked() ), 200 connect( mConfigureButton, SIGNAL( clicked() ),
197 SLOT( configureExtension() ) ); 201 SLOT( configureExtension() ) );
198 202
199 tabWidget->addTab( extensionPage, i18n( "Extensions" ) ); 203 tabWidget->addTab( extensionPage, i18n( "Extensions" ) );
200 204
201 // Addressee page 205 // Addressee page
202 mAddresseeWidget = new AddresseeWidget( this ); 206 mAddresseeWidget = new AddresseeWidget( this );
203 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); 207 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) );
204 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); 208 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) );
205 209
206} 210}
207 211
208void KABConfigWidget::usrReadConfig() 212void KABConfigWidget::usrReadConfig()
209{ 213{
210 KABPrefs* prefs = KABPrefs::instance(); 214 KABPrefs* prefs = KABPrefs::instance();
211 215
212 bool blocked = signalsBlocked(); 216 bool blocked = signalsBlocked();
213 blockSignals( true ); 217 blockSignals( true );
214 mMenuBarBox->setChecked( prefs->mFullMenuBarVisible); 218 mMenuBarBox->setChecked( prefs->mFullMenuBarVisible);
215 mNameParsing->setChecked( prefs->mAutomaticNameParsing ); 219 mNameParsing->setChecked( prefs->mAutomaticNameParsing );
216 mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); 220 mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick );
217 mSearchReturnBox->setChecked( prefs->mSearchWithReturn ); 221 mSearchReturnBox->setChecked( prefs->mSearchWithReturn );
218 mAutoSearchWithWildcardBox->setChecked( prefs->mAutoSearchWithWildcard ); 222 mAutoSearchWithWildcardBox->setChecked( prefs->mAutoSearchWithWildcard );
219 mHideSearchOnSwitchBox->setChecked( prefs->mHideSearchOnSwitch ); 223 mHideSearchOnSwitchBox->setChecked( prefs->mHideSearchOnSwitch );
220 mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); 224 mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce );
221 mAskForQuit->setChecked( prefs->mAskForQuit ); 225 mAskForQuit->setChecked( prefs->mAskForQuit );
222 mAskForDelete->setChecked( prefs->mAskForDelete ); 226 mAskForDelete->setChecked( prefs->mAskForDelete );
223 227
224 mAddresseeWidget->restoreSettings(); 228 mAddresseeWidget->restoreSettings();
225 229
226 restoreExtensionSettings(); 230 restoreExtensionSettings();
227 231
228 blockSignals( blocked ); 232 blockSignals( blocked );
229 233
230} 234}
231 235
232void KABConfigWidget::usrWriteConfig() 236void KABConfigWidget::usrWriteConfig()
233{ 237{
234 KABPrefs* prefs = KABPrefs::instance(); 238 KABPrefs* prefs = KABPrefs::instance();
235 prefs->mFullMenuBarVisible = mMenuBarBox->isChecked(); 239 prefs->mFullMenuBarVisible = mMenuBarBox->isChecked();
236 prefs->mAutomaticNameParsing = mNameParsing->isChecked(); 240 prefs->mAutomaticNameParsing = mNameParsing->isChecked();
237 prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); 241 prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked();
238 prefs->mSearchWithReturn = mSearchReturnBox->isChecked(); 242 prefs->mSearchWithReturn = mSearchReturnBox->isChecked();
239 prefs->mAutoSearchWithWildcard = mAutoSearchWithWildcardBox->isChecked(); 243 prefs->mAutoSearchWithWildcard = mAutoSearchWithWildcardBox->isChecked();
240 prefs->mHideSearchOnSwitch = mHideSearchOnSwitchBox->isChecked(); 244 prefs->mHideSearchOnSwitch = mHideSearchOnSwitchBox->isChecked();
241 245
242 prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); 246 prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked();
243 prefs->mAskForQuit = mAskForQuit->isChecked(); 247 prefs->mAskForQuit = mAskForQuit->isChecked();
244 prefs->mAskForDelete = mAskForDelete->isChecked(); 248 prefs->mAskForDelete = mAskForDelete->isChecked();
245 249
246 mAddresseeWidget->saveSettings(); 250 mAddresseeWidget->saveSettings();
247 251
248 saveExtensionSettings(); 252 saveExtensionSettings();
249 253
250} 254}
251 255
252void KABConfigWidget::restoreExtensionSettings() 256void KABConfigWidget::restoreExtensionSettings()
253{ 257{
254 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; 258 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions;
255 259
256 mExtensionView->clear(); 260 mExtensionView->clear();
257 261
258#ifndef KAB_EMBEDDED 262#ifndef KAB_EMBEDDED
259 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); 263 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" );
260 KTrader::OfferList::ConstIterator it; 264 KTrader::OfferList::ConstIterator it;
261 for ( it = plugins.begin(); it != plugins.end(); ++it ) { 265 for ( it = plugins.begin(); it != plugins.end(); ++it ) {
262 if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) 266 if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) )
263 continue; 267 continue;
264 268
265 ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() ); 269 ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() );
266 item->setService( *it ); 270 item->setService( *it );
267 if ( activeExtensions.contains( item->factory()->identifier() ) ) 271 if ( activeExtensions.contains( item->factory()->identifier() ) )
268 item->setOn( true ); 272 item->setOn( true );
269 } 273 }
270#else //KAB_EMBEDDED 274#else //KAB_EMBEDDED
271 ExtensionFactory *extensionFactory = new MergeFactory(); 275 ExtensionFactory *extensionFactory = new MergeFactory();
272 276
273 ExtensionItem *item = new ExtensionItem( mExtensionView, "Merge", "Merge", "Merge contacts"); 277 ExtensionItem *item = new ExtensionItem( mExtensionView, "Merge", "Merge", "Merge contacts");
274 278
275 item->setFactory( extensionFactory ); 279 item->setFactory( extensionFactory );
276 if ( activeExtensions.contains( extensionFactory->identifier() ) ) 280 if ( activeExtensions.contains( extensionFactory->identifier() ) )
277 item->setOn( true ); 281 item->setOn( true );
278 282
279 283
280 284
281 extensionFactory = new DistributionListFactory(); 285 extensionFactory = new DistributionListFactory();
282 286
283 item = new ExtensionItem( mExtensionView, "Distribution List", "Distribution List", "Manage Distribution Lists"); 287 item = new ExtensionItem( mExtensionView, "Distribution List", "Distribution List", "Manage Distribution Lists");
284 288
285 item->setFactory( extensionFactory ); 289 item->setFactory( extensionFactory );
286 if ( activeExtensions.contains( extensionFactory->identifier() ) ) 290 if ( activeExtensions.contains( extensionFactory->identifier() ) )
287 item->setOn( true ); 291 item->setOn( true );
288 292
289 293
290#endif //KAB_EMBEDDED 294#endif //KAB_EMBEDDED
291 295
292} 296}
293 297
294void KABConfigWidget::saveExtensionSettings() 298void KABConfigWidget::saveExtensionSettings()
295{ 299{
296 QStringList activeExtensions; 300 QStringList activeExtensions;
297 301
298 QPtrList<QListViewItem> list; 302 Q3PtrList<Q3ListViewItem> list;
299 QListViewItemIterator it( mExtensionView ); 303 Q3ListViewItemIterator it( mExtensionView );
300 while ( it.current() ) { 304 while ( it.current() ) {
301 ExtensionItem *item = static_cast<ExtensionItem*>( it.current() ); 305 ExtensionItem *item = static_cast<ExtensionItem*>( it.current() );
302 if ( item ) { 306 if ( item ) {
303 if ( item->isOn() ) 307 if ( item->isOn() )
304 activeExtensions.append( item->factory()->identifier() ); 308 activeExtensions.append( item->factory()->identifier() );
305 } 309 }
306 ++it; 310 ++it;
307 } 311 }
308 312
309 KABPrefs::instance()->mActiveExtensions = activeExtensions; 313 KABPrefs::instance()->mActiveExtensions = activeExtensions;
310} 314}
311 315
312void KABConfigWidget::configureExtension() 316void KABConfigWidget::configureExtension()
313{ 317{
314 ExtensionItem *item = static_cast<ExtensionItem*>( mExtensionView->currentItem() ); 318 ExtensionItem *item = static_cast<ExtensionItem*>( mExtensionView->currentItem() );
315 if ( !item ) 319 if ( !item )
316 return; 320 return;
317 321
318#ifndef KAB_EMBEDDED 322#ifndef KAB_EMBEDDED
319 KConfig config( "kaddressbookrc" ); 323 KConfig config( "kaddressbookrc" );
320#else //KAB_EMBEDDED 324#else //KAB_EMBEDDED
321 KConfig config( locateLocal("config", "kaddressbookrc") ); 325 KConfig config( locateLocal("config", "kaddressbookrc") );
322#endif //KAB_EMBEDDED 326#endif //KAB_EMBEDDED
323 config.setGroup( QString( "Extensions_%1" ).arg( item->factory()->identifier() ) ); 327 config.setGroup( QString( "Extensions_%1" ).arg( item->factory()->identifier() ) );
324 328
325 ExtensionConfigDialog dlg( item->factory(), &config, this ); 329 ExtensionConfigDialog dlg( item->factory(), &config, this );
326 dlg.exec(); 330 dlg.exec();
327 331
328 config.sync(); 332 config.sync();
329} 333}
330 334
331void KABConfigWidget::selectionChanged( QListViewItem *i ) 335void KABConfigWidget::selectionChanged( Q3ListViewItem *i )
332{ 336{
333 ExtensionItem *item = static_cast<ExtensionItem*>( i ); 337 ExtensionItem *item = static_cast<ExtensionItem*>( i );
334 if ( !item ) 338 if ( !item )
335 return; 339 return;
336 340
337 mConfigureButton->setEnabled( item->configWidgetAvailable() ); 341 mConfigureButton->setEnabled( item->configWidgetAvailable() );
338} 342}
339 343
340void KABConfigWidget::itemClicked( QListViewItem *item ) 344void KABConfigWidget::itemClicked( Q3ListViewItem *item )
341{ 345{
342 if ( item != 0 ) 346 if ( item != 0 )
343 modified(); 347 modified();
344} 348}
345 349
346#ifndef KAB_EMBEDDED 350#ifndef KAB_EMBEDDED
347ExtensionItem::ExtensionItem( QListView *parent, const QString &text ) 351ExtensionItem::ExtensionItem( Q3ListView *parent, const QString &text )
348 : QCheckListItem( parent, text, CheckBox ) 352 : Q3CheckListItem( parent, text, CheckBox )
349{ 353{
350} 354}
351 355
352void ExtensionItem::setService( const KService::Ptr &ptr ) 356void ExtensionItem::setService( const KService::Ptr &ptr )
353{ 357{
354 mPtr = ptr; 358 mPtr = ptr;
355} 359}
356#else //KAB_EMBEDDED 360#else //KAB_EMBEDDED
357ExtensionItem::ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ) 361ExtensionItem::ExtensionItem( Q3ListView *parent, const QString &text, const QString &name, const QString &comment )
358 : QCheckListItem( parent, text, CheckBox ) 362 : Q3CheckListItem( parent, text, CheckBox )
359{ 363{
360 mName = name; 364 mName = name;
361 mComment = comment; 365 mComment = comment;
362} 366}
363 367
364 368
365void ExtensionItem::setFactory( ExtensionFactory* fac ) 369void ExtensionItem::setFactory( ExtensionFactory* fac )
366{ 370{
367 mFactory = fac; 371 mFactory = fac;
368} 372}
369#endif //KAB_EMBEDDED 373#endif //KAB_EMBEDDED
370 374
371bool ExtensionItem::configWidgetAvailable() const 375bool ExtensionItem::configWidgetAvailable() const
372{ 376{
373#ifndef KAB_EMBEDDED 377#ifndef KAB_EMBEDDED
374 KLibFactory *factory = KLibLoader::self()->factory( mPtr->library().latin1() ); 378 KLibFactory *factory = KLibLoader::self()->factory( mPtr->library().latin1() );
375 if ( !factory ) 379 if ( !factory )
376 return false; 380 return false;
377 381
378 ExtensionFactory *extensionFactory = static_cast<ExtensionFactory*>( factory ); 382 ExtensionFactory *extensionFactory = static_cast<ExtensionFactory*>( factory );
379 if ( !extensionFactory ) 383 if ( !extensionFactory )
380 return false; 384 return false;
381 385
382 return extensionFactory->configureWidgetAvailable(); 386 return extensionFactory->configureWidgetAvailable();
383#else //KAB_EMBEDDED 387#else //KAB_EMBEDDED
384 return mFactory->configureWidgetAvailable(); 388 return mFactory->configureWidgetAvailable();
385#endif //KAB_EMBEDDED 389#endif //KAB_EMBEDDED
386 390
387} 391}
388 392
389ExtensionFactory *ExtensionItem::factory() const 393ExtensionFactory *ExtensionItem::factory() const
390{ 394{
391#ifndef KAB_EMBEDDED 395#ifndef KAB_EMBEDDED
392 KLibFactory *factory = KLibLoader::self()->factory( mPtr->library().latin1() ); 396 KLibFactory *factory = KLibLoader::self()->factory( mPtr->library().latin1() );
393 if ( !factory ) 397 if ( !factory )
394 return 0; 398 return 0;
395 399
396 return static_cast<ExtensionFactory*>( factory ); 400 return static_cast<ExtensionFactory*>( factory );
397#else //KAB_EMBEDDED 401#else //KAB_EMBEDDED
398 return mFactory; 402 return mFactory;
399#endif //KAB_EMBEDDED 403#endif //KAB_EMBEDDED
400} 404}
401 405
402QString ExtensionItem::text( int column ) const 406QString ExtensionItem::text( int column ) const
403{ 407{
404#ifndef KAB_EMBEDDED 408#ifndef KAB_EMBEDDED
405 if ( column == 0 ) 409 if ( column == 0 )
406 return mPtr->name(); 410 return mPtr->name();
407 else if ( column == 1 ) 411 else if ( column == 1 )
408 return mPtr->comment(); 412 return mPtr->comment();
409 else 413 else
410 return QString::null; 414 return QString::null;
411#else //KAB_EMBEDDED 415#else //KAB_EMBEDDED
412 if ( column == 0 ) 416 if ( column == 0 )
413 return mName; 417 return mName;
414 else if ( column == 1 ) 418 else if ( column == 1 )
415 return mComment; 419 return mComment;
416 else 420 else
417 return QString::null; 421 return QString::null;
418#endif //KAB_EMBEDDED 422#endif //KAB_EMBEDDED
419} 423}
420 424
421#ifndef KAB_EMBEDDED 425#ifndef KAB_EMBEDDED_
422#include "kabconfigwidget.moc" 426#include "moc_kabconfigwidget.cpp"
423#endif //KAB_EMBEDDED 427#endif //KAB_EMBEDDED
424
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h
index f2a6b1b..4b6e58c 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.h
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.h
@@ -1,78 +1,78 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
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#ifndef KABCONFIGWIDGET_H 24#ifndef KABCONFIGWIDGET_H
25#define KABCONFIGWIDGET_H 25#define KABCONFIGWIDGET_H
26 26
27#include <kprefswidget.h> 27#include <kprefswidget.h>
28 28
29class QCheckBox; 29class QCheckBox;
30class QListViewItem; 30class Q3ListViewItem;
31class QPushButton; 31class QPushButton;
32class QComboBox; 32class QComboBox;
33class QLineEdit; 33class QLineEdit;
34class KListView; 34class KListView;
35class KABPrefs; 35class KABPrefs;
36 36
37class AddresseeWidget; 37class AddresseeWidget;
38 38
39class KABConfigWidget : public KPrefsWidget 39class KABConfigWidget : public KPrefsWidget
40{ 40{
41 Q_OBJECT 41 Q_OBJECT
42 42
43 public: 43 public:
44 KABConfigWidget(KABPrefs *prefs, QWidget *parent, const char *name = 0 ); 44 KABConfigWidget(KABPrefs *prefs, QWidget *parent, const char *name = 0 );
45 45
46 protected: 46 protected:
47 /** Implement this to read custom configuration widgets. */ 47 /** Implement this to read custom configuration widgets. */
48 virtual void usrReadConfig(); 48 virtual void usrReadConfig();
49 /** Implement this to write custom configuration widgets. */ 49 /** Implement this to write custom configuration widgets. */
50 virtual void usrWriteConfig(); 50 virtual void usrWriteConfig();
51 51
52 52
53 53
54 private slots: 54 private slots:
55 void configureExtension(); 55 void configureExtension();
56 void selectionChanged( QListViewItem* ); 56 void selectionChanged( Q3ListViewItem* );
57 void itemClicked( QListViewItem* ); 57 void itemClicked( Q3ListViewItem* );
58 58
59 private: 59 private:
60 void restoreExtensionSettings(); 60 void restoreExtensionSettings();
61 void saveExtensionSettings(); 61 void saveExtensionSettings();
62 62
63 KListView *mExtensionView; 63 KListView *mExtensionView;
64 QCheckBox *mSearchReturnBox; 64 QCheckBox *mSearchReturnBox;
65 QCheckBox *mNameParsing; 65 QCheckBox *mNameParsing;
66 QCheckBox *mViewsSingleClickBox; 66 QCheckBox *mViewsSingleClickBox;
67 QCheckBox *mAutoSearchWithWildcardBox; 67 QCheckBox *mAutoSearchWithWildcardBox;
68 QCheckBox *mHideSearchOnSwitchBox; 68 QCheckBox *mHideSearchOnSwitchBox;
69 QCheckBox *mMultipleViewsAtOnce; 69 QCheckBox *mMultipleViewsAtOnce;
70 QCheckBox *mAskForQuit; 70 QCheckBox *mAskForQuit;
71 QCheckBox *mMenuBarBox; 71 QCheckBox *mMenuBarBox;
72 QCheckBox *mAskForDelete; 72 QCheckBox *mAskForDelete;
73 QPushButton *mConfigureButton; 73 QPushButton *mConfigureButton;
74 74
75 AddresseeWidget *mAddresseeWidget; 75 AddresseeWidget *mAddresseeWidget;
76}; 76};
77 77
78#endif 78#endif
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.cpp b/kaddressbook/kcmconfigs/kcmkabconfig.cpp
index cbfedbd..55ffcd8 100644
--- a/kaddressbook/kcmconfigs/kcmkabconfig.cpp
+++ b/kaddressbook/kcmconfigs/kcmkabconfig.cpp
@@ -1,92 +1,94 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
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#include <qlayout.h> 24#include <qlayout.h>
25//Added by qt3to4:
26#include <Q3VBoxLayout>
25 27
26#ifndef KAB_EMBEDDED 28#ifndef KAB_EMBEDDED
27#include <kaboutdata.h> 29#include <kaboutdata.h>
28#endif //KAB_EMBEDDED 30#endif //KAB_EMBEDDED
29#include <kdebug.h> 31#include <kdebug.h>
30//#include <klocale.h> 32//#include <klocale.h>
31//#include <stdlib.h> 33//#include <stdlib.h>
32 34
33#include "kabconfigwidget.h" 35#include "kabconfigwidget.h"
34 36
35#include "kcmkabconfig.h" 37#include "kcmkabconfig.h"
36 38
37#include "kabprefs.h" 39#include "kabprefs.h"
38#include "kprefs.h" 40#include "kprefs.h"
39 41
40extern "C" 42extern "C"
41{ 43{
42 KCModule *create_kabconfig( QWidget *parent, const char * ) { 44 KCModule *create_kabconfig( QWidget *parent, const char * ) {
43 return new KCMKabConfig( parent, "kcmkabconfig" ); 45 return new KCMKabConfig( parent, "kcmkabconfig" );
44 } 46 }
45} 47}
46 48
47KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) 49KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name )
48 : KCModule( KABPrefs::instance(), parent, name ) 50 : KCModule( KABPrefs::instance(), parent, name )
49{ 51{
50 //abort(); 52 //abort();
51 QVBoxLayout *layout = new QVBoxLayout( this ); 53 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
52 mConfigWidget = new KABConfigWidget( (KABPrefs*)getPreferences(), this, "KABConfigWidget" ); 54 mConfigWidget = new KABConfigWidget( (KABPrefs*)getPreferences(), this, "KABConfigWidget" );
53 layout->addWidget( mConfigWidget ); 55 layout->addWidget( mConfigWidget );
54 layout->setSpacing( 0 ); 56 layout->setSpacing( 0 );
55 layout->setMargin( 0 ); 57 layout->setMargin( 0 );
56 58
57 connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); 59 connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) );
58} 60}
59 61
60void KCMKabConfig::load() 62void KCMKabConfig::load()
61{ 63{
62 mConfigWidget->readConfig(); 64 mConfigWidget->readConfig();
63} 65}
64 66
65void KCMKabConfig::save() 67void KCMKabConfig::save()
66{ 68{
67 mConfigWidget->writeConfig(); 69 mConfigWidget->writeConfig();
68} 70}
69 71
70void KCMKabConfig::defaults() 72void KCMKabConfig::defaults()
71{ 73{
72 mConfigWidget->setDefaults(); 74 mConfigWidget->setDefaults();
73} 75}
74 76
75#ifndef KAB_EMBEDDED 77#ifndef KAB_EMBEDDED
76const KAboutData* KCMKabConfig::aboutData() const 78const KAboutData* KCMKabConfig::aboutData() const
77{ 79{
78 KAboutData *about = new KAboutData( I18N_NOOP( "kcmkabconfig" ), 80 KAboutData *about = new KAboutData( I18N_NOOP( "kcmkabconfig" ),
79 I18N_NOOP( "KAddressBook Configure Dialog" ), 81 I18N_NOOP( "KAddressBook Configure Dialog" ),
80 0, 0, KAboutData::License_GPL, 82 0, 0, KAboutData::License_GPL,
81 I18N_NOOP( "(c), 2003 Tobias Koenig" ) ); 83 I18N_NOOP( "(c), 2003 Tobias Koenig" ) );
82 84
83 about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" ); 85 about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" );
84 86
85 return about; 87 return about;
86 88
87} 89}
88#endif //KAB_EMBEDDED 90#endif //KAB_EMBEDDED
89 91
90#ifndef KAB_EMBEDDED 92#ifndef KAB_EMBEDDED_
91#include "kcmkabconfig.moc" 93#include "moc_kcmkabconfig.cpp"
92#endif //KAB_EMBEDDED 94#endif //KAB_EMBEDDED