summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/configurecardviewdialog.cpp
Unidiff
Diffstat (limited to 'kaddressbook/views/configurecardviewdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/views/configurecardviewdialog.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/kaddressbook/views/configurecardviewdialog.cpp b/kaddressbook/views/configurecardviewdialog.cpp
index 366e54c..e0fbd21 100644
--- a/kaddressbook/views/configurecardviewdialog.cpp
+++ b/kaddressbook/views/configurecardviewdialog.cpp
@@ -170,101 +170,105 @@ void CardViewLookNFeelPage::saveSettings( KConfig *config )
170 if ( cbEnableCustomFonts->isChecked() ) 170 if ( cbEnableCustomFonts->isChecked() )
171 { 171 {
172 config->writeEntry( "TextFont", lTextFont->font() ); 172 config->writeEntry( "TextFont", lTextFont->font() );
173 config->writeEntry( "HeaderFont", lHeaderFont->font() ); 173 config->writeEntry( "HeaderFont", lHeaderFont->font() );
174 } 174 }
175 // layout 175 // layout
176 config->writeEntry( "ItemMargin", sbMargin->value() ); 176 config->writeEntry( "ItemMargin", sbMargin->value() );
177 config->writeEntry( "ItemSpacing", sbSpacing->value() ); 177 config->writeEntry( "ItemSpacing", sbSpacing->value() );
178 config->writeEntry( "SeparatorWidth", sbSepWidth->value() ); 178 config->writeEntry( "SeparatorWidth", sbSepWidth->value() );
179 config->writeEntry("DrawBorder", cbDrawBorders->isChecked()); 179 config->writeEntry("DrawBorder", cbDrawBorders->isChecked());
180 config->writeEntry("DrawSeparators", cbDrawSeps->isChecked()); 180 config->writeEntry("DrawSeparators", cbDrawSeps->isChecked());
181 181
182 // behaviour 182 // behaviour
183 config->writeEntry("DrawFieldLabels", cbShowFieldLabels->isChecked()); 183 config->writeEntry("DrawFieldLabels", cbShowFieldLabels->isChecked());
184 config->writeEntry("ShowEmptyFields", cbShowEmptyFields->isChecked()); 184 config->writeEntry("ShowEmptyFields", cbShowEmptyFields->isChecked());
185} 185}
186 186
187void CardViewLookNFeelPage::setTextFont() 187void CardViewLookNFeelPage::setTextFont()
188{ 188{
189 QFont f( lTextFont->font() ); 189 QFont f( lTextFont->font() );
190#ifndef KAB_EMBEDDED 190#ifndef KAB_EMBEDDED
191 if ( KFontDialog::getFont( f, false, this ) == QDialog::Accepted ) 191 if ( KFontDialog::getFont( f, false, this ) == QDialog::Accepted )
192 updateFontLabel( f, lTextFont ); 192 updateFontLabel( f, lTextFont );
193#else //KAB_EMBEDDED 193#else //KAB_EMBEDDED
194 bool ok; 194 bool ok;
195 QFont fout = KFontDialog::getFont( f, ok); 195 QFont fout = KFontDialog::getFont( f, ok);
196 if ( ok ) 196 if ( ok )
197 updateFontLabel( fout, lTextFont ); 197 updateFontLabel( fout, lTextFont );
198#endif //KAB_EMBEDDED 198#endif //KAB_EMBEDDED
199} 199}
200 200
201void CardViewLookNFeelPage::setHeaderFont() 201void CardViewLookNFeelPage::setHeaderFont()
202{ 202{
203 QFont f( lHeaderFont->font() ); 203 QFont f( lHeaderFont->font() );
204#ifndef KAB_EMBEDDED 204#ifndef KAB_EMBEDDED
205 if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted ) 205 if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted )
206 updateFontLabel( f, lHeaderFont ); 206 updateFontLabel( f, lHeaderFont );
207#else //KAB_EMBEDDED 207#else //KAB_EMBEDDED
208 bool ok; 208 bool ok;
209 QFont fout = KFontDialog::getFont( f, ok); 209 QFont fout = KFontDialog::getFont( f, ok);
210 if ( ok ) 210 if ( ok )
211 updateFontLabel( fout, lHeaderFont ); 211 updateFontLabel( fout, lHeaderFont );
212#endif //KAB_EMBEDDED 212#endif //KAB_EMBEDDED
213} 213}
214 214
215void CardViewLookNFeelPage::enableFonts() 215void CardViewLookNFeelPage::enableFonts()
216{ 216{
217 vbFonts->setEnabled( cbEnableCustomFonts->isChecked() ); 217 vbFonts->setEnabled( cbEnableCustomFonts->isChecked() );
218 if ( cbEnableCustomFonts->isChecked() )
219 vbFonts->setFocus();
218} 220}
219 221
220void CardViewLookNFeelPage::enableColors() 222void CardViewLookNFeelPage::enableColors()
221{ 223{
222 lbColors->setEnabled( cbEnableCustomColors->isChecked() ); 224 lbColors->setEnabled( cbEnableCustomColors->isChecked() );
225 if ( cbEnableCustomColors->isChecked() )
226 lbColors->setFocus();
223} 227}
224 228
225void CardViewLookNFeelPage::initGUI() 229void CardViewLookNFeelPage::initGUI()
226{ 230{
227 int spacing = KDialog::spacingHint(); 231 int spacing = KDialog::spacingHint();
228 int margin = KDialog::marginHint(); 232 int margin = KDialog::marginHint();
229 233
230 QTabWidget *tabs = new QTabWidget( this ); 234 QTabWidget *tabs = new QTabWidget( this );
231 235
232 // Layout 236 // Layout
233 QVBox *loTab = new QVBox( this, "layouttab" ); 237 QVBox *loTab = new QVBox( this, "layouttab" );
234 238
235 loTab->setSpacing( spacing ); 239 loTab->setSpacing( spacing );
236 loTab->setMargin( margin ); 240 loTab->setMargin( margin );
237 241
238 QGroupBox *gbGeneral = new QGroupBox( 1, Qt::Horizontal, i18n("General"), loTab ); 242 QGroupBox *gbGeneral = new QGroupBox( 1, Qt::Horizontal, i18n("General"), loTab );
239 243
240 cbDrawSeps = new QCheckBox( i18n("Draw &separators"), gbGeneral ); 244 cbDrawSeps = new QCheckBox( i18n("Draw &separators"), gbGeneral );
241 245
242 QHBox *hbSW = new QHBox( gbGeneral ); 246 QHBox *hbSW = new QHBox( gbGeneral );
243 QLabel *lSW = new QLabel( i18n("Separator &width:"), hbSW ); 247 QLabel *lSW = new QLabel( i18n("Separator &width:"), hbSW );
244 sbSepWidth = new QSpinBox( 1, 50, 1, hbSW ); 248 sbSepWidth = new QSpinBox( 1, 50, 1, hbSW );
245 lSW->setBuddy( sbSepWidth); 249 lSW->setBuddy( sbSepWidth);
246 250
247 QHBox *hbPadding = new QHBox( gbGeneral ); 251 QHBox *hbPadding = new QHBox( gbGeneral );
248 QLabel *lSpacing = new QLabel( i18n("&Padding:"), hbPadding ); 252 QLabel *lSpacing = new QLabel( i18n("&Padding:"), hbPadding );
249 sbSpacing = new QSpinBox( 0, 100, 1, hbPadding ); 253 sbSpacing = new QSpinBox( 0, 100, 1, hbPadding );
250 lSpacing->setBuddy( sbSpacing ); 254 lSpacing->setBuddy( sbSpacing );
251 255
252 QGroupBox *gbCards = new QGroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab ); 256 QGroupBox *gbCards = new QGroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab );
253 257
254 QHBox *hbMargin = new QHBox( gbCards ); 258 QHBox *hbMargin = new QHBox( gbCards );
255 QLabel *lMargin = new QLabel( i18n("&Margin:"), hbMargin ); 259 QLabel *lMargin = new QLabel( i18n("&Margin:"), hbMargin );
256 sbMargin = new QSpinBox( 0, 100, 1, hbMargin ); 260 sbMargin = new QSpinBox( 0, 100, 1, hbMargin );
257 lMargin->setBuddy( sbMargin ); 261 lMargin->setBuddy( sbMargin );
258 262
259 cbDrawBorders = new QCheckBox( i18n("Draw &borders"), gbCards ); 263 cbDrawBorders = new QCheckBox( i18n("Draw &borders"), gbCards );
260 264
261 loTab->setStretchFactor( new QWidget( loTab ), 1 ); 265 loTab->setStretchFactor( new QWidget( loTab ), 1 );
262 266
263 QWhatsThis::add( sbMargin, i18n( 267 QWhatsThis::add( sbMargin, i18n(
264 "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, " 268 "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, "
265 "incrementing the item margin will add space between the focus rectangle and the item data." 269 "incrementing the item margin will add space between the focus rectangle and the item data."
266 ) ); 270 ) );
267 QWhatsThis::add( lMargin, QWhatsThis::textFor( sbMargin ) ); 271 QWhatsThis::add( lMargin, QWhatsThis::textFor( sbMargin ) );
268 QWhatsThis::add( sbSpacing, i18n( 272 QWhatsThis::add( sbSpacing, i18n(
269 "The Item Spacing decides the distance (in pixels) between the items and anything else: the view " 273 "The Item Spacing decides the distance (in pixels) between the items and anything else: the view "
270 "borders, other items or column separators." 274 "borders, other items or column separators."