Diffstat (limited to 'kmicromail/koprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/koprefsdialog.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp index 5c8a5a9..4af4a8c 100644 --- a/kmicromail/koprefsdialog.cpp +++ b/kmicromail/koprefsdialog.cpp | |||
@@ -57,192 +57,211 @@ | |||
57 | #include <klineedit.h> | 57 | #include <klineedit.h> |
58 | 58 | ||
59 | 59 | ||
60 | #include "koprefs.h" | 60 | #include "koprefs.h" |
61 | 61 | ||
62 | #include "koprefsdialog.h" | 62 | #include "koprefsdialog.h" |
63 | //#include <kprefswidget.h> | 63 | //#include <kprefswidget.h> |
64 | 64 | ||
65 | 65 | ||
66 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : | 66 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : |
67 | KPrefsDialog(KOPrefs::instance(),parent,name,true) | 67 | KPrefsDialog(KOPrefs::instance(),parent,name,true) |
68 | { | 68 | { |
69 | 69 | ||
70 | setCaption( i18n("Settings - some need a restart (nr)")); | 70 | setCaption( i18n("Settings - some need a restart (nr)")); |
71 | setupGlobalTab(); | 71 | setupGlobalTab(); |
72 | setupMainTab(); | 72 | setupMainTab(); |
73 | setupMailTab();; | 73 | setupMailTab();; |
74 | setupFontsTab(); | 74 | setupFontsTab(); |
75 | readConfig(); | 75 | readConfig(); |
76 | 76 | ||
77 | #if 0 | 77 | #if 0 |
78 | 78 | ||
79 | setupMainTab(); | 79 | setupMainTab(); |
80 | setupLocaleTab(); | 80 | setupLocaleTab(); |
81 | setupTimeZoneTab(); | 81 | setupTimeZoneTab(); |
82 | setupTimeTab(); | 82 | setupTimeTab(); |
83 | setupLocaleDateTab(); | 83 | setupLocaleDateTab(); |
84 | setupFontsTab(); | 84 | setupFontsTab(); |
85 | setupColorsTab(); | 85 | setupColorsTab(); |
86 | setupViewsTab(); | 86 | setupViewsTab(); |
87 | //setupSyncTab(); | 87 | //setupSyncTab(); |
88 | //setupSyncAlgTab(); | 88 | //setupSyncAlgTab(); |
89 | //setupPrinterTab(); | 89 | //setupPrinterTab(); |
90 | //setupGroupSchedulingTab(); | 90 | //setupGroupSchedulingTab(); |
91 | //setupGroupAutomationTab(); | 91 | //setupGroupAutomationTab(); |
92 | #endif | 92 | #endif |
93 | } | 93 | } |
94 | 94 | ||
95 | #include "kpimglobalprefs.h" | 95 | #include "kpimglobalprefs.h" |
96 | 96 | ||
97 | KOPrefsDialog::~KOPrefsDialog() | 97 | KOPrefsDialog::~KOPrefsDialog() |
98 | { | 98 | { |
99 | } | 99 | } |
100 | void KOPrefsDialog::setupGlobalTab() | 100 | void KOPrefsDialog::setupGlobalTab() |
101 | { | 101 | { |
102 | QFrame *topFrame = addPage(i18n("Global"),0,0); | 102 | QFrame *topFrame = addPage(i18n("Global"),0,0); |
103 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); | 103 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); |
104 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); | 104 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); |
105 | topLayout->addWidget( kdelibcfg ); | 105 | topLayout->addWidget( kdelibcfg ); |
106 | 106 | ||
107 | 107 | ||
108 | } | 108 | } |
109 | void KOPrefsDialog::setupMainTab() | 109 | void KOPrefsDialog::setupMainTab() |
110 | { | 110 | { |
111 | QFrame *topFrame = addPage(i18n("General"),0,0); | 111 | QFrame *topFrame = addPage(i18n("General"),0,0); |
112 | 112 | ||
113 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 113 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
114 | topLayout->setSpacing(spacingHint()); | 114 | topLayout->setSpacing(spacingHint()); |
115 | topLayout->setMargin(marginHint()); | 115 | topLayout->setMargin(marginHint()); |
116 | 116 | ||
117 | 117 | ||
118 | mNameEdit = new QLineEdit(topFrame); | 118 | mNameEdit = new QLineEdit(topFrame); |
119 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 119 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
120 | topLayout->addWidget(mNameLabel,0,0); | 120 | topLayout->addWidget(mNameLabel,0,0); |
121 | topLayout->addWidget(mNameEdit,0,1); | 121 | topLayout->addWidget(mNameEdit,0,1); |
122 | 122 | ||
123 | mEmailEdit = new QLineEdit(topFrame); | 123 | mEmailEdit = new QLineEdit(topFrame); |
124 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 124 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
125 | topLayout->addWidget(mEmailLabel,1,0); | 125 | topLayout->addWidget(mEmailLabel,1,0); |
126 | topLayout->addWidget(mEmailEdit,1,1); | 126 | topLayout->addWidget(mEmailEdit,1,1); |
127 | QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); | 127 | QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); |
128 | topLayout->addMultiCellWidget(lab,2,2,0,1); | 128 | topLayout->addMultiCellWidget(lab,2,2,0,1); |
129 | KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), | 129 | KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), |
130 | &(KOPrefs::instance()->mUseKapi),topFrame); | 130 | &(KOPrefs::instance()->mUseKapi),topFrame); |
131 | topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); | 131 | topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); |
132 | } | 132 | } |
133 | 133 | ||
134 | void KOPrefsDialog::setupMailTab() | 134 | void KOPrefsDialog::setupMailTab() |
135 | { | 135 | { |
136 | QFrame *topFrame = addPage(i18n("Mail"),0,0); | 136 | QFrame *topFrame = addPage(i18n("Mail"),0,0); |
137 | 137 | ||
138 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 138 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
139 | topLayout->setSpacing(spacingHint()); | 139 | topLayout->setSpacing(spacingHint()); |
140 | topLayout->setMargin(marginHint()); | 140 | topLayout->setMargin(marginHint()); |
141 | 141 | ||
142 | KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), | 142 | KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), |
143 | &(KOPrefs::instance()->mViewAsHtml),topFrame); | 143 | &(KOPrefs::instance()->mViewAsHtml),topFrame); |
144 | topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); | 144 | topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); |
145 | 145 | ||
146 | 146 | ||
147 | ttt = addWidBool(i18n("Send mails later"), | 147 | ttt = addWidBool(i18n("Send mails later"), |
148 | &(KOPrefs::instance()->mSendLater),topFrame); | 148 | &(KOPrefs::instance()->mSendLater),topFrame); |
149 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); | 149 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); |
150 | ttt = addWidBool(i18n("Show \"To\" field in list view"), | 150 | ttt = addWidBool(i18n("Show \"To\" field in list view"), |
151 | &(KOPrefs::instance()->mShowToField),topFrame); | 151 | &(KOPrefs::instance()->mShowToField),topFrame); |
152 | topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); | 152 | topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); |
153 | |||
154 | int iii =3; | ||
155 | ttt = addWidBool(i18n("Show info fields at startup"), | ||
156 | &(KOPrefs::instance()->mShowInfoStart),topFrame); | ||
157 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | ||
158 | ++iii; | ||
159 | ttt = addWidBool(i18n("Show \"Subject\" info field"), | ||
160 | &(KOPrefs::instance()->mShowInfoSub),topFrame); | ||
161 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | ||
162 | ++iii; | ||
163 | ttt = addWidBool(i18n("Show \"From\" info field"), | ||
164 | &(KOPrefs::instance()->mShowInfoFrom),topFrame); | ||
165 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | ||
166 | ++iii; | ||
167 | ttt = addWidBool(i18n("Show \"To\" info field"), | ||
168 | &(KOPrefs::instance()->mShowInfoTo),topFrame); | ||
169 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | ||
170 | ++iii; | ||
171 | |||
153 | /* | 172 | /* |
154 | mCodecEdit = new QLineEdit(topFrame); | 173 | mCodecEdit = new QLineEdit(topFrame); |
155 | topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); | 174 | topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); |
156 | topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); | 175 | topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); |
157 | topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); | 176 | topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); |
158 | */ | 177 | */ |
159 | } | 178 | } |
160 | void KOPrefsDialog::setupFontsTab() | 179 | void KOPrefsDialog::setupFontsTab() |
161 | { | 180 | { |
162 | 181 | ||
163 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); | 182 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); |
164 | // DesktopIcon("fonts",KIcon::SizeMedium)); | 183 | // DesktopIcon("fonts",KIcon::SizeMedium)); |
165 | 184 | ||
166 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); | 185 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); |
167 | topLayout->setSpacing(1); | 186 | topLayout->setSpacing(1); |
168 | topLayout->setMargin(3); | 187 | topLayout->setMargin(3); |
169 | KPrefsDialogWidFont * tVFont; | 188 | KPrefsDialogWidFont * tVFont; |
170 | int i = 0; | 189 | int i = 0; |
171 | KPrefsDialogWidFont *timeLabelsFont = | 190 | KPrefsDialogWidFont *timeLabelsFont = |
172 | addWidFont(i18n("OK"),i18n("Application(nr)"), | 191 | addWidFont(i18n("OK"),i18n("Application(nr)"), |
173 | &(KOPrefs::instance()->mAppFont),topFrame); | 192 | &(KOPrefs::instance()->mAppFont),topFrame); |
174 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 193 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
175 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 194 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
176 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 195 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
177 | ++i; | 196 | ++i; |
178 | 197 | ||
179 | 198 | ||
180 | timeLabelsFont = | 199 | timeLabelsFont = |
181 | addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), | 200 | addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), |
182 | &(KOPrefs::instance()->mComposeFont),topFrame); | 201 | &(KOPrefs::instance()->mComposeFont),topFrame); |
183 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 202 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
184 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 203 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
185 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 204 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
186 | ++i; | 205 | ++i; |
187 | 206 | ||
188 | KPrefsDialogWidFont *timeBarFont = | 207 | KPrefsDialogWidFont *timeBarFont = |
189 | addWidFont(i18n("Hello"),i18n("Read mail:"), | 208 | addWidFont(i18n("Hello"),i18n("Read mail:"), |
190 | &(KOPrefs::instance()->mReadFont),topFrame); | 209 | &(KOPrefs::instance()->mReadFont),topFrame); |
191 | topLayout->addWidget(timeBarFont->label(),i,0); | 210 | topLayout->addWidget(timeBarFont->label(),i,0); |
192 | topLayout->addWidget(timeBarFont->preview(),i,1); | 211 | topLayout->addWidget(timeBarFont->preview(),i,1); |
193 | topLayout->addWidget(timeBarFont->button(),i,2); | 212 | topLayout->addWidget(timeBarFont->button(),i,2); |
194 | ++i; | 213 | ++i; |
195 | 214 | ||
196 | topLayout->setColStretch(1,1); | 215 | topLayout->setColStretch(1,1); |
197 | topLayout->setRowStretch(4,1); | 216 | topLayout->setRowStretch(4,1); |
198 | 217 | ||
199 | } | 218 | } |
200 | void KOPrefsDialog::usrReadConfig() | 219 | void KOPrefsDialog::usrReadConfig() |
201 | { | 220 | { |
202 | 221 | ||
203 | mNameEdit->setText(KOPrefs::instance()->mName); | 222 | mNameEdit->setText(KOPrefs::instance()->mName); |
204 | mEmailEdit->setText(KOPrefs::instance()->mEmail); | 223 | mEmailEdit->setText(KOPrefs::instance()->mEmail); |
205 | //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); | 224 | //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); |
206 | kdelibcfg->readConfig(); | 225 | kdelibcfg->readConfig(); |
207 | } | 226 | } |
208 | void KOPrefsDialog::usrWriteConfig() | 227 | void KOPrefsDialog::usrWriteConfig() |
209 | { | 228 | { |
210 | KOPrefs::instance()->mName = mNameEdit->text(); | 229 | KOPrefs::instance()->mName = mNameEdit->text(); |
211 | KOPrefs::instance()->mEmail = mEmailEdit->text(); | 230 | KOPrefs::instance()->mEmail = mEmailEdit->text(); |
212 | //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); | 231 | //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); |
213 | kdelibcfg->writeConfig(); | 232 | kdelibcfg->writeConfig(); |
214 | 233 | ||
215 | 234 | ||
216 | } | 235 | } |
217 | 236 | ||
218 | #if 0 | 237 | #if 0 |
219 | void KOPrefsDialog::setupLocaleDateTab() | 238 | void KOPrefsDialog::setupLocaleDateTab() |
220 | { | 239 | { |
221 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | 240 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); |
222 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); | 241 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); |
223 | topLayout->setSpacing(spacingHint()); | 242 | topLayout->setSpacing(spacingHint()); |
224 | topLayout->setMargin(marginHint()); | 243 | topLayout->setMargin(marginHint()); |
225 | int iii = 0; | 244 | int iii = 0; |
226 | 245 | ||
227 | 246 | ||
228 | KPrefsWidRadios *syncPrefsGroup = | 247 | KPrefsWidRadios *syncPrefsGroup = |
229 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); | 248 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); |
230 | QString format; | 249 | QString format; |
231 | if ( QApplication::desktop()->width() < 480 ) | 250 | if ( QApplication::desktop()->width() < 480 ) |
232 | format = "(%d.%m.%Y)"; | 251 | format = "(%d.%m.%Y)"; |
233 | else | 252 | else |
234 | format = "(%d.%m.%Y|%A %d %B %Y)"; | 253 | format = "(%d.%m.%Y|%A %d %B %Y)"; |
235 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | 254 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); |
236 | if ( QApplication::desktop()->width() < 480 ) | 255 | if ( QApplication::desktop()->width() < 480 ) |
237 | format = "(%m.%d.%Y)"; | 256 | format = "(%m.%d.%Y)"; |
238 | else | 257 | else |
239 | format = "(%m.%d.%Y|%A %B %d %Y)"; | 258 | format = "(%m.%d.%Y|%A %B %d %Y)"; |
240 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | 259 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); |
241 | if ( QApplication::desktop()->width() < 480 ) | 260 | if ( QApplication::desktop()->width() < 480 ) |
242 | format = "(%Y-%m-%d)"; | 261 | format = "(%Y-%m-%d)"; |
243 | else | 262 | else |
244 | format = "(%Y-%m-%d|%A %Y %B %d)"; | 263 | format = "(%Y-%m-%d|%A %Y %B %d)"; |
245 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | 264 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); |
246 | syncPrefsGroup->addRadio(i18n("User defined")); | 265 | syncPrefsGroup->addRadio(i18n("User defined")); |
247 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 266 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
248 | ++iii; | 267 | ++iii; |