Diffstat (limited to 'kaddressbook/views/configuretableviewdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kaddressbook/views/configuretableviewdialog.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kaddressbook/views/configuretableviewdialog.cpp b/kaddressbook/views/configuretableviewdialog.cpp index 8bcceb2..0e36abd 100644 --- a/kaddressbook/views/configuretableviewdialog.cpp +++ b/kaddressbook/views/configuretableviewdialog.cpp | |||
@@ -165,101 +165,105 @@ void LookAndFeelPage::saveSettings( KConfig *config ) | |||
165 | config->writeEntry( "TextColor", lbColors->color( 1 ) ); | 165 | config->writeEntry( "TextColor", lbColors->color( 1 ) ); |
166 | config->writeEntry( "HeaderBackgroundColor", lbColors->color( 2 ) ); | 166 | config->writeEntry( "HeaderBackgroundColor", lbColors->color( 2 ) ); |
167 | config->writeEntry( "HeaderTextColor", lbColors->color( 3 ) ); | 167 | config->writeEntry( "HeaderTextColor", lbColors->color( 3 ) ); |
168 | config->writeEntry( "HighlightColor", lbColors->color( 4 ) ); | 168 | config->writeEntry( "HighlightColor", lbColors->color( 4 ) ); |
169 | config->writeEntry( "HighlightedTextColor", lbColors->color( 5 ) ); | 169 | config->writeEntry( "HighlightedTextColor", lbColors->color( 5 ) ); |
170 | config->writeEntry( "AlternatingBackgroundColor", lbColors->color( 6 ) ); | 170 | config->writeEntry( "AlternatingBackgroundColor", lbColors->color( 6 ) ); |
171 | } | 171 | } |
172 | // fonts | 172 | // fonts |
173 | config->writeEntry( "EnableCustomFonts", cbEnableCustomFonts->isChecked() ); | 173 | config->writeEntry( "EnableCustomFonts", cbEnableCustomFonts->isChecked() ); |
174 | if ( cbEnableCustomFonts->isChecked() ) | 174 | if ( cbEnableCustomFonts->isChecked() ) |
175 | { | 175 | { |
176 | config->writeEntry( "TextFont", lTextFont->font() ); | 176 | config->writeEntry( "TextFont", lTextFont->font() ); |
177 | config->writeEntry( "HeaderFont", lHeaderFont->font() ); | 177 | config->writeEntry( "HeaderFont", lHeaderFont->font() ); |
178 | } | 178 | } |
179 | 179 | ||
180 | } | 180 | } |
181 | 181 | ||
182 | void LookAndFeelPage::setTextFont() | 182 | void LookAndFeelPage::setTextFont() |
183 | { | 183 | { |
184 | QFont f( lTextFont->font() ); | 184 | QFont f( lTextFont->font() ); |
185 | #ifndef KAB_EMBEDDED | 185 | #ifndef KAB_EMBEDDED |
186 | if ( KFontDialog::getFont( f, false, this ) == QDialog::Accepted ) | 186 | if ( KFontDialog::getFont( f, false, this ) == QDialog::Accepted ) |
187 | updateFontLabel( f, lTextFont ); | 187 | updateFontLabel( f, lTextFont ); |
188 | #else //KAB_EMBEDDED | 188 | #else //KAB_EMBEDDED |
189 | bool ok; | 189 | bool ok; |
190 | QFont fout = KFontDialog::getFont( f, ok); | 190 | QFont fout = KFontDialog::getFont( f, ok); |
191 | if ( ok ) | 191 | if ( ok ) |
192 | updateFontLabel( fout, lTextFont ); | 192 | updateFontLabel( fout, lTextFont ); |
193 | #endif //KAB_EMBEDDED | 193 | #endif //KAB_EMBEDDED |
194 | } | 194 | } |
195 | 195 | ||
196 | void LookAndFeelPage::setHeaderFont() | 196 | void LookAndFeelPage::setHeaderFont() |
197 | { | 197 | { |
198 | QFont f( lHeaderFont->font() ); | 198 | QFont f( lHeaderFont->font() ); |
199 | #ifndef KAB_EMBEDDED | 199 | #ifndef KAB_EMBEDDED |
200 | if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted ) | 200 | if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted ) |
201 | updateFontLabel( f, lHeaderFont ); | 201 | updateFontLabel( f, lHeaderFont ); |
202 | #else //KAB_EMBEDDED | 202 | #else //KAB_EMBEDDED |
203 | bool ok; | 203 | bool ok; |
204 | QFont fout = KFontDialog::getFont( f, ok); | 204 | QFont fout = KFontDialog::getFont( f, ok); |
205 | if ( ok ) | 205 | if ( ok ) |
206 | updateFontLabel( fout, lHeaderFont ); | 206 | updateFontLabel( fout, lHeaderFont ); |
207 | #endif //KAB_EMBEDDED | 207 | #endif //KAB_EMBEDDED |
208 | } | 208 | } |
209 | 209 | ||
210 | void LookAndFeelPage::enableFonts() | 210 | void LookAndFeelPage::enableFonts() |
211 | { | 211 | { |
212 | vbFonts->setEnabled( cbEnableCustomFonts->isChecked() ); | 212 | vbFonts->setEnabled( cbEnableCustomFonts->isChecked() ); |
213 | if ( cbEnableCustomFonts->isChecked() ) | ||
214 | vbFonts->setFocus(); | ||
213 | } | 215 | } |
214 | 216 | ||
215 | void LookAndFeelPage::enableColors() | 217 | void LookAndFeelPage::enableColors() |
216 | { | 218 | { |
217 | lbColors->setEnabled( cbEnableCustomColors->isChecked() ); | 219 | lbColors->setEnabled( cbEnableCustomColors->isChecked() ); |
220 | if ( cbEnableCustomColors->isChecked() ) | ||
221 | lbColors->setFocus(); | ||
218 | } | 222 | } |
219 | 223 | ||
220 | void LookAndFeelPage::initGUI() | 224 | void LookAndFeelPage::initGUI() |
221 | { | 225 | { |
222 | int spacing = KDialog::spacingHint(); | 226 | int spacing = KDialog::spacingHint(); |
223 | int margin = KDialog::marginHint(); | 227 | int margin = KDialog::marginHint(); |
224 | 228 | ||
225 | QTabWidget *tabs = new QTabWidget( this ); | 229 | QTabWidget *tabs = new QTabWidget( this ); |
226 | 230 | ||
227 | // General | 231 | // General |
228 | QVBox *generalTab = new QVBox( this, "generaltab" ); | 232 | QVBox *generalTab = new QVBox( this, "generaltab" ); |
229 | 233 | ||
230 | generalTab->setSpacing( spacing ); | 234 | generalTab->setSpacing( spacing ); |
231 | generalTab->setMargin( margin ); | 235 | generalTab->setMargin( margin ); |
232 | 236 | ||
233 | QButtonGroup *group = new QButtonGroup(1, Qt::Horizontal, | 237 | QButtonGroup *group = new QButtonGroup(1, Qt::Horizontal, |
234 | i18n("Row Separator"), generalTab); | 238 | i18n("Row Separator"), generalTab); |
235 | 239 | ||
236 | mAlternateButton = new QRadioButton(i18n("Alternating backgrounds"), | 240 | mAlternateButton = new QRadioButton(i18n("Alternating backgrounds"), |
237 | group, "mAlternateButton"); | 241 | group, "mAlternateButton"); |
238 | mLineButton = new QRadioButton(i18n("Single line"), group, "mLineButton"); | 242 | mLineButton = new QRadioButton(i18n("Single line"), group, "mLineButton"); |
239 | mNoneButton = new QRadioButton(i18n("None"), group, "mNoneButton"); | 243 | mNoneButton = new QRadioButton(i18n("None"), group, "mNoneButton"); |
240 | 244 | ||
241 | mBackgroundBox = new QCheckBox(i18n("Enable background image:"), generalTab, | 245 | mBackgroundBox = new QCheckBox(i18n("Enable background image:"), generalTab, |
242 | "mBackgroundBox"); | 246 | "mBackgroundBox"); |
243 | connect(mBackgroundBox, SIGNAL(toggled(bool)), | 247 | connect(mBackgroundBox, SIGNAL(toggled(bool)), |
244 | SLOT(enableBackgroundToggled(bool))); | 248 | SLOT(enableBackgroundToggled(bool))); |
245 | // LR image not implemented | 249 | // LR image not implemented |
246 | mBackgroundBox->setEnabled( false ); | 250 | mBackgroundBox->setEnabled( false ); |
247 | mBackgroundName = new KURLRequester(generalTab, "mBackgroundName"); | 251 | mBackgroundName = new KURLRequester(generalTab, "mBackgroundName"); |
248 | #ifndef KAB_EMBEDDED | 252 | #ifndef KAB_EMBEDDED |
249 | mBackgroundName->setMode(KFile::File | KFile::ExistingOnly | | 253 | mBackgroundName->setMode(KFile::File | KFile::ExistingOnly | |
250 | KFile::LocalOnly); | 254 | KFile::LocalOnly); |
251 | mBackgroundName->setFilter(KImageIO::pattern(KImageIO::Reading)); | 255 | mBackgroundName->setFilter(KImageIO::pattern(KImageIO::Reading)); |
252 | #endif //KAB_EMBEDDED | 256 | #endif //KAB_EMBEDDED |
253 | 257 | ||
254 | // ToolTip Checkbox | 258 | // ToolTip Checkbox |
255 | mToolTipBox = new QCheckBox(i18n("Enable contact tooltips"), generalTab, | 259 | mToolTipBox = new QCheckBox(i18n("Enable contact tooltips"), generalTab, |
256 | "mToolTipBox"); | 260 | "mToolTipBox"); |
257 | 261 | ||
258 | tabs->addTab( generalTab, i18n("&General") ); | 262 | tabs->addTab( generalTab, i18n("&General") ); |
259 | 263 | ||
260 | // Colors | 264 | // Colors |
261 | QVBox *colorTab = new QVBox( this, "colortab" ); | 265 | QVBox *colorTab = new QVBox( this, "colortab" ); |
262 | colorTab->setSpacing( spacing ); | 266 | colorTab->setSpacing( spacing ); |
263 | colorTab->setMargin( spacing ); | 267 | colorTab->setMargin( spacing ); |
264 | cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); | 268 | cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); |
265 | connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) ); | 269 | connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) ); |