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