Diffstat (limited to 'kaddressbook/views/configuretableviewdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/views/configuretableviewdialog.cpp | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/kaddressbook/views/configuretableviewdialog.cpp b/kaddressbook/views/configuretableviewdialog.cpp index c329cd9..7ed897a 100644 --- a/kaddressbook/views/configuretableviewdialog.cpp +++ b/kaddressbook/views/configuretableviewdialog.cpp | |||
@@ -1,345 +1,348 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
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 <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qwidget.h> | 25 | #include <qwidget.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qradiobutton.h> | 28 | #include <qradiobutton.h> |
29 | #include <qcheckbox.h> | 29 | #include <qcheckbox.h> |
30 | #include <qvbox.h> | 30 | #include <q3vbox.h> |
31 | #include <qbuttongroup.h> | 31 | #include <q3buttongroup.h> |
32 | #include <qtabwidget.h> | 32 | #include <qtabwidget.h> |
33 | #include <qwhatsthis.h> | 33 | #include <q3whatsthis.h> |
34 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
35 | //Added by qt3to4: | ||
36 | #include <Q3GridLayout> | ||
37 | #include <Q3Frame> | ||
35 | 38 | ||
36 | #include <kglobal.h> | 39 | #include <kglobal.h> |
37 | #include <klocale.h> | 40 | #include <klocale.h> |
38 | #include <klineedit.h> | 41 | #include <klineedit.h> |
39 | #include <kurlrequester.h> | 42 | #include <kurlrequester.h> |
40 | #include <kiconloader.h> | 43 | #include <kiconloader.h> |
41 | #include <kfontdialog.h> | 44 | #include <kfontdialog.h> |
42 | 45 | ||
43 | #ifndef KAB_EMBEDDED | 46 | #ifndef KAB_EMBEDDED |
44 | #include <kimageio.h> | 47 | #include <kimageio.h> |
45 | #else //KAB_EMBEDDED | 48 | #else //KAB_EMBEDDED |
46 | #endif //KAB_EMBEDDED | 49 | #endif //KAB_EMBEDDED |
47 | 50 | ||
48 | #include <kconfig.h> | 51 | #include <kconfig.h> |
49 | 52 | ||
50 | #include "colorlistbox.h" | 53 | #include "colorlistbox.h" |
51 | 54 | ||
52 | #include "configuretableviewdialog.h" | 55 | #include "configuretableviewdialog.h" |
53 | 56 | ||
54 | ConfigureTableViewWidget::ConfigureTableViewWidget( KABC::AddressBook *ab, | 57 | ConfigureTableViewWidget::ConfigureTableViewWidget( KABC::AddressBook *ab, |
55 | QWidget *parent, | 58 | QWidget *parent, |
56 | const char *name ) | 59 | const char *name ) |
57 | : ViewConfigureWidget( ab, parent, name ) | 60 | : ViewConfigureWidget( ab, parent, name ) |
58 | { | 61 | { |
59 | QWidget *page = addPage( i18n( "Look & Feel" ), QString::null, | 62 | QWidget *page = addPage( i18n( "Look & Feel" ), QString::null, |
60 | KGlobal::iconLoader()->loadIcon( "looknfeel", | 63 | KGlobal::iconLoader()->loadIcon( "looknfeel", |
61 | KIcon::Panel ) ); | 64 | KIcon::Panel ) ); |
62 | 65 | ||
63 | mPage = new LookAndFeelPage( page ); | 66 | mPage = new LookAndFeelPage( page ); |
64 | } | 67 | } |
65 | 68 | ||
66 | ConfigureTableViewWidget::~ConfigureTableViewWidget() | 69 | ConfigureTableViewWidget::~ConfigureTableViewWidget() |
67 | { | 70 | { |
68 | } | 71 | } |
69 | 72 | ||
70 | void ConfigureTableViewWidget::restoreSettings( KConfig *config ) | 73 | void ConfigureTableViewWidget::restoreSettings( KConfig *config ) |
71 | { | 74 | { |
72 | ViewConfigureWidget::restoreSettings( config ); | 75 | ViewConfigureWidget::restoreSettings( config ); |
73 | 76 | ||
74 | mPage->restoreSettings( config ); | 77 | mPage->restoreSettings( config ); |
75 | } | 78 | } |
76 | 79 | ||
77 | void ConfigureTableViewWidget::saveSettings( KConfig *config ) | 80 | void ConfigureTableViewWidget::saveSettings( KConfig *config ) |
78 | { | 81 | { |
79 | ViewConfigureWidget::saveSettings( config ); | 82 | ViewConfigureWidget::saveSettings( config ); |
80 | 83 | ||
81 | mPage->saveSettings( config ); | 84 | mPage->saveSettings( config ); |
82 | } | 85 | } |
83 | 86 | ||
84 | 87 | ||
85 | 88 | ||
86 | LookAndFeelPage::LookAndFeelPage(QWidget *parent, const char *name) | 89 | LookAndFeelPage::LookAndFeelPage(QWidget *parent, const char *name) |
87 | : QVBox(parent, name) | 90 | : Q3VBox(parent, name) |
88 | { | 91 | { |
89 | initGUI(); | 92 | initGUI(); |
90 | 93 | ||
91 | // Set initial state | 94 | // Set initial state |
92 | enableBackgroundToggled(mBackgroundBox->isChecked()); | 95 | enableBackgroundToggled(mBackgroundBox->isChecked()); |
93 | } | 96 | } |
94 | 97 | ||
95 | void LookAndFeelPage::restoreSettings( KConfig *config ) | 98 | void LookAndFeelPage::restoreSettings( KConfig *config ) |
96 | { | 99 | { |
97 | mAlternateButton->setChecked(config->readBoolEntry("ABackground", true)); | 100 | mAlternateButton->setChecked(config->readBoolEntry("ABackground", true)); |
98 | mLineButton->setChecked(config->readBoolEntry("SingleLine", false)); | 101 | mLineButton->setChecked(config->readBoolEntry("SingleLine", false)); |
99 | mToolTipBox->setChecked(config->readBoolEntry("ToolTips", true)); | 102 | mToolTipBox->setChecked(config->readBoolEntry("ToolTips", true)); |
100 | 103 | ||
101 | if (!mAlternateButton->isChecked() & !mLineButton->isChecked()) | 104 | if (!mAlternateButton->isChecked() & !mLineButton->isChecked()) |
102 | mNoneButton->setChecked(true); | 105 | mNoneButton->setChecked(true); |
103 | 106 | ||
104 | mBackgroundBox->setChecked(config->readBoolEntry("Background", false)); | 107 | mBackgroundBox->setChecked(config->readBoolEntry("Background", false)); |
105 | mBackgroundName->lineEdit()->setText(config->readEntry("BackgroundName")); | 108 | mBackgroundName->lineEdit()->setText(config->readEntry("BackgroundName")); |
106 | 109 | ||
107 | // colors | 110 | // colors |
108 | cbEnableCustomColors->setChecked( config->readBoolEntry( "EnableCustomColors", false ) ); | 111 | cbEnableCustomColors->setChecked( config->readBoolEntry( "EnableCustomColors", false ) ); |
109 | QColor c; | 112 | QColor c; |
110 | //qDebug("LookAndFeelPage::restoreSettings make base color configurable"); | 113 | //qDebug("LookAndFeelPage::restoreSettings make base color configurable"); |
111 | 114 | ||
112 | #ifndef KAB_EMBEDDED | 115 | #ifndef KAB_EMBEDDED |
113 | c = KGlobalSettings::baseColor(); | 116 | c = KGlobalSettings::baseColor(); |
114 | #else //KAB_EMBEDDED | 117 | #else //KAB_EMBEDDED |
115 | c = QColor(0,0,0); | 118 | c = QColor(0,0,0); |
116 | #endif //KAB_EMBEDDED | 119 | #endif //KAB_EMBEDDED |
117 | 120 | ||
118 | c = colorGroup().background(); | 121 | c = colorGroup().background(); |
119 | lbColors->insertItem( new ColorListItem( i18n("Background Color"), | 122 | lbColors->insertItem( new ColorListItem( i18n("Background Color"), |
120 | config->readColorEntry( "BackgroundColor", &c ) ) ); | 123 | config->readColorEntry( "BackgroundColor", &c ) ) ); |
121 | c = colorGroup().foreground(); | 124 | c = colorGroup().foreground(); |
122 | lbColors->insertItem( new ColorListItem( i18n("Text Color"), | 125 | lbColors->insertItem( new ColorListItem( i18n("Text Color"), |
123 | config->readColorEntry( "TextColor", &c ) ) ); | 126 | config->readColorEntry( "TextColor", &c ) ) ); |
124 | c = colorGroup().button(); | 127 | c = colorGroup().button(); |
125 | lbColors->insertItem( new ColorListItem( i18n("Header Background Color"), | 128 | lbColors->insertItem( new ColorListItem( i18n("Header Background Color"), |
126 | config->readColorEntry( "HeaderBackgroundColor", &c ) ) ); | 129 | config->readColorEntry( "HeaderBackgroundColor", &c ) ) ); |
127 | c = colorGroup().buttonText(); | 130 | c = colorGroup().buttonText(); |
128 | lbColors->insertItem( new ColorListItem( i18n("Header Text Color"), | 131 | lbColors->insertItem( new ColorListItem( i18n("Header Text Color"), |
129 | config->readColorEntry( "HeaderTextColor", &c ) ) ); | 132 | config->readColorEntry( "HeaderTextColor", &c ) ) ); |
130 | c = colorGroup().highlight(); | 133 | c = colorGroup().highlight(); |
131 | lbColors->insertItem( new ColorListItem( i18n("Highlight Color"), | 134 | lbColors->insertItem( new ColorListItem( i18n("Highlight Color"), |
132 | config->readColorEntry( "HighlightColor", &c ) ) ); | 135 | config->readColorEntry( "HighlightColor", &c ) ) ); |
133 | c = colorGroup().highlightedText(); | 136 | c = colorGroup().highlightedText(); |
134 | lbColors->insertItem( new ColorListItem( i18n("Highlighted Text Color"), | 137 | lbColors->insertItem( new ColorListItem( i18n("Highlighted Text Color"), |
135 | config->readColorEntry( "HighlightedTextColor", &c ) ) ); | 138 | config->readColorEntry( "HighlightedTextColor", &c ) ) ); |
136 | c = colorGroup().background(); | 139 | c = colorGroup().background(); |
137 | lbColors->insertItem( new ColorListItem( i18n("Alternating Background Color"), | 140 | lbColors->insertItem( new ColorListItem( i18n("Alternating Background Color"), |
138 | config->readColorEntry( "AlternatingBackgroundColor", &c ) ) ); | 141 | config->readColorEntry( "AlternatingBackgroundColor", &c ) ) ); |
139 | 142 | ||
140 | enableColors(); | 143 | enableColors(); |
141 | 144 | ||
142 | // fonts | 145 | // fonts |
143 | QFont fnt = font(); | 146 | QFont fnt = font(); |
144 | updateFontLabel( config->readFontEntry( "TextFont", &fnt ), (QLabel*)lTextFont ); | 147 | updateFontLabel( config->readFontEntry( "TextFont", &fnt ), (QLabel*)lTextFont ); |
145 | fnt.setBold( true ); | 148 | fnt.setBold( true ); |
146 | updateFontLabel( config->readFontEntry( "HeaderFont", &fnt ), (QLabel*)lHeaderFont ); | 149 | updateFontLabel( config->readFontEntry( "HeaderFont", &fnt ), (QLabel*)lHeaderFont ); |
147 | cbEnableCustomFonts->setChecked( config->readBoolEntry( "EnableCustomFonts", false ) ); | 150 | cbEnableCustomFonts->setChecked( config->readBoolEntry( "EnableCustomFonts", false ) ); |
148 | enableFonts(); | 151 | enableFonts(); |
149 | 152 | ||
150 | } | 153 | } |
151 | 154 | ||
152 | void LookAndFeelPage::saveSettings( KConfig *config ) | 155 | void LookAndFeelPage::saveSettings( KConfig *config ) |
153 | { | 156 | { |
154 | config->writeEntry("ABackground", mAlternateButton->isChecked()); | 157 | config->writeEntry("ABackground", mAlternateButton->isChecked()); |
155 | config->writeEntry("SingleLine", mLineButton->isChecked()); | 158 | config->writeEntry("SingleLine", mLineButton->isChecked()); |
156 | config->writeEntry("ToolTips", mToolTipBox->isChecked()); | 159 | config->writeEntry("ToolTips", mToolTipBox->isChecked()); |
157 | config->writeEntry("Background", mBackgroundBox->isChecked()); | 160 | config->writeEntry("Background", mBackgroundBox->isChecked()); |
158 | config->writeEntry("BackgroundName", mBackgroundName->lineEdit()->text()); | 161 | config->writeEntry("BackgroundName", mBackgroundName->lineEdit()->text()); |
159 | 162 | ||
160 | // colors | 163 | // colors |
161 | config->writeEntry( "EnableCustomColors", cbEnableCustomColors->isChecked() ); | 164 | config->writeEntry( "EnableCustomColors", cbEnableCustomColors->isChecked() ); |
162 | if ( cbEnableCustomColors->isChecked() ) // ?? - Hmmm. | 165 | if ( cbEnableCustomColors->isChecked() ) // ?? - Hmmm. |
163 | { | 166 | { |
164 | config->writeEntry( "BackgroundColor", lbColors->color( 0 ) ); | 167 | config->writeEntry( "BackgroundColor", lbColors->color( 0 ) ); |
165 | config->writeEntry( "TextColor", lbColors->color( 1 ) ); | 168 | config->writeEntry( "TextColor", lbColors->color( 1 ) ); |
166 | config->writeEntry( "HeaderBackgroundColor", lbColors->color( 2 ) ); | 169 | config->writeEntry( "HeaderBackgroundColor", lbColors->color( 2 ) ); |
167 | config->writeEntry( "HeaderTextColor", lbColors->color( 3 ) ); | 170 | config->writeEntry( "HeaderTextColor", lbColors->color( 3 ) ); |
168 | config->writeEntry( "HighlightColor", lbColors->color( 4 ) ); | 171 | config->writeEntry( "HighlightColor", lbColors->color( 4 ) ); |
169 | config->writeEntry( "HighlightedTextColor", lbColors->color( 5 ) ); | 172 | config->writeEntry( "HighlightedTextColor", lbColors->color( 5 ) ); |
170 | config->writeEntry( "AlternatingBackgroundColor", lbColors->color( 6 ) ); | 173 | config->writeEntry( "AlternatingBackgroundColor", lbColors->color( 6 ) ); |
171 | } | 174 | } |
172 | // fonts | 175 | // fonts |
173 | config->writeEntry( "EnableCustomFonts", cbEnableCustomFonts->isChecked() ); | 176 | config->writeEntry( "EnableCustomFonts", cbEnableCustomFonts->isChecked() ); |
174 | if ( cbEnableCustomFonts->isChecked() ) | 177 | if ( cbEnableCustomFonts->isChecked() ) |
175 | { | 178 | { |
176 | config->writeEntry( "TextFont", lTextFont->font() ); | 179 | config->writeEntry( "TextFont", lTextFont->font() ); |
177 | config->writeEntry( "HeaderFont", lHeaderFont->font() ); | 180 | config->writeEntry( "HeaderFont", lHeaderFont->font() ); |
178 | } | 181 | } |
179 | 182 | ||
180 | } | 183 | } |
181 | 184 | ||
182 | void LookAndFeelPage::setTextFont() | 185 | void LookAndFeelPage::setTextFont() |
183 | { | 186 | { |
184 | QFont f( lTextFont->font() ); | 187 | QFont f( lTextFont->font() ); |
185 | #ifndef KAB_EMBEDDED | 188 | #ifndef KAB_EMBEDDED |
186 | if ( KFontDialog::getFont( f, false, this ) == QDialog::Accepted ) | 189 | if ( KFontDialog::getFont( f, false, this ) == QDialog::Accepted ) |
187 | updateFontLabel( f, lTextFont ); | 190 | updateFontLabel( f, lTextFont ); |
188 | #else //KAB_EMBEDDED | 191 | #else //KAB_EMBEDDED |
189 | bool ok; | 192 | bool ok; |
190 | QFont fout = KFontDialog::getFont( f, ok); | 193 | QFont fout = KFontDialog::getFont( f, ok); |
191 | if ( ok ) | 194 | if ( ok ) |
192 | updateFontLabel( fout, lTextFont ); | 195 | updateFontLabel( fout, lTextFont ); |
193 | #endif //KAB_EMBEDDED | 196 | #endif //KAB_EMBEDDED |
194 | } | 197 | } |
195 | 198 | ||
196 | void LookAndFeelPage::setHeaderFont() | 199 | void LookAndFeelPage::setHeaderFont() |
197 | { | 200 | { |
198 | QFont f( lHeaderFont->font() ); | 201 | QFont f( lHeaderFont->font() ); |
199 | #ifndef KAB_EMBEDDED | 202 | #ifndef KAB_EMBEDDED |
200 | if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted ) | 203 | if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted ) |
201 | updateFontLabel( f, lHeaderFont ); | 204 | updateFontLabel( f, lHeaderFont ); |
202 | #else //KAB_EMBEDDED | 205 | #else //KAB_EMBEDDED |
203 | bool ok; | 206 | bool ok; |
204 | QFont fout = KFontDialog::getFont( f, ok); | 207 | QFont fout = KFontDialog::getFont( f, ok); |
205 | if ( ok ) | 208 | if ( ok ) |
206 | updateFontLabel( fout, lHeaderFont ); | 209 | updateFontLabel( fout, lHeaderFont ); |
207 | #endif //KAB_EMBEDDED | 210 | #endif //KAB_EMBEDDED |
208 | } | 211 | } |
209 | 212 | ||
210 | void LookAndFeelPage::enableFonts() | 213 | void LookAndFeelPage::enableFonts() |
211 | { | 214 | { |
212 | vbFonts->setEnabled( cbEnableCustomFonts->isChecked() ); | 215 | vbFonts->setEnabled( cbEnableCustomFonts->isChecked() ); |
213 | if ( cbEnableCustomFonts->isChecked() ) | 216 | if ( cbEnableCustomFonts->isChecked() ) |
214 | vbFonts->setFocus(); | 217 | vbFonts->setFocus(); |
215 | } | 218 | } |
216 | 219 | ||
217 | void LookAndFeelPage::enableColors() | 220 | void LookAndFeelPage::enableColors() |
218 | { | 221 | { |
219 | lbColors->setEnabled( cbEnableCustomColors->isChecked() ); | 222 | lbColors->setEnabled( cbEnableCustomColors->isChecked() ); |
220 | if ( cbEnableCustomColors->isChecked() ) | 223 | if ( cbEnableCustomColors->isChecked() ) |
221 | lbColors->setFocus(); | 224 | lbColors->setFocus(); |
222 | } | 225 | } |
223 | 226 | ||
224 | void LookAndFeelPage::initGUI() | 227 | void LookAndFeelPage::initGUI() |
225 | { | 228 | { |
226 | int spacing = KDialog::spacingHint(); | 229 | int spacing = KDialog::spacingHint(); |
227 | int margin = KDialog::marginHint(); | 230 | int margin = KDialog::marginHint(); |
228 | 231 | ||
229 | QTabWidget *tabs = new QTabWidget( this ); | 232 | QTabWidget *tabs = new QTabWidget( this ); |
230 | 233 | ||
231 | // General | 234 | // General |
232 | QVBox *generalTab = new QVBox( this, "generaltab" ); | 235 | Q3VBox *generalTab = new Q3VBox( this, "generaltab" ); |
233 | 236 | ||
234 | generalTab->setSpacing( spacing ); | 237 | generalTab->setSpacing( spacing ); |
235 | generalTab->setMargin( margin ); | 238 | generalTab->setMargin( margin ); |
236 | 239 | ||
237 | QButtonGroup *group = new QButtonGroup(1, Qt::Horizontal, | 240 | Q3ButtonGroup *group = new Q3ButtonGroup(1, Qt::Horizontal, |
238 | i18n("Row Separator"), generalTab); | 241 | i18n("Row Separator"), generalTab); |
239 | 242 | ||
240 | mAlternateButton = new QRadioButton(i18n("Alternating backgrounds"), | 243 | mAlternateButton = new QRadioButton(i18n("Alternating backgrounds"), |
241 | group, "mAlternateButton"); | 244 | group, "mAlternateButton"); |
242 | mLineButton = new QRadioButton(i18n("Single line"), group, "mLineButton"); | 245 | mLineButton = new QRadioButton(i18n("Single line"), group, "mLineButton"); |
243 | mNoneButton = new QRadioButton(i18n("None"), group, "mNoneButton"); | 246 | mNoneButton = new QRadioButton(i18n("None"), group, "mNoneButton"); |
244 | 247 | ||
245 | mBackgroundBox = new QCheckBox(i18n("Enable background image:"), generalTab, | 248 | mBackgroundBox = new QCheckBox(i18n("Enable background image:"), generalTab, |
246 | "mBackgroundBox"); | 249 | "mBackgroundBox"); |
247 | connect(mBackgroundBox, SIGNAL(toggled(bool)), | 250 | connect(mBackgroundBox, SIGNAL(toggled(bool)), |
248 | SLOT(enableBackgroundToggled(bool))); | 251 | SLOT(enableBackgroundToggled(bool))); |
249 | // LR image not implemented | 252 | // LR image not implemented |
250 | mBackgroundBox->setEnabled( false ); | 253 | mBackgroundBox->setEnabled( false ); |
251 | mBackgroundName = new KURLRequester(generalTab, "mBackgroundName"); | 254 | mBackgroundName = new KURLRequester(generalTab, "mBackgroundName"); |
252 | #ifndef KAB_EMBEDDED | 255 | #ifndef KAB_EMBEDDED |
253 | mBackgroundName->setMode(KFile::File | KFile::ExistingOnly | | 256 | mBackgroundName->setMode(KFile::File | KFile::ExistingOnly | |
254 | KFile::LocalOnly); | 257 | KFile::LocalOnly); |
255 | mBackgroundName->setFilter(KImageIO::pattern(KImageIO::Reading)); | 258 | mBackgroundName->setFilter(KImageIO::pattern(KImageIO::Reading)); |
256 | #endif //KAB_EMBEDDED | 259 | #endif //KAB_EMBEDDED |
257 | 260 | ||
258 | // ToolTip Checkbox | 261 | // ToolTip Checkbox |
259 | mToolTipBox = new QCheckBox(i18n("Enable contact tooltips"), generalTab, | 262 | mToolTipBox = new QCheckBox(i18n("Enable contact tooltips"), generalTab, |
260 | "mToolTipBox"); | 263 | "mToolTipBox"); |
261 | 264 | ||
262 | tabs->addTab( generalTab, i18n("&General") ); | 265 | tabs->addTab( generalTab, i18n("&General") ); |
263 | 266 | ||
264 | // Colors | 267 | // Colors |
265 | QVBox *colorTab = new QVBox( this, "colortab" ); | 268 | Q3VBox *colorTab = new Q3VBox( this, "colortab" ); |
266 | colorTab->setSpacing( spacing ); | 269 | colorTab->setSpacing( spacing ); |
267 | colorTab->setMargin( spacing ); | 270 | colorTab->setMargin( spacing ); |
268 | cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); | 271 | cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); |
269 | connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) ); | 272 | connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) ); |
270 | lbColors = new ColorListBox( colorTab ); | 273 | lbColors = new ColorListBox( colorTab ); |
271 | tabs->addTab( colorTab, i18n("&Colors") ); | 274 | tabs->addTab( colorTab, i18n("&Colors") ); |
272 | 275 | ||
273 | QWhatsThis::add( cbEnableCustomColors, i18n( | 276 | Q3WhatsThis::add( cbEnableCustomColors, i18n( |
274 | "If custom colors are enabled, you may choose the colors for the view below. " | 277 | "If custom colors are enabled, you may choose the colors for the view below. " |
275 | "Otherwise colors from your current KDE color scheme are used." | 278 | "Otherwise colors from your current KDE color scheme are used." |
276 | ) ); | 279 | ) ); |
277 | QWhatsThis::add( lbColors, i18n( | 280 | Q3WhatsThis::add( lbColors, i18n( |
278 | "Double click or press RETURN on a item to select a color for the related strings in the view." | 281 | "Double click or press RETURN on a item to select a color for the related strings in the view." |
279 | ) ); | 282 | ) ); |
280 | 283 | ||
281 | // Fonts | 284 | // Fonts |
282 | QVBox *fntTab = new QVBox( this, "fonttab" ); | 285 | Q3VBox *fntTab = new Q3VBox( this, "fonttab" ); |
283 | 286 | ||
284 | fntTab->setSpacing( spacing ); | 287 | fntTab->setSpacing( spacing ); |
285 | fntTab->setMargin( spacing ); | 288 | fntTab->setMargin( spacing ); |
286 | 289 | ||
287 | cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab ); | 290 | cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab ); |
288 | connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) ); | 291 | connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) ); |
289 | 292 | ||
290 | vbFonts = new QWidget( fntTab ); | 293 | vbFonts = new QWidget( fntTab ); |
291 | QGridLayout *gFnts = new QGridLayout( vbFonts, 2, 3 ); | 294 | Q3GridLayout *gFnts = new Q3GridLayout( vbFonts, 2, 3 ); |
292 | gFnts->setSpacing( spacing ); | 295 | gFnts->setSpacing( spacing ); |
293 | gFnts->setAutoAdd( true ); | 296 | gFnts->setAutoAdd( true ); |
294 | gFnts->setColStretch( 1, 1 ); | 297 | gFnts->setColStretch( 1, 1 ); |
295 | QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts ); | 298 | QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts ); |
296 | lTextFont = new QLabel( vbFonts ); | 299 | lTextFont = new QLabel( vbFonts ); |
297 | lTextFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); | 300 | lTextFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken ); |
298 | #ifndef KAB_EMBEDDED | 301 | #ifndef KAB_EMBEDDED |
299 | btnFont = new KPushButton( i18n("Choose..."), vbFonts ); | 302 | btnFont = new KPushButton( i18n("Choose..."), vbFonts ); |
300 | #else //KAB_EMBEDDED | 303 | #else //KAB_EMBEDDED |
301 | btnFont = new QPushButton( i18n("Choose..."), vbFonts ); | 304 | btnFont = new QPushButton( i18n("Choose..."), vbFonts ); |
302 | #endif //KAB_EMBEDDED | 305 | #endif //KAB_EMBEDDED |
303 | 306 | ||
304 | lTFnt->setBuddy( btnFont ); | 307 | lTFnt->setBuddy( btnFont ); |
305 | 308 | ||
306 | connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) ); | 309 | connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) ); |
307 | 310 | ||
308 | QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts ); | 311 | QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts ); |
309 | lHeaderFont = new QLabel( vbFonts ); | 312 | lHeaderFont = new QLabel( vbFonts ); |
310 | lHeaderFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); | 313 | lHeaderFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken ); |
311 | #ifndef KAB_EMBEDDED | 314 | #ifndef KAB_EMBEDDED |
312 | btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts ); | 315 | btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts ); |
313 | #else //KAB_EMBEDDED | 316 | #else //KAB_EMBEDDED |
314 | btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts ); | 317 | btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts ); |
315 | #endif //KAB_EMBEDDED | 318 | #endif //KAB_EMBEDDED |
316 | lHFnt->setBuddy( btnHeaderFont ); | 319 | lHFnt->setBuddy( btnHeaderFont ); |
317 | connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) ); | 320 | connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) ); |
318 | 321 | ||
319 | fntTab->setStretchFactor( new QWidget( fntTab ), 1 ); | 322 | fntTab->setStretchFactor( new QWidget( fntTab ), 1 ); |
320 | 323 | ||
321 | QWhatsThis::add( cbEnableCustomFonts, i18n( | 324 | Q3WhatsThis::add( cbEnableCustomFonts, i18n( |
322 | "If custom fonts are enabled, you may choose which fonts to use for this view below. " | 325 | "If custom fonts are enabled, you may choose which fonts to use for this view below. " |
323 | "Otherwise the default KDE font will be used, in bold style for the header and " | 326 | "Otherwise the default KDE font will be used, in bold style for the header and " |
324 | "normal style for the data." | 327 | "normal style for the data." |
325 | ) ); | 328 | ) ); |
326 | 329 | ||
327 | tabs->addTab( fntTab, i18n("&Fonts") ); | 330 | tabs->addTab( fntTab, i18n("&Fonts") ); |
328 | 331 | ||
329 | } | 332 | } |
330 | 333 | ||
331 | void LookAndFeelPage::enableBackgroundToggled(bool enabled) | 334 | void LookAndFeelPage::enableBackgroundToggled(bool enabled) |
332 | { | 335 | { |
333 | mBackgroundName->setEnabled(enabled); | 336 | mBackgroundName->setEnabled(enabled); |
334 | } | 337 | } |
335 | 338 | ||
336 | 339 | ||
337 | void LookAndFeelPage::updateFontLabel( QFont fnt, QLabel *l ) | 340 | void LookAndFeelPage::updateFontLabel( QFont fnt, QLabel *l ) |
338 | { | 341 | { |
339 | l->setFont( fnt ); | 342 | l->setFont( fnt ); |
340 | l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) ); | 343 | l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) ); |
341 | } | 344 | } |
342 | 345 | ||
343 | #ifndef KAB_EMBEDDED | 346 | #ifndef KAB_EMBEDDED_ |
344 | #include "configuretableviewdialog.moc" | 347 | #include "moc_configuretableviewdialog.cpp" |
345 | #endif //KAB_EMBEDDED | 348 | #endif //KAB_EMBEDDED |