author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/views/configurecardviewdialog.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/views/configurecardviewdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/views/configurecardviewdialog.cpp | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/kaddressbook/views/configurecardviewdialog.cpp b/kaddressbook/views/configurecardviewdialog.cpp index e0fbd21..b6327fe 100644 --- a/kaddressbook/views/configurecardviewdialog.cpp +++ b/kaddressbook/views/configurecardviewdialog.cpp | |||
@@ -1,369 +1,372 @@ | |||
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 <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qcheckbox.h> | 27 | #include <qcheckbox.h> |
28 | #include <qvbox.h> | 28 | #include <q3vbox.h> |
29 | #include <qgroupbox.h> | 29 | #include <q3groupbox.h> |
30 | #include <qspinbox.h> | 30 | #include <qspinbox.h> |
31 | #include <qtabwidget.h> | 31 | #include <qtabwidget.h> |
32 | #include <qwhatsthis.h> | 32 | #include <q3whatsthis.h> |
33 | //Added by qt3to4: | ||
34 | #include <Q3GridLayout> | ||
35 | #include <Q3Frame> | ||
33 | 36 | ||
34 | #include <kdebug.h> | 37 | #include <kdebug.h> |
35 | #include <kglobal.h> | 38 | #include <kglobal.h> |
36 | #include <kglobalsettings.h> | 39 | #include <kglobalsettings.h> |
37 | #include <klocale.h> | 40 | #include <klocale.h> |
38 | #include <kiconloader.h> | 41 | #include <kiconloader.h> |
39 | #include <kconfig.h> | 42 | #include <kconfig.h> |
40 | #include <kfontdialog.h> | 43 | #include <kfontdialog.h> |
41 | 44 | ||
42 | #ifndef KAB_EMBEDDED | 45 | #ifndef KAB_EMBEDDED |
43 | #include <kpushbutton.h> | 46 | #include <kpushbutton.h> |
44 | #else //KAB_EMBEDDED | 47 | #else //KAB_EMBEDDED |
45 | #include <qpushbutton.h> | 48 | #include <qpushbutton.h> |
46 | #endif //KAB_EMBEDDED | 49 | #endif //KAB_EMBEDDED |
47 | 50 | ||
48 | #include "colorlistbox.h" | 51 | #include "colorlistbox.h" |
49 | 52 | ||
50 | #include "configurecardviewdialog.h" | 53 | #include "configurecardviewdialog.h" |
51 | 54 | ||
52 | ///////////////////////////////// | 55 | ///////////////////////////////// |
53 | // ConfigureCardViewDialog | 56 | // ConfigureCardViewDialog |
54 | 57 | ||
55 | ConfigureCardViewWidget::ConfigureCardViewWidget( KABC::AddressBook *ab, QWidget *parent, | 58 | ConfigureCardViewWidget::ConfigureCardViewWidget( KABC::AddressBook *ab, QWidget *parent, |
56 | const char *name ) | 59 | const char *name ) |
57 | : ViewConfigureWidget( ab, parent, name ) | 60 | : ViewConfigureWidget( ab, parent, name ) |
58 | { | 61 | { |
59 | #ifndef KAB_EMBEDDED | 62 | #ifndef KAB_EMBEDDED |
60 | QWidget *page = addPage( i18n( "Look & Feel" ), QString::null, | 63 | QWidget *page = addPage( i18n( "Look & Feel" ), QString::null, |
61 | DesktopIcon( "looknfeel" ) ); | 64 | DesktopIcon( "looknfeel" ) ); |
62 | #else //KAB_EMBEDDED | 65 | #else //KAB_EMBEDDED |
63 | QWidget *page = addPage( i18n( "Look & Feel" ), QString::null, | 66 | QWidget *page = addPage( i18n( "Look & Feel" ), QString::null, |
64 | KGlobal::iconLoader()->loadIcon( "looknfeel", | 67 | KGlobal::iconLoader()->loadIcon( "looknfeel", |
65 | KIcon::Panel ) ); | 68 | KIcon::Panel ) ); |
66 | #endif //KAB_EMBEDDED | 69 | #endif //KAB_EMBEDDED |
67 | 70 | ||
68 | mAdvancedPage = new CardViewLookNFeelPage( page ); | 71 | mAdvancedPage = new CardViewLookNFeelPage( page ); |
69 | } | 72 | } |
70 | 73 | ||
71 | ConfigureCardViewWidget::~ConfigureCardViewWidget() | 74 | ConfigureCardViewWidget::~ConfigureCardViewWidget() |
72 | { | 75 | { |
73 | } | 76 | } |
74 | 77 | ||
75 | void ConfigureCardViewWidget::restoreSettings( KConfig *config ) | 78 | void ConfigureCardViewWidget::restoreSettings( KConfig *config ) |
76 | { | 79 | { |
77 | ViewConfigureWidget::restoreSettings( config ); | 80 | ViewConfigureWidget::restoreSettings( config ); |
78 | 81 | ||
79 | mAdvancedPage->restoreSettings( config ); | 82 | mAdvancedPage->restoreSettings( config ); |
80 | } | 83 | } |
81 | 84 | ||
82 | void ConfigureCardViewWidget::saveSettings( KConfig *config ) | 85 | void ConfigureCardViewWidget::saveSettings( KConfig *config ) |
83 | { | 86 | { |
84 | ViewConfigureWidget::saveSettings( config ); | 87 | ViewConfigureWidget::saveSettings( config ); |
85 | 88 | ||
86 | mAdvancedPage->saveSettings( config ); | 89 | mAdvancedPage->saveSettings( config ); |
87 | } | 90 | } |
88 | 91 | ||
89 | //////////////////////// | 92 | //////////////////////// |
90 | // CardViewLookNFeelPage | 93 | // CardViewLookNFeelPage |
91 | CardViewLookNFeelPage::CardViewLookNFeelPage( QWidget *parent, const char *name ) | 94 | CardViewLookNFeelPage::CardViewLookNFeelPage( QWidget *parent, const char *name ) |
92 | : QVBox( parent, name ) | 95 | : Q3VBox( parent, name ) |
93 | { | 96 | { |
94 | initGUI(); | 97 | initGUI(); |
95 | } | 98 | } |
96 | 99 | ||
97 | CardViewLookNFeelPage::~CardViewLookNFeelPage() | 100 | CardViewLookNFeelPage::~CardViewLookNFeelPage() |
98 | { | 101 | { |
99 | } | 102 | } |
100 | 103 | ||
101 | void CardViewLookNFeelPage::restoreSettings( KConfig *config ) | 104 | void CardViewLookNFeelPage::restoreSettings( KConfig *config ) |
102 | { | 105 | { |
103 | // colors | 106 | // colors |
104 | cbEnableCustomColors->setChecked( config->readBoolEntry( "EnableCustomColors", false ) ); | 107 | cbEnableCustomColors->setChecked( config->readBoolEntry( "EnableCustomColors", false ) ); |
105 | QColor c; | 108 | QColor c; |
106 | qDebug("CardViewLookNFeelPage::restoreSettings make base color configurable"); | 109 | qDebug("CardViewLookNFeelPage::restoreSettings make base color configurable"); |
107 | 110 | ||
108 | #ifndef KAB_EMBEDDED | 111 | #ifndef KAB_EMBEDDED |
109 | c = KGlobalSettings::baseColor(); | 112 | c = KGlobalSettings::baseColor(); |
110 | #else //KAB_EMBEDDED | 113 | #else //KAB_EMBEDDED |
111 | c = QColor(0,0,0); | 114 | c = QColor(0,0,0); |
112 | #endif //KAB_EMBEDDED | 115 | #endif //KAB_EMBEDDED |
113 | 116 | ||
114 | c = colorGroup().background(); | 117 | c = colorGroup().background(); |
115 | lbColors->insertItem( new ColorListItem( i18n("Background Color"), | 118 | lbColors->insertItem( new ColorListItem( i18n("Background Color"), |
116 | config->readColorEntry( "BackgroundColor", &c ) ) ); | 119 | config->readColorEntry( "BackgroundColor", &c ) ) ); |
117 | c = colorGroup().foreground(); | 120 | c = colorGroup().foreground(); |
118 | lbColors->insertItem( new ColorListItem( i18n("Text Color"), | 121 | lbColors->insertItem( new ColorListItem( i18n("Text Color"), |
119 | config->readColorEntry( "TextColor", &c ) ) ); | 122 | config->readColorEntry( "TextColor", &c ) ) ); |
120 | c = colorGroup().button(); | 123 | c = colorGroup().button(); |
121 | lbColors->insertItem( new ColorListItem( i18n("Header, Border and Separator Color"), | 124 | lbColors->insertItem( new ColorListItem( i18n("Header, Border and Separator Color"), |
122 | config->readColorEntry( "HeaderColor", &c ) ) ); | 125 | config->readColorEntry( "HeaderColor", &c ) ) ); |
123 | c = colorGroup().buttonText(); | 126 | c = colorGroup().buttonText(); |
124 | lbColors->insertItem( new ColorListItem( i18n("Header Text Color"), | 127 | lbColors->insertItem( new ColorListItem( i18n("Header Text Color"), |
125 | config->readColorEntry( "HeaderTextColor", &c ) ) ); | 128 | config->readColorEntry( "HeaderTextColor", &c ) ) ); |
126 | c = colorGroup().highlight(); | 129 | c = colorGroup().highlight(); |
127 | lbColors->insertItem( new ColorListItem( i18n("Highlight Color"), | 130 | lbColors->insertItem( new ColorListItem( i18n("Highlight Color"), |
128 | config->readColorEntry( "HighlightColor", &c ) ) ); | 131 | config->readColorEntry( "HighlightColor", &c ) ) ); |
129 | c = colorGroup().highlightedText(); | 132 | c = colorGroup().highlightedText(); |
130 | lbColors->insertItem( new ColorListItem( i18n("Highlighted Text Color"), | 133 | lbColors->insertItem( new ColorListItem( i18n("Highlighted Text Color"), |
131 | config->readColorEntry( "HighlightedTextColor", &c ) ) ); | 134 | config->readColorEntry( "HighlightedTextColor", &c ) ) ); |
132 | 135 | ||
133 | enableColors(); | 136 | enableColors(); |
134 | 137 | ||
135 | // fonts | 138 | // fonts |
136 | QFont fnt = font(); | 139 | QFont fnt = font(); |
137 | updateFontLabel( config->readFontEntry( "TextFont", &fnt ), (QLabel*)lTextFont ); | 140 | updateFontLabel( config->readFontEntry( "TextFont", &fnt ), (QLabel*)lTextFont ); |
138 | fnt.setBold( true ); | 141 | fnt.setBold( true ); |
139 | updateFontLabel( config->readFontEntry( "HeaderFont", &fnt ), (QLabel*)lHeaderFont ); | 142 | updateFontLabel( config->readFontEntry( "HeaderFont", &fnt ), (QLabel*)lHeaderFont ); |
140 | cbEnableCustomFonts->setChecked( config->readBoolEntry( "EnableCustomFonts", false ) ); | 143 | cbEnableCustomFonts->setChecked( config->readBoolEntry( "EnableCustomFonts", false ) ); |
141 | enableFonts(); | 144 | enableFonts(); |
142 | 145 | ||
143 | // layout | 146 | // layout |
144 | sbMargin->setValue( config->readNumEntry( "ItemMargin", 0 ) ); | 147 | sbMargin->setValue( config->readNumEntry( "ItemMargin", 0 ) ); |
145 | sbSpacing->setValue( config->readNumEntry( "ItemSpacing", 10 ) ); | 148 | sbSpacing->setValue( config->readNumEntry( "ItemSpacing", 10 ) ); |
146 | sbSepWidth->setValue( config->readNumEntry( "SeparatorWidth", 2 ) ); | 149 | sbSepWidth->setValue( config->readNumEntry( "SeparatorWidth", 2 ) ); |
147 | cbDrawSeps->setChecked( config->readBoolEntry( "DrawSeparators", true ) ); | 150 | cbDrawSeps->setChecked( config->readBoolEntry( "DrawSeparators", true ) ); |
148 | cbDrawBorders->setChecked( config->readBoolEntry( "DrawBorder", true ) ); | 151 | cbDrawBorders->setChecked( config->readBoolEntry( "DrawBorder", true ) ); |
149 | 152 | ||
150 | // behaviour | 153 | // behaviour |
151 | cbShowFieldLabels->setChecked( config->readBoolEntry( "DrawFieldLabels", false ) ); | 154 | cbShowFieldLabels->setChecked( config->readBoolEntry( "DrawFieldLabels", false ) ); |
152 | cbShowEmptyFields->setChecked( config->readBoolEntry( "ShowEmptyFields", false ) ); | 155 | cbShowEmptyFields->setChecked( config->readBoolEntry( "ShowEmptyFields", false ) ); |
153 | } | 156 | } |
154 | 157 | ||
155 | void CardViewLookNFeelPage::saveSettings( KConfig *config ) | 158 | void CardViewLookNFeelPage::saveSettings( KConfig *config ) |
156 | { | 159 | { |
157 | // colors | 160 | // colors |
158 | config->writeEntry( "EnableCustomColors", cbEnableCustomColors->isChecked() ); | 161 | config->writeEntry( "EnableCustomColors", cbEnableCustomColors->isChecked() ); |
159 | if ( cbEnableCustomColors->isChecked() ) // ?? - Hmmm. | 162 | if ( cbEnableCustomColors->isChecked() ) // ?? - Hmmm. |
160 | { | 163 | { |
161 | config->writeEntry( "BackgroundColor", lbColors->color( 0 ) ); | 164 | config->writeEntry( "BackgroundColor", lbColors->color( 0 ) ); |
162 | config->writeEntry( "TextColor", lbColors->color( 1 ) ); | 165 | config->writeEntry( "TextColor", lbColors->color( 1 ) ); |
163 | config->writeEntry( "HeaderColor", lbColors->color( 2 ) ); | 166 | config->writeEntry( "HeaderColor", lbColors->color( 2 ) ); |
164 | config->writeEntry( "HeaderTextColor", lbColors->color( 3 ) ); | 167 | config->writeEntry( "HeaderTextColor", lbColors->color( 3 ) ); |
165 | config->writeEntry( "HighlightColor", lbColors->color( 4 ) ); | 168 | config->writeEntry( "HighlightColor", lbColors->color( 4 ) ); |
166 | config->writeEntry( "HighlightedTextColor", lbColors->color( 5 ) ); | 169 | config->writeEntry( "HighlightedTextColor", lbColors->color( 5 ) ); |
167 | } | 170 | } |
168 | // fonts | 171 | // fonts |
169 | config->writeEntry( "EnableCustomFonts", cbEnableCustomFonts->isChecked() ); | 172 | config->writeEntry( "EnableCustomFonts", cbEnableCustomFonts->isChecked() ); |
170 | if ( cbEnableCustomFonts->isChecked() ) | 173 | if ( cbEnableCustomFonts->isChecked() ) |
171 | { | 174 | { |
172 | config->writeEntry( "TextFont", lTextFont->font() ); | 175 | config->writeEntry( "TextFont", lTextFont->font() ); |
173 | config->writeEntry( "HeaderFont", lHeaderFont->font() ); | 176 | config->writeEntry( "HeaderFont", lHeaderFont->font() ); |
174 | } | 177 | } |
175 | // layout | 178 | // layout |
176 | config->writeEntry( "ItemMargin", sbMargin->value() ); | 179 | config->writeEntry( "ItemMargin", sbMargin->value() ); |
177 | config->writeEntry( "ItemSpacing", sbSpacing->value() ); | 180 | config->writeEntry( "ItemSpacing", sbSpacing->value() ); |
178 | config->writeEntry( "SeparatorWidth", sbSepWidth->value() ); | 181 | config->writeEntry( "SeparatorWidth", sbSepWidth->value() ); |
179 | config->writeEntry("DrawBorder", cbDrawBorders->isChecked()); | 182 | config->writeEntry("DrawBorder", cbDrawBorders->isChecked()); |
180 | config->writeEntry("DrawSeparators", cbDrawSeps->isChecked()); | 183 | config->writeEntry("DrawSeparators", cbDrawSeps->isChecked()); |
181 | 184 | ||
182 | // behaviour | 185 | // behaviour |
183 | config->writeEntry("DrawFieldLabels", cbShowFieldLabels->isChecked()); | 186 | config->writeEntry("DrawFieldLabels", cbShowFieldLabels->isChecked()); |
184 | config->writeEntry("ShowEmptyFields", cbShowEmptyFields->isChecked()); | 187 | config->writeEntry("ShowEmptyFields", cbShowEmptyFields->isChecked()); |
185 | } | 188 | } |
186 | 189 | ||
187 | void CardViewLookNFeelPage::setTextFont() | 190 | void CardViewLookNFeelPage::setTextFont() |
188 | { | 191 | { |
189 | QFont f( lTextFont->font() ); | 192 | QFont f( lTextFont->font() ); |
190 | #ifndef KAB_EMBEDDED | 193 | #ifndef KAB_EMBEDDED |
191 | if ( KFontDialog::getFont( f, false, this ) == QDialog::Accepted ) | 194 | if ( KFontDialog::getFont( f, false, this ) == QDialog::Accepted ) |
192 | updateFontLabel( f, lTextFont ); | 195 | updateFontLabel( f, lTextFont ); |
193 | #else //KAB_EMBEDDED | 196 | #else //KAB_EMBEDDED |
194 | bool ok; | 197 | bool ok; |
195 | QFont fout = KFontDialog::getFont( f, ok); | 198 | QFont fout = KFontDialog::getFont( f, ok); |
196 | if ( ok ) | 199 | if ( ok ) |
197 | updateFontLabel( fout, lTextFont ); | 200 | updateFontLabel( fout, lTextFont ); |
198 | #endif //KAB_EMBEDDED | 201 | #endif //KAB_EMBEDDED |
199 | } | 202 | } |
200 | 203 | ||
201 | void CardViewLookNFeelPage::setHeaderFont() | 204 | void CardViewLookNFeelPage::setHeaderFont() |
202 | { | 205 | { |
203 | QFont f( lHeaderFont->font() ); | 206 | QFont f( lHeaderFont->font() ); |
204 | #ifndef KAB_EMBEDDED | 207 | #ifndef KAB_EMBEDDED |
205 | if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted ) | 208 | if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted ) |
206 | updateFontLabel( f, lHeaderFont ); | 209 | updateFontLabel( f, lHeaderFont ); |
207 | #else //KAB_EMBEDDED | 210 | #else //KAB_EMBEDDED |
208 | bool ok; | 211 | bool ok; |
209 | QFont fout = KFontDialog::getFont( f, ok); | 212 | QFont fout = KFontDialog::getFont( f, ok); |
210 | if ( ok ) | 213 | if ( ok ) |
211 | updateFontLabel( fout, lHeaderFont ); | 214 | updateFontLabel( fout, lHeaderFont ); |
212 | #endif //KAB_EMBEDDED | 215 | #endif //KAB_EMBEDDED |
213 | } | 216 | } |
214 | 217 | ||
215 | void CardViewLookNFeelPage::enableFonts() | 218 | void CardViewLookNFeelPage::enableFonts() |
216 | { | 219 | { |
217 | vbFonts->setEnabled( cbEnableCustomFonts->isChecked() ); | 220 | vbFonts->setEnabled( cbEnableCustomFonts->isChecked() ); |
218 | if ( cbEnableCustomFonts->isChecked() ) | 221 | if ( cbEnableCustomFonts->isChecked() ) |
219 | vbFonts->setFocus(); | 222 | vbFonts->setFocus(); |
220 | } | 223 | } |
221 | 224 | ||
222 | void CardViewLookNFeelPage::enableColors() | 225 | void CardViewLookNFeelPage::enableColors() |
223 | { | 226 | { |
224 | lbColors->setEnabled( cbEnableCustomColors->isChecked() ); | 227 | lbColors->setEnabled( cbEnableCustomColors->isChecked() ); |
225 | if ( cbEnableCustomColors->isChecked() ) | 228 | if ( cbEnableCustomColors->isChecked() ) |
226 | lbColors->setFocus(); | 229 | lbColors->setFocus(); |
227 | } | 230 | } |
228 | 231 | ||
229 | void CardViewLookNFeelPage::initGUI() | 232 | void CardViewLookNFeelPage::initGUI() |
230 | { | 233 | { |
231 | int spacing = KDialog::spacingHint(); | 234 | int spacing = KDialog::spacingHint(); |
232 | int margin = KDialog::marginHint(); | 235 | int margin = KDialog::marginHint(); |
233 | 236 | ||
234 | QTabWidget *tabs = new QTabWidget( this ); | 237 | QTabWidget *tabs = new QTabWidget( this ); |
235 | 238 | ||
236 | // Layout | 239 | // Layout |
237 | QVBox *loTab = new QVBox( this, "layouttab" ); | 240 | Q3VBox *loTab = new Q3VBox( this, "layouttab" ); |
238 | 241 | ||
239 | loTab->setSpacing( spacing ); | 242 | loTab->setSpacing( spacing ); |
240 | loTab->setMargin( margin ); | 243 | loTab->setMargin( margin ); |
241 | 244 | ||
242 | QGroupBox *gbGeneral = new QGroupBox( 1, Qt::Horizontal, i18n("General"), loTab ); | 245 | Q3GroupBox *gbGeneral = new Q3GroupBox( 1, Qt::Horizontal, i18n("General"), loTab ); |
243 | 246 | ||
244 | cbDrawSeps = new QCheckBox( i18n("Draw &separators"), gbGeneral ); | 247 | cbDrawSeps = new QCheckBox( i18n("Draw &separators"), gbGeneral ); |
245 | 248 | ||
246 | QHBox *hbSW = new QHBox( gbGeneral ); | 249 | Q3HBox *hbSW = new Q3HBox( gbGeneral ); |
247 | QLabel *lSW = new QLabel( i18n("Separator &width:"), hbSW ); | 250 | QLabel *lSW = new QLabel( i18n("Separator &width:"), hbSW ); |
248 | sbSepWidth = new QSpinBox( 1, 50, 1, hbSW ); | 251 | sbSepWidth = new QSpinBox( 1, 50, 1, hbSW ); |
249 | lSW->setBuddy( sbSepWidth); | 252 | lSW->setBuddy( sbSepWidth); |
250 | 253 | ||
251 | QHBox *hbPadding = new QHBox( gbGeneral ); | 254 | Q3HBox *hbPadding = new Q3HBox( gbGeneral ); |
252 | QLabel *lSpacing = new QLabel( i18n("&Padding:"), hbPadding ); | 255 | QLabel *lSpacing = new QLabel( i18n("&Padding:"), hbPadding ); |
253 | sbSpacing = new QSpinBox( 0, 100, 1, hbPadding ); | 256 | sbSpacing = new QSpinBox( 0, 100, 1, hbPadding ); |
254 | lSpacing->setBuddy( sbSpacing ); | 257 | lSpacing->setBuddy( sbSpacing ); |
255 | 258 | ||
256 | QGroupBox *gbCards = new QGroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab ); | 259 | Q3GroupBox *gbCards = new Q3GroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab ); |
257 | 260 | ||
258 | QHBox *hbMargin = new QHBox( gbCards ); | 261 | Q3HBox *hbMargin = new Q3HBox( gbCards ); |
259 | QLabel *lMargin = new QLabel( i18n("&Margin:"), hbMargin ); | 262 | QLabel *lMargin = new QLabel( i18n("&Margin:"), hbMargin ); |
260 | sbMargin = new QSpinBox( 0, 100, 1, hbMargin ); | 263 | sbMargin = new QSpinBox( 0, 100, 1, hbMargin ); |
261 | lMargin->setBuddy( sbMargin ); | 264 | lMargin->setBuddy( sbMargin ); |
262 | 265 | ||
263 | cbDrawBorders = new QCheckBox( i18n("Draw &borders"), gbCards ); | 266 | cbDrawBorders = new QCheckBox( i18n("Draw &borders"), gbCards ); |
264 | 267 | ||
265 | loTab->setStretchFactor( new QWidget( loTab ), 1 ); | 268 | loTab->setStretchFactor( new QWidget( loTab ), 1 ); |
266 | 269 | ||
267 | QWhatsThis::add( sbMargin, i18n( | 270 | Q3WhatsThis::add( sbMargin, i18n( |
268 | "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, " | 271 | "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, " |
269 | "incrementing the item margin will add space between the focus rectangle and the item data." | 272 | "incrementing the item margin will add space between the focus rectangle and the item data." |
270 | ) ); | 273 | ) ); |
271 | QWhatsThis::add( lMargin, QWhatsThis::textFor( sbMargin ) ); | 274 | /* TODO:hacker: Q3WhatsThis::add( lMargin, Q3WhatsThis::textFor( sbMargin ) ); */ |
272 | QWhatsThis::add( sbSpacing, i18n( | 275 | Q3WhatsThis::add( sbSpacing, i18n( |
273 | "The Item Spacing decides the distance (in pixels) between the items and anything else: the view " | 276 | "The Item Spacing decides the distance (in pixels) between the items and anything else: the view " |
274 | "borders, other items or column separators." | 277 | "borders, other items or column separators." |
275 | ) ); | 278 | ) ); |
276 | QWhatsThis::add( lSpacing, QWhatsThis::textFor( sbSpacing ) ); | 279 | /* TODO:hacker: Q3WhatsThis::add( lSpacing, Q3WhatsThis::textFor( sbSpacing ) ); */ |
277 | QWhatsThis::add( sbSepWidth, i18n("Sets the width of column separators") ); | 280 | Q3WhatsThis::add( sbSepWidth, i18n("Sets the width of column separators") ); |
278 | QWhatsThis::add( lSW, QWhatsThis::textFor( sbSepWidth ) ); | 281 | /* TODO:hacker: Q3WhatsThis::add( lSW, Q3WhatsThis::textFor( sbSepWidth ) ); */ |
279 | 282 | ||
280 | tabs->addTab( loTab, i18n("&Layout") ); | 283 | tabs->addTab( loTab, i18n("&Layout") ); |
281 | 284 | ||
282 | // Colors | 285 | // Colors |
283 | QVBox *colorTab = new QVBox( this, "colortab" ); | 286 | Q3VBox *colorTab = new Q3VBox( this, "colortab" ); |
284 | colorTab->setSpacing( spacing ); | 287 | colorTab->setSpacing( spacing ); |
285 | colorTab->setMargin( spacing ); | 288 | colorTab->setMargin( spacing ); |
286 | cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); | 289 | cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); |
287 | connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) ); | 290 | connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) ); |
288 | lbColors = new ColorListBox( colorTab ); | 291 | lbColors = new ColorListBox( colorTab ); |
289 | tabs->addTab( colorTab, i18n("&Colors") ); | 292 | tabs->addTab( colorTab, i18n("&Colors") ); |
290 | 293 | ||
291 | QWhatsThis::add( cbEnableCustomColors, i18n( | 294 | Q3WhatsThis::add( cbEnableCustomColors, i18n( |
292 | "If custom colors are enabled, you may choose the colors for the view below. " | 295 | "If custom colors are enabled, you may choose the colors for the view below. " |
293 | "Otherwise colors from your current KDE color scheme are used." | 296 | "Otherwise colors from your current KDE color scheme are used." |
294 | ) ); | 297 | ) ); |
295 | QWhatsThis::add( lbColors, i18n( | 298 | Q3WhatsThis::add( lbColors, i18n( |
296 | "Double click or press RETURN on a item to select a color for the related strings in the view." | 299 | "Double click or press RETURN on a item to select a color for the related strings in the view." |
297 | ) ); | 300 | ) ); |
298 | 301 | ||
299 | // Fonts | 302 | // Fonts |
300 | QVBox *fntTab = new QVBox( this, "fonttab" ); | 303 | Q3VBox *fntTab = new Q3VBox( this, "fonttab" ); |
301 | 304 | ||
302 | fntTab->setSpacing( spacing ); | 305 | fntTab->setSpacing( spacing ); |
303 | fntTab->setMargin( spacing ); | 306 | fntTab->setMargin( spacing ); |
304 | 307 | ||
305 | cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab ); | 308 | cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab ); |
306 | connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) ); | 309 | connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) ); |
307 | 310 | ||
308 | vbFonts = new QWidget( fntTab ); | 311 | vbFonts = new QWidget( fntTab ); |
309 | QGridLayout *gFnts = new QGridLayout( vbFonts, 2, 3 ); | 312 | Q3GridLayout *gFnts = new Q3GridLayout( vbFonts, 2, 3 ); |
310 | gFnts->setSpacing( spacing ); | 313 | gFnts->setSpacing( spacing ); |
311 | gFnts->setAutoAdd( true ); | 314 | gFnts->setAutoAdd( true ); |
312 | gFnts->setColStretch( 1, 1 ); | 315 | gFnts->setColStretch( 1, 1 ); |
313 | QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts ); | 316 | QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts ); |
314 | lTextFont = new QLabel( vbFonts ); | 317 | lTextFont = new QLabel( vbFonts ); |
315 | lTextFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); | 318 | lTextFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken ); |
316 | #ifndef KAB_EMBEDDED | 319 | #ifndef KAB_EMBEDDED |
317 | btnFont = new KPushButton( i18n("Choose..."), vbFonts ); | 320 | btnFont = new KPushButton( i18n("Choose..."), vbFonts ); |
318 | #else //KAB_EMBEDDED | 321 | #else //KAB_EMBEDDED |
319 | btnFont = new QPushButton( i18n("Choose..."), vbFonts ); | 322 | btnFont = new QPushButton( i18n("Choose..."), vbFonts ); |
320 | #endif //KAB_EMBEDDED | 323 | #endif //KAB_EMBEDDED |
321 | 324 | ||
322 | lTFnt->setBuddy( btnFont ); | 325 | lTFnt->setBuddy( btnFont ); |
323 | 326 | ||
324 | connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) ); | 327 | connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) ); |
325 | 328 | ||
326 | QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts ); | 329 | QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts ); |
327 | lHeaderFont = new QLabel( vbFonts ); | 330 | lHeaderFont = new QLabel( vbFonts ); |
328 | lHeaderFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); | 331 | lHeaderFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken ); |
329 | #ifndef KAB_EMBEDDED | 332 | #ifndef KAB_EMBEDDED |
330 | btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts ); | 333 | btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts ); |
331 | #else //KAB_EMBEDDED | 334 | #else //KAB_EMBEDDED |
332 | btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts ); | 335 | btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts ); |
333 | #endif //KAB_EMBEDDED | 336 | #endif //KAB_EMBEDDED |
334 | lHFnt->setBuddy( btnHeaderFont ); | 337 | lHFnt->setBuddy( btnHeaderFont ); |
335 | connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) ); | 338 | connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) ); |
336 | 339 | ||
337 | fntTab->setStretchFactor( new QWidget( fntTab ), 1 ); | 340 | fntTab->setStretchFactor( new QWidget( fntTab ), 1 ); |
338 | 341 | ||
339 | QWhatsThis::add( cbEnableCustomFonts, i18n( | 342 | Q3WhatsThis::add( cbEnableCustomFonts, i18n( |
340 | "If custom fonts are enabled, you may choose which fonts to use for this view below. " | 343 | "If custom fonts are enabled, you may choose which fonts to use for this view below. " |
341 | "Otherwise the default KDE font will be used, in bold style for the header and " | 344 | "Otherwise the default KDE font will be used, in bold style for the header and " |
342 | "normal style for the data." | 345 | "normal style for the data." |
343 | ) ); | 346 | ) ); |
344 | 347 | ||
345 | tabs->addTab( fntTab, i18n("&Fonts") ); | 348 | tabs->addTab( fntTab, i18n("&Fonts") ); |
346 | 349 | ||
347 | // Behaviour | 350 | // Behaviour |
348 | QVBox *behaviourTab = new QVBox( this ); | 351 | Q3VBox *behaviourTab = new Q3VBox( this ); |
349 | behaviourTab->setMargin( margin ); | 352 | behaviourTab->setMargin( margin ); |
350 | behaviourTab->setSpacing( spacing ); | 353 | behaviourTab->setSpacing( spacing ); |
351 | 354 | ||
352 | cbShowEmptyFields = new QCheckBox( i18n("Show &empty fields"), behaviourTab ); | 355 | cbShowEmptyFields = new QCheckBox( i18n("Show &empty fields"), behaviourTab ); |
353 | cbShowFieldLabels = new QCheckBox( i18n("Show field &labels"), behaviourTab ); | 356 | cbShowFieldLabels = new QCheckBox( i18n("Show field &labels"), behaviourTab ); |
354 | 357 | ||
355 | behaviourTab->setStretchFactor( new QWidget( behaviourTab ), 1 ); | 358 | behaviourTab->setStretchFactor( new QWidget( behaviourTab ), 1 ); |
356 | 359 | ||
357 | tabs->addTab( behaviourTab, i18n("Be&havior") ); | 360 | tabs->addTab( behaviourTab, i18n("Be&havior") ); |
358 | 361 | ||
359 | } | 362 | } |
360 | 363 | ||
361 | void CardViewLookNFeelPage::updateFontLabel( QFont fnt, QLabel *l ) | 364 | void CardViewLookNFeelPage::updateFontLabel( QFont fnt, QLabel *l ) |
362 | { | 365 | { |
363 | l->setFont( fnt ); | 366 | l->setFont( fnt ); |
364 | l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) ); | 367 | l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) ); |
365 | } | 368 | } |
366 | 369 | ||
367 | #ifndef KAB_EMBEDDED | 370 | #ifndef KAB_EMBEDDED_ |
368 | #include "configurecardviewdialog.moc" | 371 | #include "moc_configurecardviewdialog.cpp" |
369 | #endif //KAB_EMBEDDED | 372 | #endif //KAB_EMBEDDED |