-rw-r--r-- | kaddressbook/kcmconfigs/addresseewidget.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/kaddressbook/kcmconfigs/addresseewidget.cpp b/kaddressbook/kcmconfigs/addresseewidget.cpp index eb5bdd9..168d39e 100644 --- a/kaddressbook/kcmconfigs/addresseewidget.cpp +++ b/kaddressbook/kcmconfigs/addresseewidget.cpp | |||
@@ -157,87 +157,82 @@ void NamePartWidget::textChanged( const QString& text ) | |||
157 | AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) | 157 | AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) |
158 | : QWidget( parent, name ) | 158 | : QWidget( parent, name ) |
159 | { | 159 | { |
160 | QGridLayout *layout; | 160 | QGridLayout *layout; |
161 | 161 | ||
162 | mPrefix = new NamePartWidget( i18n( "Prefixes" ), this ); | 162 | mPrefix = new NamePartWidget( i18n( "Prefixes" ), this ); |
163 | mInclusion = new NamePartWidget( i18n( "Inclusions" ), this ); | 163 | mInclusion = new NamePartWidget( i18n( "Inclusions" ), this ); |
164 | mSuffix = new NamePartWidget( i18n( "Suffixes" ), this ); | 164 | mSuffix = new NamePartWidget( i18n( "Suffixes" ), this ); |
165 | QString dfn; | 165 | QString dfn; |
166 | if (QApplication::desktop()->width() > 320 ) | 166 | if (QApplication::desktop()->width() > 320 ) |
167 | dfn = i18n( "Default formatted name:" ); | 167 | dfn = i18n( "Default formatted name:" ); |
168 | else | 168 | else |
169 | dfn = i18n( "Def. formatted name:" ); | 169 | dfn = i18n( "Def. formatted name:" ); |
170 | 170 | ||
171 | QLabel *label = new QLabel( dfn, this ); | 171 | QLabel *label = new QLabel( dfn, this ); |
172 | 172 | ||
173 | mFormattedNameCombo = new KComboBox( this ); | 173 | mFormattedNameCombo = new KComboBox( this ); |
174 | mFormattedNameCombo->insertItem( i18n( "Empty" ) ); | 174 | mFormattedNameCombo->insertItem( i18n( "Empty" ) ); |
175 | mFormattedNameCombo->insertItem( i18n( "Simple Name" ) ); | 175 | mFormattedNameCombo->insertItem( i18n( "Simple Name" ) ); |
176 | mFormattedNameCombo->insertItem( i18n( "Full Name" ) ); | 176 | mFormattedNameCombo->insertItem( i18n( "Full Name" ) ); |
177 | mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) ); | 177 | mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) ); |
178 | 178 | ||
179 | if (KGlobal::getOrientation() == KGlobal::Portrait) | 179 | if (KGlobal::getOrientation() == KGlobal::Portrait) |
180 | { | 180 | { |
181 | layout = new QGridLayout( this, 4, 2, KDialog::marginHintSmall(), | 181 | layout = new QGridLayout( this, 4, 2, KDialog::marginHintSmall(), |
182 | KDialog::spacingHintSmall() ); | 182 | KDialog::spacingHintSmall() ); |
183 | 183 | ||
184 | layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 ); | 184 | layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 ); |
185 | layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 ); | 185 | layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 ); |
186 | layout->addMultiCellWidget( mSuffix, 2, 2, 0, 1 ); | 186 | layout->addMultiCellWidget( mSuffix, 2, 2, 0, 1 ); |
187 | layout->addWidget( label, 3, 0 ); | 187 | layout->addWidget( label, 3, 0 ); |
188 | layout->addWidget( mFormattedNameCombo, 3, 1 ); | 188 | layout->addWidget( mFormattedNameCombo, 3, 1 ); |
189 | 189 | ||
190 | } | 190 | } |
191 | else | 191 | else |
192 | { | 192 | { |
193 | layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), | 193 | layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), |
194 | KDialog::spacingHint() ); | 194 | KDialog::spacingHint() ); |
195 | 195 | ||
196 | layout->addWidget( mPrefix, 0, 0 ); | 196 | layout->addWidget( mPrefix, 0, 0 ); |
197 | layout->addWidget( mInclusion, 0, 1 ); | 197 | layout->addWidget( mInclusion, 0, 1 ); |
198 | layout->addWidget( mSuffix, 0, 2 ); | 198 | layout->addWidget( mSuffix, 0, 2 ); |
199 | layout->addWidget( label, 1, 0 ); | 199 | layout->addWidget( label, 1, 0 ); |
200 | layout->addMultiCellWidget( mFormattedNameCombo, 1, 1, 1, 2 ); | 200 | layout->addMultiCellWidget( mFormattedNameCombo, 1, 1, 1, 2 ); |
201 | } | 201 | } |
202 | 202 | ||
203 | connect( mPrefix, SIGNAL( modified() ), SIGNAL( modified() ) ); | 203 | connect( mPrefix, SIGNAL( modified() ), SIGNAL( modified() ) ); |
204 | connect( mInclusion, SIGNAL( modified() ), SIGNAL( modified() ) ); | 204 | connect( mInclusion, SIGNAL( modified() ), SIGNAL( modified() ) ); |
205 | connect( mSuffix, SIGNAL( modified() ), SIGNAL( modified() ) ); | 205 | connect( mSuffix, SIGNAL( modified() ), SIGNAL( modified() ) ); |
206 | connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SIGNAL( modified() ) ); | 206 | connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SIGNAL( modified() ) ); |
207 | } | 207 | } |
208 | 208 | ||
209 | AddresseeWidget::~AddresseeWidget() | 209 | AddresseeWidget::~AddresseeWidget() |
210 | { | 210 | { |
211 | } | 211 | } |
212 | 212 | ||
213 | void AddresseeWidget::restoreSettings() | 213 | void AddresseeWidget::restoreSettings() |
214 | { | 214 | { |
215 | KConfig config( locateLocal("config", "kabcrc") ); | 215 | KConfig config( locateLocal("config", "kabcrc") ); |
216 | config.setGroup( "General" ); | 216 | config.setGroup( "General" ); |
217 | 217 | ||
218 | mPrefix->setNameParts( config.readListEntry( "Prefixes" ) ); | 218 | mPrefix->setNameParts( config.readListEntry( "Prefixes" ) ); |
219 | mInclusion->setNameParts( config.readListEntry( "Inclusions" ) ); | 219 | mInclusion->setNameParts( config.readListEntry( "Inclusions" ) ); |
220 | mSuffix->setNameParts( config.readListEntry( "Suffixes" ) ); | 220 | mSuffix->setNameParts( config.readListEntry( "Suffixes" ) ); |
221 | 221 | mFormattedNameCombo->setCurrentItem( config.readNumEntry( "FormattedNameType", 1 ) ); | |
222 | KConfig cfg( locateLocal("config","kaddressbookrc") ); | ||
223 | cfg.setGroup( "General" ); | ||
224 | mFormattedNameCombo->setCurrentItem( cfg.readNumEntry( "FormattedNameType", 1 ) ); | ||
225 | } | 222 | } |
226 | 223 | ||
227 | void AddresseeWidget::saveSettings() | 224 | void AddresseeWidget::saveSettings() |
228 | { | 225 | { |
226 | qDebug("AddresseeWidget::saveSettings() "); | ||
229 | KConfig config( locateLocal("config","kabcrc") ); | 227 | KConfig config( locateLocal("config","kabcrc") ); |
230 | config.setGroup( "General" ); | 228 | config.setGroup( "General" ); |
231 | 229 | ||
232 | config.writeEntry( "Prefixes", mPrefix->nameParts() ); | 230 | config.writeEntry( "Prefixes", mPrefix->nameParts() ); |
233 | config.writeEntry( "Inclusions", mInclusion->nameParts() ); | 231 | config.writeEntry( "Inclusions", mInclusion->nameParts() ); |
234 | config.writeEntry( "Suffixes", mSuffix->nameParts() ); | 232 | config.writeEntry( "Suffixes", mSuffix->nameParts() ); |
235 | 233 | config.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); | |
236 | KConfig cfg( locateLocal("config","kaddressbookrc") ); | ||
237 | cfg.setGroup( "General" ); | ||
238 | cfg.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); | ||
239 | } | 234 | } |
240 | 235 | ||
241 | #ifndef KAB_EMBEDDED | 236 | #ifndef KAB_EMBEDDED |
242 | #include "addresseewidget.moc" | 237 | #include "addresseewidget.moc" |
243 | #endif //KAB_EMBEDDED | 238 | #endif //KAB_EMBEDDED |