Diffstat (limited to 'kmicromail/koprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/koprefsdialog.cpp | 1706 |
1 files changed, 1706 insertions, 0 deletions
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp new file mode 100644 index 0000000..87a6715 --- a/dev/null +++ b/kmicromail/koprefsdialog.cpp | |||
@@ -0,0 +1,1706 @@ | |||
1 | /* | ||
2 | This file is part of KOrganizer. | ||
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | ||
4 | |||
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 | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
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 | ||
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
18 | |||
19 | As a special exception, permission is given to link this program | ||
20 | with any edition of Qt, and distribute the resulting executable, | ||
21 | without including the source code for Qt in the source distribution. | ||
22 | */ | ||
23 | |||
24 | #include <qlayout.h> | ||
25 | #include <qlabel.h> | ||
26 | #include <qgroupbox.h> | ||
27 | #include <qbuttongroup.h> | ||
28 | #include <qlineedit.h> | ||
29 | #include <qfont.h> | ||
30 | #include <qslider.h> | ||
31 | #include <qfile.h> | ||
32 | #include <qtextstream.h> | ||
33 | #include <qcombobox.h> | ||
34 | #include <qvbox.h> | ||
35 | #include <qhbox.h> | ||
36 | #include <qregexp.h> | ||
37 | #include <qspinbox.h> | ||
38 | #include <qdatetime.h> | ||
39 | #include <qcheckbox.h> | ||
40 | #include <qradiobutton.h> | ||
41 | #include <qpushbutton.h> | ||
42 | #include <qstrlist.h> | ||
43 | #include <qapplication.h> | ||
44 | |||
45 | #include <kcolorbutton.h> | ||
46 | #include <kdebug.h> | ||
47 | #include <klocale.h> | ||
48 | #include <kglobal.h> | ||
49 | #include <kfontdialog.h> | ||
50 | #include <kfiledialog.h> | ||
51 | #include <kmessagebox.h> | ||
52 | #include <kcolordialog.h> | ||
53 | #include <kiconloader.h> | ||
54 | #include <kemailsettings.h> | ||
55 | #include <kstandarddirs.h> | ||
56 | |||
57 | #include <klineedit.h> | ||
58 | |||
59 | |||
60 | #include "koprefs.h" | ||
61 | |||
62 | #include "koprefsdialog.h" | ||
63 | |||
64 | |||
65 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : | ||
66 | KPrefsDialog(KOPrefs::instance(),parent,name,true) | ||
67 | { | ||
68 | |||
69 | setCaption( i18n("Settings - some need a restart (nr)")); | ||
70 | setupMainTab(); | ||
71 | setupMailTab();; | ||
72 | setupFontsTab(); | ||
73 | readConfig(); | ||
74 | |||
75 | #if 0 | ||
76 | |||
77 | setupMainTab(); | ||
78 | setupLocaleTab(); | ||
79 | setupTimeZoneTab(); | ||
80 | setupTimeTab(); | ||
81 | setupLocaleDateTab(); | ||
82 | setupFontsTab(); | ||
83 | setupColorsTab(); | ||
84 | setupViewsTab(); | ||
85 | //setupSyncTab(); | ||
86 | //setupSyncAlgTab(); | ||
87 | //setupPrinterTab(); | ||
88 | //setupGroupSchedulingTab(); | ||
89 | //setupGroupAutomationTab(); | ||
90 | #endif | ||
91 | } | ||
92 | |||
93 | |||
94 | KOPrefsDialog::~KOPrefsDialog() | ||
95 | { | ||
96 | } | ||
97 | |||
98 | void KOPrefsDialog::setupMainTab() | ||
99 | { | ||
100 | QFrame *topFrame = addPage(i18n("General"),0,0); | ||
101 | |||
102 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | ||
103 | topLayout->setSpacing(spacingHint()); | ||
104 | topLayout->setMargin(marginHint()); | ||
105 | |||
106 | |||
107 | mNameEdit = new QLineEdit(topFrame); | ||
108 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | ||
109 | topLayout->addWidget(mNameLabel,0,0); | ||
110 | topLayout->addWidget(mNameEdit,0,1); | ||
111 | |||
112 | mEmailEdit = new QLineEdit(topFrame); | ||
113 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | ||
114 | topLayout->addWidget(mEmailLabel,1,0); | ||
115 | topLayout->addWidget(mEmailEdit,1,1); | ||
116 | QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); | ||
117 | topLayout->addMultiCellWidget(lab,2,2,0,1); | ||
118 | KPrefsWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), | ||
119 | &(KOPrefs::instance()->mUseKapi),topFrame); | ||
120 | topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); | ||
121 | } | ||
122 | |||
123 | void KOPrefsDialog::setupMailTab() | ||
124 | { | ||
125 | QFrame *topFrame = addPage(i18n("Mail"),0,0); | ||
126 | |||
127 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | ||
128 | topLayout->setSpacing(spacingHint()); | ||
129 | topLayout->setMargin(marginHint()); | ||
130 | |||
131 | KPrefsWidBool* ttt = addWidBool(i18n("View mail as html"), | ||
132 | &(KOPrefs::instance()->mViewAsHtml),topFrame); | ||
133 | topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); | ||
134 | |||
135 | |||
136 | ttt = addWidBool(i18n("Send mails later"), | ||
137 | &(KOPrefs::instance()->mSendLater),topFrame); | ||
138 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); | ||
139 | |||
140 | |||
141 | } | ||
142 | void KOPrefsDialog::setupFontsTab() | ||
143 | { | ||
144 | |||
145 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); | ||
146 | // DesktopIcon("fonts",KIcon::SizeMedium)); | ||
147 | |||
148 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); | ||
149 | topLayout->setSpacing(1); | ||
150 | topLayout->setMargin(3); | ||
151 | KPrefsWidFont * tVFont; | ||
152 | int i = 0; | ||
153 | KPrefsWidFont *timeLabelsFont = | ||
154 | addWidFont(i18n("OK"),i18n("Application(nr)"), | ||
155 | &(KOPrefs::instance()->mAppFont),topFrame); | ||
156 | topLayout->addWidget(timeLabelsFont->label(),i,0); | ||
157 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | ||
158 | topLayout->addWidget(timeLabelsFont->button(),i,2); | ||
159 | ++i; | ||
160 | |||
161 | |||
162 | timeLabelsFont = | ||
163 | addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), | ||
164 | &(KOPrefs::instance()->mComposeFont),topFrame); | ||
165 | topLayout->addWidget(timeLabelsFont->label(),i,0); | ||
166 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | ||
167 | topLayout->addWidget(timeLabelsFont->button(),i,2); | ||
168 | ++i; | ||
169 | |||
170 | KPrefsWidFont *timeBarFont = | ||
171 | addWidFont(i18n("Hello"),i18n("Read mail:"), | ||
172 | &(KOPrefs::instance()->mReadFont),topFrame); | ||
173 | topLayout->addWidget(timeBarFont->label(),i,0); | ||
174 | topLayout->addWidget(timeBarFont->preview(),i,1); | ||
175 | topLayout->addWidget(timeBarFont->button(),i,2); | ||
176 | ++i; | ||
177 | |||
178 | topLayout->setColStretch(1,1); | ||
179 | topLayout->setRowStretch(4,1); | ||
180 | |||
181 | } | ||
182 | void KOPrefsDialog::usrReadConfig() | ||
183 | { | ||
184 | qDebug("read "); | ||
185 | mNameEdit->setText(KOPrefs::instance()->mName); | ||
186 | mEmailEdit->setText(KOPrefs::instance()->mEmail); | ||
187 | } | ||
188 | void KOPrefsDialog::usrWriteConfig() | ||
189 | { | ||
190 | qDebug("write "); | ||
191 | KOPrefs::instance()->mName = mNameEdit->text(); | ||
192 | KOPrefs::instance()->mEmail = mEmailEdit->text(); | ||
193 | |||
194 | |||
195 | } | ||
196 | |||
197 | #if 0 | ||
198 | void KOPrefsDialog::setupLocaleDateTab() | ||
199 | { | ||
200 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | ||
201 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); | ||
202 | topLayout->setSpacing(spacingHint()); | ||
203 | topLayout->setMargin(marginHint()); | ||
204 | int iii = 0; | ||
205 | |||
206 | |||
207 | KPrefsWidRadios *syncPrefsGroup = | ||
208 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); | ||
209 | QString format; | ||
210 | if ( QApplication::desktop()->width() < 480 ) | ||
211 | format = "(%d.%m.%Y)"; | ||
212 | else | ||
213 | format = "(%d.%m.%Y|%A %d %B %Y)"; | ||
214 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | ||
215 | if ( QApplication::desktop()->width() < 480 ) | ||
216 | format = "(%m.%d.%Y)"; | ||
217 | else | ||
218 | format = "(%m.%d.%Y|%A %B %d %Y)"; | ||
219 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | ||
220 | if ( QApplication::desktop()->width() < 480 ) | ||
221 | format = "(%Y-%m-%d)"; | ||
222 | else | ||
223 | format = "(%Y-%m-%d|%A %Y %B %d)"; | ||
224 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | ||
225 | syncPrefsGroup->addRadio(i18n("User defined")); | ||
226 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | ||
227 | ++iii; | ||
228 | ++iii; | ||
229 | QLabel * lab; | ||
230 | mUserDateFormatLong = new QLineEdit(topFrame); | ||
231 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); | ||
232 | topLayout->addWidget(lab ,iii,0); | ||
233 | topLayout->addWidget(mUserDateFormatLong,iii,1); | ||
234 | ++iii; | ||
235 | mUserDateFormatShort = new QLineEdit(topFrame); | ||
236 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); | ||
237 | topLayout->addWidget(lab ,iii,0); | ||
238 | topLayout->addWidget(mUserDateFormatShort,iii,1); | ||
239 | ++iii; | ||
240 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); | ||
241 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | ||
242 | ++iii; | ||
243 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); | ||
244 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | ||
245 | ++iii; | ||
246 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); | ||
247 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | ||
248 | ++iii; | ||
249 | |||
250 | } | ||
251 | |||
252 | void KOPrefsDialog::setupLocaleTab() | ||
253 | { | ||
254 | QFrame *topFrame = addPage(i18n("Locale"),0,0); | ||
255 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | ||
256 | topLayout->setSpacing(spacingHint()); | ||
257 | topLayout->setMargin(marginHint()); | ||
258 | int iii = 0; | ||
259 | KPrefsWidRadios *syncPrefsGroup = | ||
260 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); | ||
261 | syncPrefsGroup->addRadio(i18n("English")); | ||
262 | syncPrefsGroup->addRadio(i18n("German")); | ||
263 | syncPrefsGroup->addRadio(i18n("French")); | ||
264 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); | ||
265 | if ( QApplication::desktop()->width() < 300 ) | ||
266 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | ||
267 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | ||
268 | ++iii; | ||
269 | |||
270 | syncPrefsGroup = | ||
271 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); | ||
272 | if ( QApplication::desktop()->width() > 300 ) | ||
273 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | ||
274 | syncPrefsGroup->addRadio(i18n("24:00")); | ||
275 | syncPrefsGroup->addRadio(i18n("12:00am")); | ||
276 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | ||
277 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | ||
278 | ++iii; | ||
279 | KPrefsWidBool *sb; | ||
280 | if ( QApplication::desktop()->width() < 300 ) { | ||
281 | sb = | ||
282 | addWidBool(i18n("Week starts on Sunday"), | ||
283 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); | ||
284 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | ||
285 | ++iii; | ||
286 | sb = | ||
287 | addWidBool(i18n("Use short date in (WN/E) view"), | ||
288 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | ||
289 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | ||
290 | } | ||
291 | else { | ||
292 | QWidget * hb = new QWidget( topFrame ); | ||
293 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); | ||
294 | sb = | ||
295 | addWidBool(i18n("Week starts on Sunday"), | ||
296 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); | ||
297 | hbLayout->addWidget(sb->checkBox() ); | ||
298 | sb = | ||
299 | addWidBool(i18n("Use short date in (WN/E) view"), | ||
300 | &(KOPrefs::instance()->mShortDateInViewer),hb); | ||
301 | hbLayout->addWidget(sb->checkBox() ); | ||
302 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); | ||
303 | |||
304 | } | ||
305 | //#ifndef DESKTOP_VERSION | ||
306 | #if 0 | ||
307 | ++iii; | ||
308 | sb = | ||
309 | addWidBool(i18n("Quick load/save (w/o Unicode)"), | ||
310 | &(KOPrefs::instance()->mUseQuicksave),topFrame); | ||
311 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | ||
312 | #endif | ||
313 | } | ||
314 | void KOPrefsDialog::showSyncPage() | ||
315 | { | ||
316 | showPage ( 2 ) ; | ||
317 | |||
318 | } | ||
319 | void KOPrefsDialog::setupSyncAlgTab() | ||
320 | { | ||
321 | #if 0 | ||
322 | QLabel * lab; | ||
323 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); | ||
324 | mSetupSyncAlgTab = topFrame; | ||
325 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | ||
326 | topLayout->setSpacing(spacingHint()); | ||
327 | topLayout->setMargin(marginHint()); | ||
328 | int iii = 0; | ||
329 | |||
330 | KPrefsWidBool *sb = | ||
331 | addWidBool(i18n("Ask for preferences before syncing"), | ||
332 | &(KOPrefs::instance()->mAskForPreferences),topFrame); | ||
333 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | ||
334 | |||
335 | ++iii; | ||
336 | |||
337 | KPrefsWidRadios *syncPrefsGroup = | ||
338 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), | ||
339 | topFrame); | ||
340 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); | ||
341 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); | ||
342 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); | ||
343 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); | ||
344 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); | ||
345 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); | ||
346 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | ||
347 | ++iii; | ||
348 | sb = | ||
349 | addWidBool(i18n("Show summary after syncing"), | ||
350 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); | ||
351 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | ||
352 | |||
353 | ++iii; | ||
354 | #endif | ||
355 | |||
356 | |||
357 | |||
358 | } | ||
359 | |||
360 | |||
361 | void KOPrefsDialog::setupSyncTab() | ||
362 | { | ||
363 | #if 0 | ||
364 | QLabel * lab; | ||
365 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); | ||
366 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | ||
367 | topLayout->setSpacing(spacingHint()); | ||
368 | topLayout->setMargin(marginHint()); | ||
369 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); | ||
370 | int iii = 0; | ||
371 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); | ||
372 | ++iii; | ||
373 | |||
374 | mRemoteIPEdit = new QLineEdit(topFrame); | ||
375 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); | ||
376 | topLayout->addWidget(lab ,iii,0); | ||
377 | topLayout->addWidget(mRemoteIPEdit,iii,1); | ||
378 | ++iii; | ||
379 | mRemoteUser = new QLineEdit(topFrame); | ||
380 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); | ||
381 | topLayout->addWidget(lab ,iii,0); | ||
382 | topLayout->addWidget(mRemoteUser, iii,1); | ||
383 | ++iii; | ||
384 | |||
385 | mRemoteFile = new QLineEdit(topFrame); | ||
386 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); | ||
387 | topLayout->addWidget(lab ,iii,0); | ||
388 | topLayout->addWidget(mRemoteFile,iii,1); | ||
389 | ++iii; | ||
390 | |||
391 | mLocalTempFile = new QLineEdit(topFrame); | ||
392 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); | ||
393 | topLayout->addWidget(lab ,iii,0); | ||
394 | topLayout->addWidget(mLocalTempFile,iii,1); | ||
395 | ++iii; | ||
396 | |||
397 | KPrefsWidBool *wb = | ||
398 | addWidBool(i18n("Write back synced file"), | ||
399 | &(KOPrefs::instance()->mWriteBackFile),topFrame); | ||
400 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | ||
401 | ++iii; | ||
402 | wb = | ||
403 | addWidBool(i18n("Write back existing entries only"), | ||
404 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); | ||
405 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | ||
406 | ++iii; | ||
407 | |||
408 | #endif | ||
409 | } | ||
410 | |||
411 | void KOPrefsDialog::setupMainTab() | ||
412 | { | ||
413 | QFrame *topFrame = addPage(i18n("General"),0,0); | ||
414 | // DesktopIcon("identity",KIcon::SizeMedium)); | ||
415 | |||
416 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | ||
417 | topLayout->setSpacing(spacingHint()); | ||
418 | topLayout->setMargin(marginHint()); | ||
419 | |||
420 | // KPrefsWidBool *emailControlCenter = | ||
421 | // addWidBool(i18n("&Use email settings from Control Center"), | ||
422 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); | ||
423 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); | ||
424 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), | ||
425 | // SLOT(toggleEmailSettings(bool))); | ||
426 | |||
427 | mNameEdit = new QLineEdit(topFrame); | ||
428 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | ||
429 | topLayout->addWidget(mNameLabel,0,0); | ||
430 | topLayout->addWidget(mNameEdit,0,1); | ||
431 | |||
432 | mEmailEdit = new QLineEdit(topFrame); | ||
433 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | ||
434 | topLayout->addWidget(mEmailLabel,1,0); | ||
435 | topLayout->addWidget(mEmailEdit,1,1); | ||
436 | KPrefsWidBool *wb; | ||
437 | QHBox *dummy; | ||
438 | if ( QApplication::desktop()->width() > 480 ) { | ||
439 | dummy = new QHBox(topFrame); | ||
440 | } else { | ||
441 | dummy = new QVBox(topFrame); | ||
442 | } | ||
443 | |||
444 | topLayout->addMultiCellWidget(dummy, 2,2,0,1); | ||
445 | addWidBool(i18n("Full menu bar(nr)"), | ||
446 | &(KOPrefs::instance()->mShowFullMenu),dummy); | ||
447 | |||
448 | |||
449 | addWidBool(i18n("Mini icons in toolbar(nr)"), | ||
450 | &(KOPrefs::instance()->mToolBarMiniIcons),dummy); | ||
451 | |||
452 | |||
453 | dummy = new QHBox(topFrame); | ||
454 | new QLabel(i18n("Days in What's Next:"),dummy); | ||
455 | mWhatsNextSpin = new QSpinBox(1,14,1,dummy); | ||
456 | |||
457 | topLayout->addMultiCellWidget(dummy,3,3,0,1); | ||
458 | |||
459 | |||
460 | |||
461 | dummy = new QHBox(topFrame); | ||
462 | new QLabel(i18n("Days in Next-X-Days:"),dummy); | ||
463 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); | ||
464 | |||
465 | topLayout->addMultiCellWidget(dummy,4,4,0,1); | ||
466 | |||
467 | QHBox *prioBox = new QHBox(topFrame); | ||
468 | // intervalBox->setSpacing(spacingHint()); | ||
469 | topLayout->addMultiCellWidget(prioBox,5,5,0,1); | ||
470 | QString messa = i18n("Show topmost todo prios in What's Next:"); | ||
471 | |||
472 | if ( QApplication::desktop()->width() < 300 ) | ||
473 | messa = i18n("Show topmost todo prios in What's N.:"); | ||
474 | QLabel *prioLabel = new QLabel(messa, prioBox); | ||
475 | mPrioSpin = new QSpinBox(0,5,1,prioBox); | ||
476 | if ( QApplication::desktop()->width() < 300 ) | ||
477 | mPrioSpin->setFixedWidth( 40 ); | ||
478 | |||
479 | // KPrefsWidBool *bcc = | ||
480 | // addWidBool(i18n("Send copy to owner when mailing events"), | ||
481 | // &(KOPrefs::instance()->mBcc),topFrame); | ||
482 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); | ||
483 | |||
484 | |||
485 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); | ||
486 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); | ||
487 | |||
488 | // addWidBool(i18n("Enable automatic saving of calendar"), | ||
489 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); | ||
490 | |||
491 | QHBox *intervalBox = new QHBox(topFrame); | ||
492 | // intervalBox->setSpacing(spacingHint()); | ||
493 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); | ||
494 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); | ||
495 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); | ||
496 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); | ||
497 | /* | ||
498 | QHBox * agendasize = new QHBox ( topFrame ); | ||
499 | |||
500 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); | ||
501 | |||
502 | |||
503 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); | ||
504 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); | ||
505 | */ | ||
506 | KPrefsWidBool *verticalScreen = | ||
507 | addWidBool(i18n("Show vertical screen (Needs restart)"), | ||
508 | &(KOPrefs::instance()->mVerticalScreen),topFrame); | ||
509 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); | ||
510 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); | ||
511 | |||
512 | KPrefsWidBool *ask = | ||
513 | addWidBool(i18n("Ask for quit when closing KO/Pi"), | ||
514 | &(KOPrefs::instance()->mAskForQuit),topFrame); | ||
515 | topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); | ||
516 | |||
517 | |||
518 | /* | ||
519 | KPrefsWidBool *confirmCheck = | ||
520 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), | ||
521 | topFrame); | ||
522 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); | ||
523 | |||
524 | |||
525 | mEnableGroupScheduling = | ||
526 | addWidBool(i18n("Enable group scheduling"), | ||
527 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); | ||
528 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); | ||
529 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), | ||
530 | SLOT(warningGroupScheduling())); | ||
531 | |||
532 | mEnableProjectView = | ||
533 | addWidBool(i18n("Enable project view"), | ||
534 | &(KOPrefs::instance()->mEnableProjectView),topFrame); | ||
535 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); | ||
536 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), | ||
537 | SLOT(warningProjectView())); | ||
538 | |||
539 | // Can't be disabled anymore | ||
540 | mEnableGroupScheduling->checkBox()->hide(); | ||
541 | |||
542 | // Disable setting, because this feature now becomes stable | ||
543 | mEnableProjectView->checkBox()->hide(); | ||
544 | |||
545 | KPrefsWidRadios *defaultFormatGroup = | ||
546 | addWidRadios(i18n("Default Calendar Format"), | ||
547 | &(KOPrefs::instance()->mDefaultFormat),topFrame); | ||
548 | defaultFormatGroup->addRadio(i18n("vCalendar")); | ||
549 | defaultFormatGroup->addRadio(i18n("iCalendar")); | ||
550 | |||
551 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); | ||
552 | |||
553 | // Default format unconditionally is iCalendar | ||
554 | defaultFormatGroup->groupBox()->hide(); | ||
555 | |||
556 | KPrefsWidRadios *mailClientGroup = | ||
557 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), | ||
558 | topFrame); | ||
559 | mailClientGroup->addRadio(i18n("KMail")); | ||
560 | mailClientGroup->addRadio(i18n("Sendmail")); | ||
561 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); | ||
562 | |||
563 | KPrefsWidBool *htmlsave = | ||
564 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), | ||
565 | topFrame); | ||
566 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); | ||
567 | |||
568 | KPrefsWidRadios *destinationGroup = | ||
569 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), | ||
570 | topFrame); | ||
571 | destinationGroup->addRadio(i18n("be added to the standard resource")); | ||
572 | destinationGroup->addRadio(i18n("be asked which resource to use")); | ||
573 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); | ||
574 | |||
575 | topLayout->setRowStretch(14,1); | ||
576 | */ | ||
577 | } | ||
578 | |||
579 | |||
580 | void KOPrefsDialog::setupTimeTab() | ||
581 | { | ||
582 | QFrame *topFrame = addPage(i18n("Time"),0,0); | ||
583 | // DesktopIcon("clock",KIcon::SizeMedium)); | ||
584 | |||
585 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | ||
586 | topLayout->setSpacing(spacingHint()); | ||
587 | topLayout->setMargin(marginHint()); | ||
588 | |||
589 | QHBox *dummy = new QHBox(topFrame); | ||
590 | KPrefsWidTime *dayBegins = | ||
591 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | ||
592 | dummy); | ||
593 | //topLayout->addWidget(dayBegins->label(),2,0); | ||
594 | |||
595 | //topLayout->addWidget(dayBegins->spinBox(),2,1); | ||
596 | topLayout->addMultiCellWidget(dummy,0,0,0,1); | ||
597 | |||
598 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), | ||
599 | topFrame),1,0); | ||
600 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); | ||
601 | mStartTimeSpin->setSuffix(":00"); | ||
602 | topLayout->addWidget(mStartTimeSpin,1,1); | ||
603 | |||
604 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), | ||
605 | topFrame),2,0); | ||
606 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); | ||
607 | mDefaultDurationSpin->setSuffix(":00"); | ||
608 | topLayout->addWidget(mDefaultDurationSpin,2,1); | ||
609 | |||
610 | QStringList alarmList; | ||
611 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") | ||
612 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; | ||
613 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), | ||
614 | 3,0); | ||
615 | mAlarmTimeCombo = new QComboBox(topFrame); | ||
616 | mAlarmTimeCombo->insertStringList(alarmList); | ||
617 | topLayout->addWidget(mAlarmTimeCombo,3,1); | ||
618 | |||
619 | |||
620 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, | ||
621 | i18n("Working Hours"), | ||
622 | topFrame); | ||
623 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); | ||
624 | workingHoursGroup->layout()->setSpacing( 0 ); | ||
625 | workingHoursGroup->layout()->setMargin( 4 ); | ||
626 | QHBox *workStartBox = new QHBox(workingHoursGroup); | ||
627 | // workStartBox->setMargin( 0 ); | ||
628 | addWidTime(i18n("Daily starting hour:"), | ||
629 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); | ||
630 | |||
631 | QHBox *workEndBox = new QHBox(workingHoursGroup); | ||
632 | //workEndBox->setMargin( 0 ); | ||
633 | addWidTime(i18n("Daily ending hour:"), | ||
634 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); | ||
635 | QVBox *excludeBox = new QVBox(workingHoursGroup); | ||
636 | //excludeBox->setMargin( 0 ); | ||
637 | addWidBool(i18n("Exclude holidays"), | ||
638 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); | ||
639 | |||
640 | addWidBool(i18n("Exclude Saturdays"), | ||
641 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); | ||
642 | |||
643 | // KPrefsWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), | ||
644 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), | ||
645 | // topFrame); | ||
646 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); | ||
647 | |||
648 | // topLayout->setRowStretch(6,1); | ||
649 | } | ||
650 | |||
651 | |||
652 | void KOPrefsDialog::setupViewsTab() | ||
653 | { | ||
654 | |||
655 | QFrame *topFrame = addPage(i18n("Views"),0,0); | ||
656 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | ||
657 | |||
658 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); | ||
659 | topLayout->setSpacing(spacingHint()); | ||
660 | topLayout->setMargin(marginHint()); | ||
661 | |||
662 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; | ||
663 | // topLayout->addLayout(dayBeginsLayout,0,0); | ||
664 | |||
665 | // KPrefsWidTime *dayBegins = | ||
666 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | ||
667 | // topFrame); | ||
668 | // dayBeginsLayout->addWidget(dayBegins->label()); | ||
669 | // dayBeginsLayout->addStretch(1); | ||
670 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); | ||
671 | |||
672 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; | ||
673 | // topLayout->addLayout(nextDaysLayout,1,0); | ||
674 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); | ||
675 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); | ||
676 | // nextDaysLayout->addStretch(1); | ||
677 | // nextDaysLayout->addWidget(mNextXDaysSpin); | ||
678 | |||
679 | |||
680 | int ii = 0; | ||
681 | KPrefsWidBool *dummy = | ||
682 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), | ||
683 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); | ||
684 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
685 | |||
686 | dummy = | ||
687 | addWidBool(i18n("Highlight current day in agenda"), | ||
688 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); | ||
689 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
690 | |||
691 | dummy = | ||
692 | addWidBool(i18n("Use light color for highlight current day"), | ||
693 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); | ||
694 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
695 | |||
696 | KPrefsWidBool *dailyRecur = | ||
697 | addWidBool(i18n("Show events that recur daily in date nav."), | ||
698 | &(KOPrefs::instance()->mDailyRecur),topFrame); | ||
699 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | ||
700 | |||
701 | KPrefsWidBool *weeklyRecur = | ||
702 | addWidBool(i18n("Show ev. that recur weekly in date nav."), | ||
703 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); | ||
704 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); | ||
705 | if ( QApplication::desktop()->width() > 640 ) { | ||
706 | |||
707 | KPrefsWidBool *enableToolTips = | ||
708 | addWidBool(i18n("Enable tooltips displaying summary of ev."), | ||
709 | &(KOPrefs::instance()->mEnableToolTips),topFrame); | ||
710 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); | ||
711 | |||
712 | } | ||
713 | KPrefsWidBool *passwdk = | ||
714 | addWidBool(i18n("Show parent To-Do's in What's Next view"), | ||
715 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); | ||
716 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | ||
717 | |||
718 | passwdk = | ||
719 | addWidBool(i18n("Show location in What's Next view"), | ||
720 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); | ||
721 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | ||
722 | |||
723 | passwdk = | ||
724 | addWidBool(i18n("Show Sync Events in WN/Agenda view"), | ||
725 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); | ||
726 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | ||
727 | |||
728 | |||
729 | KPrefsWidBool *marcusBainsEnabled = | ||
730 | addWidBool(i18n("Show Marcus Bains line"), | ||
731 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); | ||
732 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); | ||
733 | |||
734 | |||
735 | // topLayout->addWidget(hourSizeGroup,ii++,0); | ||
736 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); | ||
737 | //topLayout->setRowStretch(11,1); | ||
738 | |||
739 | |||
740 | |||
741 | |||
742 | |||
743 | |||
744 | topFrame = addPage(i18n("ViewChange"),0,0); | ||
745 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | ||
746 | |||
747 | topLayout = new QGridLayout(topFrame,6,1); | ||
748 | topLayout->setSpacing(spacingHint()); | ||
749 | topLayout->setMargin(marginHint()); | ||
750 | ii = 0; | ||
751 | |||
752 | |||
753 | dummy = | ||
754 | addWidBool(i18n("Hold fullscreen on view change"), | ||
755 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); | ||
756 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
757 | |||
758 | dummy = | ||
759 | addWidBool(i18n("Hold non-fullscreen on view change"), | ||
760 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); | ||
761 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
762 | |||
763 | |||
764 | KPrefsWidBool *fullViewTodo = | ||
765 | addWidBool(i18n("Event list view uses full window"), | ||
766 | &(KOPrefs::instance()->mFullViewTodo),topFrame); | ||
767 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); | ||
768 | |||
769 | KPrefsWidBool *fullViewMonth = | ||
770 | addWidBool(i18n("Next days view uses full window"), | ||
771 | &(KOPrefs::instance()->mFullViewMonth),topFrame); | ||
772 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); | ||
773 | |||
774 | dummy = | ||
775 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), | ||
776 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); | ||
777 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
778 | |||
779 | dummy = | ||
780 | addWidBool(i18n("Set agenda to current time on change"), | ||
781 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); | ||
782 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
783 | |||
784 | dummy = | ||
785 | addWidBool(i18n("Listview uses monthly timespan"), | ||
786 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); | ||
787 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
788 | dummy = | ||
789 | addWidBool(i18n("Highlight selection in Time Edit"), | ||
790 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); | ||
791 | topLayout->addWidget( dummy->checkBox(), ii++,0); | ||
792 | |||
793 | |||
794 | |||
795 | |||
796 | |||
797 | topFrame = addPage(i18n("Month View"),0,0); | ||
798 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | ||
799 | |||
800 | topLayout = new QGridLayout(topFrame,5,1); | ||
801 | topLayout->setSpacing(spacingHint()); | ||
802 | topLayout->setMargin(marginHint()); | ||
803 | ii = 0; | ||
804 | QLabel *lab; | ||
805 | QHBox *habo = new QHBox( topFrame ); | ||
806 | if ( QApplication::desktop()->width() < 320 ) { | ||
807 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); | ||
808 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | ||
809 | ii++; | ||
810 | |||
811 | } else { | ||
812 | new QLabel ( i18n("Show events that recur "), habo ); | ||
813 | |||
814 | } | ||
815 | dailyRecur = | ||
816 | addWidBool(i18n("daily"), | ||
817 | &(KOPrefs::instance()->mMonthDailyRecur),habo); | ||
818 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | ||
819 | |||
820 | weeklyRecur = | ||
821 | addWidBool(i18n("weekly"), | ||
822 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); | ||
823 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | ||
824 | ii++; | ||
825 | |||
826 | |||
827 | habo = new QHBox( topFrame ); | ||
828 | if ( QApplication::desktop()->width() < 320 ) { | ||
829 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); | ||
830 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | ||
831 | ii++; | ||
832 | |||
833 | } else { | ||
834 | new QLabel ( i18n("Show in every cell "), habo ); | ||
835 | } | ||
836 | weeklyRecur = | ||
837 | addWidBool(i18n("short month"), | ||
838 | &(KOPrefs::instance()->mMonthShowShort),habo); | ||
839 | weeklyRecur = | ||
840 | addWidBool(i18n("icons"), | ||
841 | &(KOPrefs::instance()->mMonthShowIcons),habo); | ||
842 | |||
843 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | ||
844 | ii++; | ||
845 | #ifdef DESKTOP_VERSION | ||
846 | KPrefsWidBool *enableMonthScroll = | ||
847 | addWidBool(i18n("Enable scrollbars in month view cells"), | ||
848 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); | ||
849 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); | ||
850 | #endif | ||
851 | |||
852 | dummy = | ||
853 | addWidBool(i18n("Show Sat/Sun together"), | ||
854 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); | ||
855 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
856 | |||
857 | KPrefsWidBool *coloredCategoriesInMonthView = | ||
858 | addWidBool(i18n("Month view uses category colors"), | ||
859 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); | ||
860 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | ||
861 | |||
862 | dummy = | ||
863 | addWidBool(i18n("Categorie colors are applied to text"), | ||
864 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); | ||
865 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
866 | coloredCategoriesInMonthView = | ||
867 | addWidBool(i18n("Month view uses day colors"), | ||
868 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); | ||
869 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | ||
870 | |||
871 | KPrefsWidColor *holidayColor = | ||
872 | addWidColor(i18n("Day color odd months"), | ||
873 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); | ||
874 | topLayout->addWidget(holidayColor->label(),ii,0); | ||
875 | topLayout->addWidget(holidayColor->button(),ii++,1); | ||
876 | |||
877 | holidayColor = | ||
878 | addWidColor(i18n("Day color even months"), | ||
879 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); | ||
880 | topLayout->addWidget(holidayColor->label(),ii,0); | ||
881 | topLayout->addWidget(holidayColor->button(),ii++,1); | ||
882 | |||
883 | |||
884 | holidayColor = | ||
885 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), | ||
886 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); | ||
887 | topLayout->addWidget(holidayColor->label(),ii,0); | ||
888 | topLayout->addWidget(holidayColor->button(),ii++,1); | ||
889 | |||
890 | // *********************** Todo View | ||
891 | |||
892 | topFrame = addPage(i18n("Todo View"),0,0); | ||
893 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | ||
894 | |||
895 | topLayout = new QGridLayout(topFrame,4,1); | ||
896 | topLayout->setSpacing(spacingHint()); | ||
897 | topLayout->setMargin(marginHint()); | ||
898 | ii = 0; | ||
899 | |||
900 | KPrefsWidBool *showCompletedTodo = | ||
901 | addWidBool(i18n("To-do view shows completed Todos"), | ||
902 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); | ||
903 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); | ||
904 | dummy = | ||
905 | addWidBool(i18n("To-do view shows complete as 'xx %'"), | ||
906 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); | ||
907 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
908 | |||
909 | dummy = | ||
910 | addWidBool(i18n("Small To-do view uses smaller font"), | ||
911 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); | ||
912 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
913 | |||
914 | |||
915 | |||
916 | dummy = | ||
917 | addWidBool(i18n("Todo view uses category colors"), | ||
918 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); | ||
919 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
920 | |||
921 | |||
922 | QWidget* wid = new QWidget( topFrame ); | ||
923 | // Todo due today color | ||
924 | KPrefsWidColor *todoDueTodayColor = | ||
925 | addWidColor(i18n("Todo due today color:"), | ||
926 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); | ||
927 | QHBoxLayout *widLayout = new QHBoxLayout(wid); | ||
928 | widLayout->addWidget( todoDueTodayColor->label() ); | ||
929 | widLayout->addWidget( todoDueTodayColor->button() ); | ||
930 | topLayout->addWidget(wid,ii++,0); | ||
931 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); | ||
932 | |||
933 | // Todo overdue color | ||
934 | wid = new QWidget( topFrame ); | ||
935 | widLayout = new QHBoxLayout(wid); | ||
936 | KPrefsWidColor *todoOverdueColor = | ||
937 | addWidColor(i18n("Todo overdue color:"), | ||
938 | &(KOPrefs::instance()->mTodoOverdueColor),wid); | ||
939 | widLayout->addWidget(todoOverdueColor->label()); | ||
940 | widLayout->addWidget(todoOverdueColor->button()); | ||
941 | topLayout->addWidget(wid,ii++,0); | ||
942 | |||
943 | dummy = | ||
944 | addWidBool(i18n("Colors are applied to text"), | ||
945 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); | ||
946 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
947 | |||
948 | dummy = | ||
949 | addWidBool(i18n("Allday Agenda view shows todos"), | ||
950 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); | ||
951 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
952 | |||
953 | |||
954 | |||
955 | |||
956 | topFrame = addPage(i18n("Alarm"),0,0); | ||
957 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | ||
958 | |||
959 | topLayout = new QGridLayout(topFrame,2,1); | ||
960 | topLayout->setSpacing(spacingHint()); | ||
961 | topLayout->setMargin(marginHint()); | ||
962 | int iii = 0; | ||
963 | |||
964 | dummy = | ||
965 | addWidBool(i18n("Use internal alarm notification"), | ||
966 | &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); | ||
967 | topLayout->addWidget(dummy->checkBox(),iii++,0); | ||
968 | lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); | ||
969 | |||
970 | topLayout->addWidget(lab ,iii++,0); | ||
971 | #ifndef DESKTOP_VERSION | ||
972 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); | ||
973 | #else | ||
974 | lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | ||
975 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); | ||
976 | #endif | ||
977 | |||
978 | QHBox* dummyBox = new QHBox(topFrame); | ||
979 | new QLabel(i18n("Play beeps count:"),dummyBox); | ||
980 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); | ||
981 | topLayout->addWidget(dummyBox,iii++,0); | ||
982 | |||
983 | dummyBox = new QHBox(topFrame); | ||
984 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); | ||
985 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); | ||
986 | topLayout->addWidget(dummyBox,iii++,0); | ||
987 | |||
988 | dummyBox = new QHBox(topFrame); | ||
989 | new QLabel(i18n("Default suspend time in min:"),dummyBox); | ||
990 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); | ||
991 | topLayout->addWidget(dummyBox,iii++,0); | ||
992 | |||
993 | dummyBox = new QHBox(topFrame); | ||
994 | new QLabel(i18n("Auto suspend count:"),dummyBox); | ||
995 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); | ||
996 | topLayout->addWidget(dummyBox,iii++,0); | ||
997 | |||
998 | |||
999 | |||
1000 | |||
1001 | |||
1002 | |||
1003 | |||
1004 | QHBox* hbo = new QHBox ( topFrame ); | ||
1005 | mDefaultAlarmFile = new QLineEdit(hbo); | ||
1006 | QPushButton * loadTemplate = new QPushButton(hbo); | ||
1007 | QPixmap icon; | ||
1008 | if ( QApplication::desktop()->width() < 321 ) | ||
1009 | icon = SmallIcon("fileimport16"); | ||
1010 | else | ||
1011 | icon = SmallIcon("fileimport"); | ||
1012 | loadTemplate->setIconSet (icon ) ; | ||
1013 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); | ||
1014 | int size = loadTemplate->sizeHint().height(); | ||
1015 | loadTemplate->setFixedSize( size, size ); | ||
1016 | //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); | ||
1017 | // topLayout->addWidget(lab ,iii++,0); | ||
1018 | lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); | ||
1019 | topLayout->addWidget(lab ,iii++,0); | ||
1020 | topLayout->addWidget(hbo,iii++,0); | ||
1021 | // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); | ||
1022 | |||
1023 | // topLayout->addWidget(lab ,iii++,0); | ||
1024 | // #ifndef DESKTOP_VERSION | ||
1025 | // lab->setAlignment( AlignLeft|WordBreak|AlignTop); | ||
1026 | // #else | ||
1027 | // lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | ||
1028 | // lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); | ||
1029 | // #endif | ||
1030 | |||
1031 | |||
1032 | } | ||
1033 | |||
1034 | void KOPrefsDialog::selectSoundFile() | ||
1035 | { | ||
1036 | QString fileName = mDefaultAlarmFile->text(); | ||
1037 | fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); | ||
1038 | if ( fileName.length() > 0 ) | ||
1039 | mDefaultAlarmFile->setText( fileName ); | ||
1040 | } | ||
1041 | void KOPrefsDialog::setupFontsTab() | ||
1042 | { | ||
1043 | |||
1044 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); | ||
1045 | // DesktopIcon("fonts",KIcon::SizeMedium)); | ||
1046 | |||
1047 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); | ||
1048 | topLayout->setSpacing(1); | ||
1049 | topLayout->setMargin(3); | ||
1050 | KPrefsWidFont * tVFont; | ||
1051 | int i = 0; | ||
1052 | KPrefsWidFont *timeLabelsFont = | ||
1053 | addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), | ||
1054 | &(KOPrefs::instance()->mDateNavigatorFont),topFrame); | ||
1055 | topLayout->addWidget(timeLabelsFont->label(),i,0); | ||
1056 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | ||
1057 | topLayout->addWidget(timeLabelsFont->button(),i,2); | ||
1058 | ++i; | ||
1059 | |||
1060 | |||
1061 | timeLabelsFont = | ||
1062 | addWidFont(i18n("Mon 15"),i18n("Date Labels:"), | ||
1063 | &(KOPrefs::instance()->mTimeLabelsFont),topFrame); | ||
1064 | topLayout->addWidget(timeLabelsFont->label(),i,0); | ||
1065 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | ||
1066 | topLayout->addWidget(timeLabelsFont->button(),i,2); | ||
1067 | ++i; | ||
1068 | |||
1069 | KPrefsWidFont *timeBarFont = | ||
1070 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), | ||
1071 | &(KOPrefs::instance()->mTimeBarFont),topFrame); | ||
1072 | topLayout->addWidget(timeBarFont->label(),i,0); | ||
1073 | topLayout->addWidget(timeBarFont->preview(),i,1); | ||
1074 | topLayout->addWidget(timeBarFont->button(),i,2); | ||
1075 | ++i; | ||
1076 | |||
1077 | |||
1078 | KPrefsWidFont *marcusBainsFont = | ||
1079 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), | ||
1080 | &(KOPrefs::instance()->mMarcusBainsFont),topFrame); | ||
1081 | topLayout->addWidget(marcusBainsFont->label(),i,0); | ||
1082 | topLayout->addWidget(marcusBainsFont->preview(),i,1); | ||
1083 | topLayout->addWidget(marcusBainsFont->button(),i,2); | ||
1084 | ++i; | ||
1085 | |||
1086 | tVFont = | ||
1087 | addWidFont(i18n("Summary"),i18n("Event Viewer:"), | ||
1088 | &(KOPrefs::instance()->mEventViewFont),topFrame); | ||
1089 | topLayout->addWidget(tVFont->label(),i,0); | ||
1090 | topLayout->addWidget(tVFont->preview(),i,1); | ||
1091 | topLayout->addWidget(tVFont->button(),i,2); | ||
1092 | ++i; | ||
1093 | |||
1094 | |||
1095 | |||
1096 | tVFont = | ||
1097 | addWidFont(i18n("Details"),i18n("EditorBox:"), | ||
1098 | &(KOPrefs::instance()->mEditBoxFont),topFrame); | ||
1099 | topLayout->addWidget(tVFont->label(),i,0); | ||
1100 | topLayout->addWidget(tVFont->preview(),i,1); | ||
1101 | topLayout->addWidget(tVFont->button(),i,2); | ||
1102 | ++i; | ||
1103 | |||
1104 | |||
1105 | |||
1106 | topLayout->setColStretch(1,1); | ||
1107 | topLayout->setRowStretch(4,1); | ||
1108 | |||
1109 | |||
1110 | i = 0; | ||
1111 | topFrame = addPage(i18n("View Fonts"),0, | ||
1112 | DesktopIcon("fonts",KIcon::SizeMedium)); | ||
1113 | |||
1114 | topLayout = new QGridLayout(topFrame,7,3); | ||
1115 | topLayout->setSpacing(1); | ||
1116 | topLayout->setMargin(3); | ||
1117 | |||
1118 | tVFont = | ||
1119 | addWidFont(i18n("Configure KO"),i18n("What's Next View:"), | ||
1120 | &(KOPrefs::instance()->mWhatsNextFont),topFrame); | ||
1121 | topLayout->addWidget(tVFont->label(),i,0); | ||
1122 | topLayout->addWidget(tVFont->preview(),i,1); | ||
1123 | topLayout->addWidget(tVFont->button(),i,2); | ||
1124 | ++i; | ||
1125 | KPrefsWidFont *agendaViewFont = | ||
1126 | addWidFont(i18n("Event text"),i18n("Agenda view:"), | ||
1127 | &(KOPrefs::instance()->mAgendaViewFont),topFrame); | ||
1128 | topLayout->addWidget(agendaViewFont->label(),i,0); | ||
1129 | topLayout->addWidget(agendaViewFont->preview(),i,1); | ||
1130 | topLayout->addWidget(agendaViewFont->button(),i,2); | ||
1131 | ++i; | ||
1132 | |||
1133 | |||
1134 | KPrefsWidFont *monthViewFont = | ||
1135 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), | ||
1136 | i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); | ||
1137 | topLayout->addWidget(monthViewFont->label(),i,0); | ||
1138 | topLayout->addWidget(monthViewFont->preview(),i,1); | ||
1139 | topLayout->addWidget(monthViewFont->button(),i,2); | ||
1140 | ++i; | ||
1141 | |||
1142 | |||
1143 | KPrefsWidFont *lVFont = | ||
1144 | addWidFont(i18n("Event"),i18n("List View:"), | ||
1145 | &(KOPrefs::instance()->mListViewFont),topFrame); | ||
1146 | topLayout->addWidget(lVFont->label(),i,0); | ||
1147 | topLayout->addWidget(lVFont->preview(),i,1); | ||
1148 | topLayout->addWidget(lVFont->button(),i,2); | ||
1149 | ++i; | ||
1150 | |||
1151 | |||
1152 | tVFont = | ||
1153 | addWidFont(i18n("ToDo"),i18n("ToDoView:"), | ||
1154 | &(KOPrefs::instance()->mTodoViewFont),topFrame); | ||
1155 | topLayout->addWidget(tVFont->label(),i,0); | ||
1156 | topLayout->addWidget(tVFont->preview(),i,1); | ||
1157 | topLayout->addWidget(tVFont->button(),i,2); | ||
1158 | ++i; | ||
1159 | |||
1160 | |||
1161 | tVFont = | ||
1162 | addWidFont(i18n("Today"),i18n("JournalView:"), | ||
1163 | &(KOPrefs::instance()->mJornalViewFont),topFrame); | ||
1164 | topLayout->addWidget(tVFont->label(),i,0); | ||
1165 | topLayout->addWidget(tVFont->preview(),i,1); | ||
1166 | topLayout->addWidget(tVFont->button(),i,2); | ||
1167 | ++i; | ||
1168 | |||
1169 | |||
1170 | |||
1171 | |||
1172 | topLayout->setColStretch(1,1); | ||
1173 | topLayout->setRowStretch(4,1); | ||
1174 | |||
1175 | |||
1176 | |||
1177 | |||
1178 | } | ||
1179 | |||
1180 | void KOPrefsDialog::setupColorsTab() | ||
1181 | { | ||
1182 | QFrame *topFrame = addPage(i18n("Colors"),0,0); | ||
1183 | // DesktopIcon("colorize",KIcon::SizeMedium)); | ||
1184 | |||
1185 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); | ||
1186 | // topLayout->setSpacing(spacingHint()); | ||
1187 | // topLayout->setMargin(marginHint()); | ||
1188 | |||
1189 | topLayout->setSpacing(2); | ||
1190 | topLayout->setMargin(3); | ||
1191 | |||
1192 | int ii = 1; | ||
1193 | QGroupBox *categoryGroup ; | ||
1194 | |||
1195 | categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), | ||
1196 | topFrame); | ||
1197 | topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); | ||
1198 | |||
1199 | mCategoryCombo = new QComboBox(categoryGroup); | ||
1200 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); | ||
1201 | connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); | ||
1202 | |||
1203 | mCategoryButton = new KColorButton(categoryGroup); | ||
1204 | connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); | ||
1205 | updateCategoryColor(); | ||
1206 | |||
1207 | |||
1208 | // Holiday Color | ||
1209 | |||
1210 | KPrefsWidColor *holidayColor = | ||
1211 | addWidColor(i18n("Holiday color:"), | ||
1212 | &(KOPrefs::instance()->mHolidayColor),topFrame); | ||
1213 | topLayout->addWidget(holidayColor->label(),ii,0); | ||
1214 | topLayout->addWidget(holidayColor->button(),ii++,1); | ||
1215 | |||
1216 | // Highlight Color | ||
1217 | KPrefsWidColor *highlightColor = | ||
1218 | addWidColor(i18n("Highlight color:"), | ||
1219 | &(KOPrefs::instance()->mHighlightColor),topFrame); | ||
1220 | topLayout->addWidget(highlightColor->label(),ii,0); | ||
1221 | topLayout->addWidget(highlightColor->button(),ii++,1); | ||
1222 | |||
1223 | // Event color | ||
1224 | KPrefsWidColor *eventColor = | ||
1225 | addWidColor(i18n("Default event color:"), | ||
1226 | &(KOPrefs::instance()->mEventColor),topFrame); | ||
1227 | topLayout->addWidget(eventColor->label(),ii,0); | ||
1228 | topLayout->addWidget(eventColor->button(),ii++,1); | ||
1229 | |||
1230 | // agenda view background color | ||
1231 | KPrefsWidColor *agendaBgColor = | ||
1232 | addWidColor(i18n("Agenda view background color:"), | ||
1233 | &(KOPrefs::instance()->mAgendaBgColor),topFrame); | ||
1234 | topLayout->addWidget(agendaBgColor->label(),ii,0); | ||
1235 | topLayout->addWidget(agendaBgColor->button(),ii++,1); | ||
1236 | |||
1237 | // working hours color | ||
1238 | KPrefsWidColor *workingHoursColor = | ||
1239 | addWidColor(i18n("Working hours color:"), | ||
1240 | &(KOPrefs::instance()->mWorkingHoursColor),topFrame); | ||
1241 | topLayout->addWidget(workingHoursColor->label(),ii,0); | ||
1242 | topLayout->addWidget(workingHoursColor->button(),ii++,1); | ||
1243 | |||
1244 | KPrefsWidBool *sb = | ||
1245 | addWidBool(i18n("Use colors for application:"), | ||
1246 | &(KOPrefs::instance()->mUseAppColors),topFrame); | ||
1247 | topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); | ||
1248 | |||
1249 | ii++; | ||
1250 | KPrefsWidColor * workingHoursColor1 = | ||
1251 | addWidColor(i18n("Buttons, menus, etc.:"), | ||
1252 | &(KOPrefs::instance()->mAppColor1),topFrame); | ||
1253 | topLayout->addWidget(workingHoursColor1->label(),ii,0); | ||
1254 | topLayout->addWidget(workingHoursColor1->button(),ii++,1); | ||
1255 | |||
1256 | KPrefsWidColor * workingHoursColor2 = | ||
1257 | addWidColor(i18n("Frames, labels, etc.:"), | ||
1258 | &(KOPrefs::instance()->mAppColor2),topFrame); | ||
1259 | topLayout->addWidget(workingHoursColor2->label(),ii,0); | ||
1260 | topLayout->addWidget(workingHoursColor2->button(),ii++,1); | ||
1261 | |||
1262 | |||
1263 | |||
1264 | } | ||
1265 | |||
1266 | void KOPrefsDialog::setCategoryColor() | ||
1267 | { | ||
1268 | mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); | ||
1269 | } | ||
1270 | |||
1271 | void KOPrefsDialog::updateCategoryColor() | ||
1272 | { | ||
1273 | QString cat = mCategoryCombo->currentText(); | ||
1274 | QColor *color = mCategoryDict.find(cat); | ||
1275 | if (!color) { | ||
1276 | color = KOPrefs::instance()->categoryColor(cat); | ||
1277 | } | ||
1278 | if (color) { | ||
1279 | mCategoryButton->setColor(*color); | ||
1280 | } | ||
1281 | } | ||
1282 | |||
1283 | void KOPrefsDialog::setupPrinterTab() | ||
1284 | { | ||
1285 | mPrinterTab = addPage(i18n("Printing"),0, | ||
1286 | DesktopIcon("fileprint",KIcon::SizeMedium)); | ||
1287 | |||
1288 | QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); | ||
1289 | topLayout->setSpacing(spacingHint()); | ||
1290 | topLayout->setMargin(marginHint()); | ||
1291 | |||
1292 | topLayout->setRowStretch(4,1); | ||
1293 | } | ||
1294 | |||
1295 | void KOPrefsDialog::setupGroupSchedulingTab() | ||
1296 | { | ||
1297 | #if 0 | ||
1298 | QFrame *topFrame = addPage(i18n("Group Scheduling"),0, | ||
1299 | DesktopIcon("personal",KIcon::SizeMedium)); | ||
1300 | |||
1301 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | ||
1302 | topLayout->setSpacing(spacingHint()); | ||
1303 | topLayout->setMargin(marginHint()); | ||
1304 | |||
1305 | #if 0 | ||
1306 | KPrefsWidRadios *schedulerGroup = | ||
1307 | addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), | ||
1308 | topFrame); | ||
1309 | schedulerGroup->addRadio("Dummy"); // Only for debugging | ||
1310 | schedulerGroup->addRadio(i18n("Mail client")); | ||
1311 | |||
1312 | topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); | ||
1313 | #endif | ||
1314 | |||
1315 | KPrefsWidRadios *sendGroup = | ||
1316 | addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), | ||
1317 | topFrame); | ||
1318 | sendGroup->addRadio(i18n("Send to outbox")); | ||
1319 | sendGroup->addRadio(i18n("Send directly")); | ||
1320 | |||
1321 | topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); | ||
1322 | |||
1323 | topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); | ||
1324 | mAMails = new QListView(topFrame); | ||
1325 | mAMails->addColumn(i18n("Email"),300); | ||
1326 | topLayout->addMultiCellWidget(mAMails,3,3,0,1); | ||
1327 | |||
1328 | topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); | ||
1329 | aEmailsEdit = new QLineEdit(topFrame); | ||
1330 | aEmailsEdit->setEnabled(false); | ||
1331 | topLayout->addWidget(aEmailsEdit,4,1); | ||
1332 | |||
1333 | QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); | ||
1334 | topLayout->addWidget(add,5,0); | ||
1335 | QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); | ||
1336 | topLayout->addWidget(del,5,1); | ||
1337 | |||
1338 | //topLayout->setRowStretch(2,1); | ||
1339 | connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); | ||
1340 | connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); | ||
1341 | connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); | ||
1342 | connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); | ||
1343 | #endif | ||
1344 | } | ||
1345 | |||
1346 | void KOPrefsDialog::setupGroupAutomationTab() | ||
1347 | { | ||
1348 | return; | ||
1349 | QFrame *topFrame = addPage(i18n("Group Automation"),0, | ||
1350 | DesktopIcon("personal",KIcon::SizeMedium)); | ||
1351 | |||
1352 | QGridLayout *topLayout = new QGridLayout(topFrame,5,1); | ||
1353 | topLayout->setSpacing(spacingHint()); | ||
1354 | topLayout->setMargin(marginHint()); | ||
1355 | |||
1356 | KPrefsWidRadios *autoRefreshGroup = | ||
1357 | addWidRadios(i18n("Auto Send Refresh"), | ||
1358 | &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); | ||
1359 | autoRefreshGroup->addRadio(i18n("Never")); | ||
1360 | autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); | ||
1361 | //autoRefreshGroup->addRadio(i18n("selected emails")); | ||
1362 | topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); | ||
1363 | |||
1364 | KPrefsWidRadios *autoInsertGroup = | ||
1365 | addWidRadios(i18n("Auto Insert IMIP Replies"), | ||
1366 | &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); | ||
1367 | autoInsertGroup->addRadio(i18n("Never")); | ||
1368 | autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); | ||
1369 | //autoInsertGroup->addRadio(i18n("selected emails")); | ||
1370 | topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); | ||
1371 | |||
1372 | KPrefsWidRadios *autoRequestGroup = | ||
1373 | addWidRadios(i18n("Auto Insert IMIP Requests"), | ||
1374 | &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); | ||
1375 | autoRequestGroup->addRadio(i18n("Never")); | ||
1376 | autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); | ||
1377 | //autoInsertGroup->addRadio(i18n("selected emails")); | ||
1378 | topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); | ||
1379 | |||
1380 | KPrefsWidRadios *autoFreeBusyGroup = | ||
1381 | addWidRadios(i18n("Auto Send FreeBusy Information"), | ||
1382 | &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); | ||
1383 | autoFreeBusyGroup->addRadio(i18n("Never")); | ||
1384 | autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); | ||
1385 | //autoFreeBusyGroup->addRadio(i18n("selected emails")); | ||
1386 | topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); | ||
1387 | |||
1388 | KPrefsWidRadios *autoFreeBusyReplyGroup = | ||
1389 | addWidRadios(i18n("Auto Save FreeBusy Replies"), | ||
1390 | &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); | ||
1391 | autoFreeBusyReplyGroup->addRadio(i18n("Never")); | ||
1392 | autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); | ||
1393 | //autoFreeBusyGroup->addRadio(i18n("selected emails")); | ||
1394 | topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); | ||
1395 | } | ||
1396 | |||
1397 | void KOPrefsDialog::showPrinterTab() | ||
1398 | { | ||
1399 | showPage(pageIndex(mPrinterTab)); | ||
1400 | } | ||
1401 | |||
1402 | |||
1403 | void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, | ||
1404 | const QStringList *tags) | ||
1405 | { | ||
1406 | if (tags) { | ||
1407 | int i = tags->findIndex(text); | ||
1408 | if (i > 0) combo->setCurrentItem(i); | ||
1409 | } else { | ||
1410 | for(int i=0;i<combo->count();++i) { | ||
1411 | if (combo->text(i) == text) { | ||
1412 | combo->setCurrentItem(i); | ||
1413 | break; | ||
1414 | } | ||
1415 | } | ||
1416 | } | ||
1417 | } | ||
1418 | |||
1419 | void KOPrefsDialog::usrReadConfig() | ||
1420 | { | ||
1421 | mNameEdit->setText(KOPrefs::instance()->fullName()); | ||
1422 | mEmailEdit->setText(KOPrefs::instance()->email()); | ||
1423 | |||
1424 | mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); | ||
1425 | QDate current ( 2001, 1,1); | ||
1426 | mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); | ||
1427 | mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); | ||
1428 | setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); | ||
1429 | //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); | ||
1430 | mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); | ||
1431 | mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); | ||
1432 | mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); | ||
1433 | // if (KOPrefs::instance()->mAllDaySize > 47 ) | ||
1434 | // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2; | ||
1435 | //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize); | ||
1436 | |||
1437 | mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); | ||
1438 | mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); | ||
1439 | mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); | ||
1440 | // mAMails->clear(); | ||
1441 | // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); | ||
1442 | // it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { | ||
1443 | // QListViewItem *item = new QListViewItem(mAMails); | ||
1444 | // item->setText(0,*it); | ||
1445 | // mAMails->insertItem(item); | ||
1446 | // } | ||
1447 | |||
1448 | // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP); | ||
1449 | //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser); | ||
1450 | //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd); | ||
1451 | //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile); | ||
1452 | |||
1453 | //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); | ||
1454 | mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); | ||
1455 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; | ||
1456 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); | ||
1457 | dummy = KOPrefs::instance()->mUserDateFormatShort; | ||
1458 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); | ||
1459 | updateCategories(); | ||
1460 | mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); | ||
1461 | mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); | ||
1462 | mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); | ||
1463 | mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); | ||
1464 | } | ||
1465 | |||
1466 | |||
1467 | void KOPrefsDialog::usrWriteConfig() | ||
1468 | { | ||
1469 | |||
1470 | // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); | ||
1471 | //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); | ||
1472 | //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); | ||
1473 | //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); | ||
1474 | //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); | ||
1475 | KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); | ||
1476 | |||
1477 | KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); | ||
1478 | KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); | ||
1479 | KOPrefs::instance()->setFullName(mNameEdit->text()); | ||
1480 | KOPrefs::instance()->setEmail(mEmailEdit->text()); | ||
1481 | |||
1482 | KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); | ||
1483 | |||
1484 | KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText(); | ||
1485 | QDate date; | ||
1486 | date = mStartDateSavingEdit->date(); | ||
1487 | int sub = 0; | ||
1488 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) | ||
1489 | sub = 1; | ||
1490 | KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub; | ||
1491 | date = mEndDateSavingEdit->date(); | ||
1492 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) | ||
1493 | sub = 1; | ||
1494 | else | ||
1495 | sub = 0; | ||
1496 | KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; | ||
1497 | // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); | ||
1498 | |||
1499 | KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); | ||
1500 | KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); | ||
1501 | KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); | ||
1502 | |||
1503 | //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); | ||
1504 | |||
1505 | QDictIterator<QColor> it(mCategoryDict); | ||
1506 | while (it.current()) { | ||
1507 | KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); | ||
1508 | ++it; | ||
1509 | } | ||
1510 | |||
1511 | KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); | ||
1512 | KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); | ||
1513 | KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); | ||
1514 | |||
1515 | KOPrefs::instance()->mAdditionalMails.clear(); | ||
1516 | // QListViewItem *item; | ||
1517 | // item = mAMails->firstChild(); | ||
1518 | // while (item) | ||
1519 | // { | ||
1520 | // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); | ||
1521 | // item = item->nextSibling(); | ||
1522 | // } | ||
1523 | KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); | ||
1524 | KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; | ||
1525 | KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; | ||
1526 | KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; | ||
1527 | |||
1528 | } | ||
1529 | |||
1530 | void KOPrefsDialog::updateCategories() | ||
1531 | { | ||
1532 | mCategoryCombo->clear(); | ||
1533 | mCategoryDict.clear(); | ||
1534 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); | ||
1535 | updateCategoryColor(); | ||
1536 | } | ||
1537 | |||
1538 | void KOPrefsDialog::warningGroupScheduling() | ||
1539 | { | ||
1540 | warningExperimental(mEnableGroupScheduling->checkBox()->isChecked()); | ||
1541 | } | ||
1542 | |||
1543 | void KOPrefsDialog::warningProjectView() | ||
1544 | { | ||
1545 | warningExperimental(mEnableProjectView->checkBox()->isChecked()); | ||
1546 | } | ||
1547 | |||
1548 | void KOPrefsDialog::warningExperimental(bool on) | ||
1549 | { | ||
1550 | if (on) { | ||
1551 | KMessageBox::information(this,i18n("This is an experimental feature. " | ||
1552 | "It may not work, it may do nothing useful and it may cause data loss. " | ||
1553 | "Use with care.\n" | ||
1554 | "You have to restart KOrganizer for this setting to take effect.")); | ||
1555 | } else { | ||
1556 | KMessageBox::information(this, | ||
1557 | i18n("You have to restart KOrganizer for this setting to take effect.")); | ||
1558 | } | ||
1559 | } | ||
1560 | |||
1561 | void KOPrefsDialog::toggleEmailSettings(bool on) | ||
1562 | { | ||
1563 | if (on) { | ||
1564 | mEmailEdit->setEnabled(false); | ||
1565 | mNameEdit->setEnabled(false); | ||
1566 | mEmailLabel->setEnabled(false); | ||
1567 | mNameLabel->setEnabled(false); | ||
1568 | |||
1569 | KEMailSettings settings; | ||
1570 | mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); | ||
1571 | mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); | ||
1572 | } else { | ||
1573 | mEmailEdit->setEnabled(true); | ||
1574 | mNameEdit->setEnabled(true); | ||
1575 | mEmailLabel->setEnabled(true); | ||
1576 | mNameLabel->setEnabled(true); | ||
1577 | } | ||
1578 | } | ||
1579 | |||
1580 | void KOPrefsDialog::addItem() | ||
1581 | { | ||
1582 | // aEmailsEdit->setEnabled(true); | ||
1583 | // QListViewItem *item = new QListViewItem(mAMails); | ||
1584 | // mAMails->insertItem(item); | ||
1585 | // mAMails->setSelected(item,true); | ||
1586 | // aEmailsEdit->setText(i18n("(EmptyEmail)")); | ||
1587 | } | ||
1588 | |||
1589 | void KOPrefsDialog::removeItem() | ||
1590 | { | ||
1591 | // QListViewItem *item; | ||
1592 | // item = mAMails->selectedItem(); | ||
1593 | // if (!item) return; | ||
1594 | // mAMails->takeItem(item); | ||
1595 | // item = mAMails->selectedItem(); | ||
1596 | // if (!item) { | ||
1597 | // aEmailsEdit->setText(""); | ||
1598 | // aEmailsEdit->setEnabled(false); | ||
1599 | // } | ||
1600 | // if (mAMails->childCount() == 0) { | ||
1601 | // aEmailsEdit->setEnabled(false); | ||
1602 | // } | ||
1603 | } | ||
1604 | |||
1605 | void KOPrefsDialog::updateItem() | ||
1606 | { | ||
1607 | // QListViewItem *item; | ||
1608 | // item = mAMails->selectedItem(); | ||
1609 | // if (!item) return; | ||
1610 | // item->setText(0,aEmailsEdit->text()); | ||
1611 | } | ||
1612 | |||
1613 | void KOPrefsDialog::updateInput() | ||
1614 | { | ||
1615 | // QListViewItem *item; | ||
1616 | // item = mAMails->selectedItem(); | ||
1617 | // if (!item) return; | ||
1618 | // aEmailsEdit->setEnabled(true); | ||
1619 | // aEmailsEdit->setText(item->text(0)); | ||
1620 | } | ||
1621 | void KOPrefsDialog::updateTimezoneOffset( int index ) | ||
1622 | { | ||
1623 | /* | ||
1624 | qDebug("updateTimezoneOffset %d ", index); | ||
1625 | if ( index < 24 ) { | ||
1626 | mTimezoneOffsetSpin->setEnabled ( false ); | ||
1627 | mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 ); | ||
1628 | |||
1629 | |||
1630 | } else { | ||
1631 | if ( index == 24 ) { | ||
1632 | mTimezoneOffsetSpin->setEnabled ( true ); | ||
1633 | mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); | ||
1634 | |||
1635 | } else { | ||
1636 | mTimezoneOffsetSpin->setEnabled ( false ); | ||
1637 | mTimezoneOffsetSpin->setValue( 0 ); | ||
1638 | } | ||
1639 | } | ||
1640 | */ | ||
1641 | } | ||
1642 | |||
1643 | void KOPrefsDialog::setupTimeZoneTab() | ||
1644 | { | ||
1645 | QFrame *topFrame = addPage(i18n("Time Zone"),0,0); | ||
1646 | // DesktopIcon("clock",KIcon::SizeMedium)); | ||
1647 | |||
1648 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); | ||
1649 | topLayout->setSpacing(spacingHint()); | ||
1650 | topLayout->setMargin(marginHint()); | ||
1651 | |||
1652 | QHBox *timeZoneBox = new QHBox( topFrame ); | ||
1653 | topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); | ||
1654 | |||
1655 | new QLabel( i18n("Timezone:"), timeZoneBox ); | ||
1656 | mTimeZoneCombo = new QComboBox( timeZoneBox ); | ||
1657 | if ( QApplication::desktop()->width() < 300 ) { | ||
1658 | mTimeZoneCombo->setMaximumWidth(150); | ||
1659 | } | ||
1660 | |||
1661 | QStringList list; | ||
1662 | list = KGlobal::locale()->timeZoneList(); | ||
1663 | mTimeZoneCombo->insertStringList(list); | ||
1664 | |||
1665 | // find the currently set time zone and select it | ||
1666 | QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId; | ||
1667 | int nCurrentlySet = 11; | ||
1668 | for (int i = 0; i < mTimeZoneCombo->count(); i++) | ||
1669 | { | ||
1670 | if (mTimeZoneCombo->text(i) == sCurrentlySet) | ||
1671 | { | ||
1672 | nCurrentlySet = i; | ||
1673 | break; | ||
1674 | } | ||
1675 | } | ||
1676 | mTimeZoneCombo->setCurrentItem(nCurrentlySet); | ||
1677 | int iii = 1; | ||
1678 | KPrefsWidBool *sb = | ||
1679 | addWidBool(i18n("Timezone has daylight saving"), | ||
1680 | &(KOPrefs::instance()->mUseDaylightsaving),topFrame); | ||
1681 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | ||
1682 | ++iii; | ||
1683 | QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); | ||
1684 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | ||
1685 | ++iii; | ||
1686 | lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); | ||
1687 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | ||
1688 | ++iii; | ||
1689 | lab = new QLabel( i18n("Daylight start:"), topFrame ); | ||
1690 | topLayout->addWidget(lab, iii,0); | ||
1691 | mStartDateSavingEdit = new KDateEdit(topFrame); | ||
1692 | topLayout->addWidget(mStartDateSavingEdit, iii,1); | ||
1693 | ++iii; | ||
1694 | |||
1695 | lab = new QLabel( i18n("Daylight end:"), topFrame ); | ||
1696 | topLayout->addWidget(lab, iii,0); | ||
1697 | mEndDateSavingEdit = new KDateEdit(topFrame); | ||
1698 | topLayout->addWidget(mEndDateSavingEdit, iii,1); | ||
1699 | ++iii; | ||
1700 | QDate current ( 2001, 1,1); | ||
1701 | mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); | ||
1702 | mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); | ||
1703 | |||
1704 | |||
1705 | } | ||
1706 | #endif | ||