summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-07-26 13:38:06 (UTC)
committer zautrix <zautrix>2005-07-26 13:38:06 (UTC)
commitb37d71f782540851846613a70a60daf86816f7ec (patch) (unidiff)
treecd69f9e9a57903a2d463f9f30d376631b705f279 /korganizer
parent346437d384dd780a1f7b75dd9caa3770525edfda (diff)
downloadkdepimpi-b37d71f782540851846613a70a60daf86816f7ec.zip
kdepimpi-b37d71f782540851846613a70a60daf86816f7ec.tar.gz
kdepimpi-b37d71f782540851846613a70a60daf86816f7ec.tar.bz2
fixxx
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp1
-rw-r--r--korganizer/koprefs.h1
-rw-r--r--korganizer/koprefsdialog.cpp6
-rw-r--r--korganizer/kowhatsnextview.cpp16
4 files changed, 22 insertions, 2 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 6560877..eb997f5 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -1,625 +1,626 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <qtextstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kglobalsettings.h> 39#include <kglobalsettings.h>
40#include <kconfig.h> 40#include <kconfig.h>
41#include <klocale.h> 41#include <klocale.h>
42#include <kdebug.h> 42#include <kdebug.h>
43#include <kemailsettings.h> 43#include <kemailsettings.h>
44#include <kstaticdeleter.h> 44#include <kstaticdeleter.h>
45#include <libkdepim/kpimglobalprefs.h> 45#include <libkdepim/kpimglobalprefs.h>
46 46
47#include "koprefs.h" 47#include "koprefs.h"
48#include "mainwindow.h" 48#include "mainwindow.h"
49 49
50KOPrefs *KOPrefs::mInstance = 0; 50KOPrefs *KOPrefs::mInstance = 0;
51static KStaticDeleter<KOPrefs> insd; 51static KStaticDeleter<KOPrefs> insd;
52 52
53KOPrefs::KOPrefs() : 53KOPrefs::KOPrefs() :
54 KPimPrefs("korganizerrc") 54 KPimPrefs("korganizerrc")
55{ 55{
56 mGlobalUpdateDisabled = false; 56 mGlobalUpdateDisabled = false;
57 mCategoryColors.setAutoDelete(true); 57 mCategoryColors.setAutoDelete(true);
58 fillMailDefaults(); 58 fillMailDefaults();
59 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 59 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
60 QColor defaultHolidayColor = QColor(255,0,0); 60 QColor defaultHolidayColor = QColor(255,0,0);
61 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 61 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
62 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 62 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
63 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 63 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
64 QColor defaultTodoDueTodayColor = QColor(255,220,100); 64 QColor defaultTodoDueTodayColor = QColor(255,220,100);
65 QColor defaultTodoOverdueColor = QColor(255,153,125); 65 QColor defaultTodoOverdueColor = QColor(255,153,125);
66 QColor defaultTodoRunColor = QColor(99,194,30); 66 QColor defaultTodoRunColor = QColor(99,194,30);
67 KPrefs::setCurrentGroup("General"); 67 KPrefs::setCurrentGroup("General");
68 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 68 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
69 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 69 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
70 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 70 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
71 addItemBool("ShowIconSearch",&mShowIconSearch,true); 71 addItemBool("ShowIconSearch",&mShowIconSearch,true);
72 addItemBool("ShowIconList",&mShowIconList,true); 72 addItemBool("ShowIconList",&mShowIconList,true);
73 addItemBool("ShowIconDay1",&mShowIconDay1,true); 73 addItemBool("ShowIconDay1",&mShowIconDay1,true);
74 addItemBool("ShowIconDay5",&mShowIconDay5,true); 74 addItemBool("ShowIconDay5",&mShowIconDay5,true);
75 addItemBool("ShowIconDay6",&mShowIconDay6,true); 75 addItemBool("ShowIconDay6",&mShowIconDay6,true);
76 addItemBool("ShowIconDay7",&mShowIconDay7,true); 76 addItemBool("ShowIconDay7",&mShowIconDay7,true);
77 addItemBool("ShowIconMonth",&mShowIconMonth,true); 77 addItemBool("ShowIconMonth",&mShowIconMonth,true);
78 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 78 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
79 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 79 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
80 addItemBool("ShowIconBack",&mShowIconBack,true); 80 addItemBool("ShowIconBack",&mShowIconBack,true);
81 addItemBool("ShowIconToday",&mShowIconToday,true); 81 addItemBool("ShowIconToday",&mShowIconToday,true);
82 addItemBool("ShowIconForward",&mShowIconForward,true); 82 addItemBool("ShowIconForward",&mShowIconForward,true);
83 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 83 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
84 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); 84 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true);
85 addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); 85 addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true);
86 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 86 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
87 addItemBool("ShowIconNext",&mShowIconNext,true); 87 addItemBool("ShowIconNext",&mShowIconNext,true);
88 addItemBool("ShowIconJournal",&mShowIconJournal,true); 88 addItemBool("ShowIconJournal",&mShowIconJournal,true);
89 addItemBool("ShowIconStretch",&mShowIconStretch,true); 89 addItemBool("ShowIconStretch",&mShowIconStretch,true);
90 addItemBool("ShowIconFilter",&mShowIconFilter,false); 90 addItemBool("ShowIconFilter",&mShowIconFilter,false);
91 addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true); 91 addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true);
92 92
93 bool addIcons = false; 93 bool addIcons = false;
94#ifdef DESKTOP_VERSION 94#ifdef DESKTOP_VERSION
95 addIcons = true; 95 addIcons = true;
96#endif 96#endif
97 addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons); 97 addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons);
98 addItemBool("ShowIconAllday",&mShowIconAllday,addIcons); 98 addItemBool("ShowIconAllday",&mShowIconAllday,addIcons);
99 addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons); 99 addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons);
100 addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons); 100 addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons);
101 101
102 addItemInt("LastLoadedLanguage",&mOldLanguage,0); 102 addItemInt("LastLoadedLanguage",&mOldLanguage,0);
103 103
104 addItemBool("AskForQuit",&mAskForQuit,false); 104 addItemBool("AskForQuit",&mAskForQuit,false);
105 105
106#ifndef DESKTOP_VERSION 106#ifndef DESKTOP_VERSION
107 addItemBool("ShowFullMenu",&mShowFullMenu,false); 107 addItemBool("ShowFullMenu",&mShowFullMenu,false);
108#else 108#else
109 addItemBool("ShowFullMenu",&mShowFullMenu,true); 109 addItemBool("ShowFullMenu",&mShowFullMenu,true);
110#endif 110#endif
111 addItemBool("ToolBarHor",&mToolBarHor, true ); 111 addItemBool("ToolBarHor",&mToolBarHor, true );
112 addItemBool("ToolBarUp",&mToolBarUp, false ); 112 addItemBool("ToolBarUp",&mToolBarUp, false );
113 addItemBool("ToolBarHorV",&mToolBarHorV, true ); 113 addItemBool("ToolBarHorV",&mToolBarHorV, true );
114 addItemBool("ToolBarUpV",&mToolBarUpV, false ); 114 addItemBool("ToolBarUpV",&mToolBarUpV, false );
115 addItemBool("ToolBarHorN",&mToolBarHorN, true ); 115 addItemBool("ToolBarHorN",&mToolBarHorN, true );
116 addItemBool("ToolBarUpN",&mToolBarUpN, false ); 116 addItemBool("ToolBarUpN",&mToolBarUpN, false );
117 addItemBool("ToolBarHorF",&mToolBarHorF, true ); 117 addItemBool("ToolBarHorF",&mToolBarHorF, true );
118 addItemBool("ToolBarUpF",&mToolBarUpF, false ); 118 addItemBool("ToolBarUpF",&mToolBarUpF, false );
119 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 119 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
120 addItemBool("WhatsNextTime2Lines",&mWhatsNextTime2Lines, false );
120 addItemInt("Whats Next Days",&mWhatsNextDays,3); 121 addItemInt("Whats Next Days",&mWhatsNextDays,3);
121 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 122 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
122 123
123 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 124 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
124 addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true); 125 addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true);
125 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); 126 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
126 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); 127 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
127 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 128 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
128 addItemInt("AllDay Size",&mAllDaySize,28); 129 addItemInt("AllDay Size",&mAllDaySize,28);
129 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 130 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
130 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 131 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
131 132
132 addItemStringList("LocationDefaults",&mLocationDefaults ); 133 addItemStringList("LocationDefaults",&mLocationDefaults );
133 addItemStringList("EventSummary User",&mEventSummaryUser); 134 addItemStringList("EventSummary User",&mEventSummaryUser);
134 addItemStringList("TodoSummary User",&mTodoSummaryUser); 135 addItemStringList("TodoSummary User",&mTodoSummaryUser);
135 addItemStringList("JournalSummary User",&mJournalSummaryUser); 136 addItemStringList("JournalSummary User",&mJournalSummaryUser);
136 137
137 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 138 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
138 addItemBool("Enable Project View",&mEnableProjectView,false); 139 addItemBool("Enable Project View",&mEnableProjectView,false);
139 addItemBool("Auto Save",&mAutoSave,false); 140 addItemBool("Auto Save",&mAutoSave,false);
140 addItemInt("Auto Save Interval",&mAutoSaveInterval,3); 141 addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
141 addItemBool("Confirm Deletes",&mConfirm,true); 142 addItemBool("Confirm Deletes",&mConfirm,true);
142 addItemString("Archive File",&mArchiveFile); 143 addItemString("Archive File",&mArchiveFile);
143 addItemString("Html Export File",&mHtmlExportFile, 144 addItemString("Html Export File",&mHtmlExportFile,
144 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); 145 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
145 addItemBool("Html With Save",&mHtmlWithSave,false); 146 addItemBool("Html With Save",&mHtmlWithSave,false);
146 147
147 KPrefs::setCurrentGroup("Personal Settings"); 148 KPrefs::setCurrentGroup("Personal Settings");
148 149
149 addItemInt("Mail Client",&mMailClient,MailClientKMail); 150 addItemInt("Mail Client",&mMailClient,MailClientKMail);
150 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 151 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
151 addItemBool("Bcc",&mBcc,false); 152 addItemBool("Bcc",&mBcc,false);
152 153
153 KPrefs::setCurrentGroup("Time & Date"); 154 KPrefs::setCurrentGroup("Time & Date");
154 155
155 156
156 addItemInt("Default Start Time",&mStartTime,10); 157 addItemInt("Default Start Time",&mStartTime,10);
157 addItemInt("Default Duration",&mDefaultDuration,2); 158 addItemInt("Default Duration",&mDefaultDuration,2);
158 addItemInt("Default Alarm Time",&mAlarmTime,3); 159 addItemInt("Default Alarm Time",&mAlarmTime,3);
159 KPrefs::setCurrentGroup("AlarmSettings"); 160 KPrefs::setCurrentGroup("AlarmSettings");
160 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 161 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
161 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 162 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
162 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 163 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
163 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 164 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
164 165
165 166
166 KPrefs::setCurrentGroup("Calendar"); 167 KPrefs::setCurrentGroup("Calendar");
167 168
168 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 169 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
169 170
170 KPrefs::setCurrentGroup("Fonts"); 171 KPrefs::setCurrentGroup("Fonts");
171 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 172 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
172 QFont fon = KGlobalSettings::generalFont(); 173 QFont fon = KGlobalSettings::generalFont();
173 addItemFont("TimeBar Font",&mTimeBarFont,fon ); 174 addItemFont("TimeBar Font",&mTimeBarFont,fon );
174 addItemFont("MonthView Font",&mMonthViewFont,fon); 175 addItemFont("MonthView Font",&mMonthViewFont,fon);
175 addItemFont("AgendaView Font",&mAgendaViewFont,fon); 176 addItemFont("AgendaView Font",&mAgendaViewFont,fon);
176 addItemFont("MarcusBains Font",&mMarcusBainsFont,fon); 177 addItemFont("MarcusBains Font",&mMarcusBainsFont,fon);
177 addItemFont("TimeLabels Font",&mTimeLabelsFont,fon); 178 addItemFont("TimeLabels Font",&mTimeLabelsFont,fon);
178 addItemFont("TodoView Font",&mTodoViewFont,fon); 179 addItemFont("TodoView Font",&mTodoViewFont,fon);
179 addItemFont("ListView Font",&mListViewFont,fon); 180 addItemFont("ListView Font",&mListViewFont,fon);
180 addItemFont("DateNavigator Font",&mDateNavigatorFont,fon); 181 addItemFont("DateNavigator Font",&mDateNavigatorFont,fon);
181 addItemFont("EditBox Font",&mEditBoxFont,fon); 182 addItemFont("EditBox Font",&mEditBoxFont,fon);
182 addItemFont("JournalView Font",&mJornalViewFont,fon); 183 addItemFont("JournalView Font",&mJornalViewFont,fon);
183 addItemFont("WhatsNextView Font",&mWhatsNextFont,fon); 184 addItemFont("WhatsNextView Font",&mWhatsNextFont,fon);
184 addItemFont("EventView Font",&mEventViewFont,fon); 185 addItemFont("EventView Font",&mEventViewFont,fon);
185 186
186 KPrefs::setCurrentGroup("RemoteSyncing"); 187 KPrefs::setCurrentGroup("RemoteSyncing");
187 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 188 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
188 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 189 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
189 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 190 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
190 addItemInt("LastSyncTime",&mLastSyncTime,0); 191 addItemInt("LastSyncTime",&mLastSyncTime,0);
191 192
192#ifdef _WIN32_ 193#ifdef _WIN32_
193 QString hdp= locateLocal("data","korganizer")+"\\\\"; 194 QString hdp= locateLocal("data","korganizer")+"\\\\";
194#else 195#else
195 QString hdp= locateLocal("data","korganizer")+"/"; 196 QString hdp= locateLocal("data","korganizer")+"/";
196#endif 197#endif
197 198
198 KPrefs::setCurrentGroup("LoadSaveFileNames"); 199 KPrefs::setCurrentGroup("LoadSaveFileNames");
199 200
200 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 201 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
201 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 202 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
202 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 203 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
203 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 204 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
204 205
205 206
206 KPrefs::setCurrentGroup("Locale"); 207 KPrefs::setCurrentGroup("Locale");
207 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 208 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
208 209
209 210
210 KPrefs::setCurrentGroup("Colors"); 211 KPrefs::setCurrentGroup("Colors");
211 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 212 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
212 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 213 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
213 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 214 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
214 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); 215 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) );
215 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 216 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
216 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 217 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
217 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 218 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
218 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 219 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
219 addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor); 220 addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor);
220 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 221 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
221 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 222 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
222 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 223 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
223 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 224 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
224 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 225 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
225 addItemBool("MonthViewWeek",&mMonthViewWeek,false); 226 addItemBool("MonthViewWeek",&mMonthViewWeek,false);
226 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 227 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
227 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 228 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
228 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 229 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
229 addItemBool("UseAppColors",&mUseAppColors,false); 230 addItemBool("UseAppColors",&mUseAppColors,false);
230 231
231 232
232 233
233 KPrefs::setCurrentGroup("Views"); 234 KPrefs::setCurrentGroup("Views");
234 addItemBool("Block Popup Menu",&mBlockPopupMenu,false); 235 addItemBool("Block Popup Menu",&mBlockPopupMenu,false);
235 addItemBool("Show Date Navigator",&mShowDateNavigator,true); 236 addItemBool("Show Date Navigator",&mShowDateNavigator,true);
236 addItemInt("Hour Size",&mHourSize,8); 237 addItemInt("Hour Size",&mHourSize,8);
237 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 238 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
238 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 239 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
239 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 240 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
240 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 241 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
241 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 242 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
242 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 243 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
243 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true); 244 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true);
244#ifdef DESKTOP_VERION 245#ifdef DESKTOP_VERION
245 addItemBool("Enable ToolTips",&mEnableToolTips,true); 246 addItemBool("Enable ToolTips",&mEnableToolTips,true);
246#else 247#else
247 addItemBool("Enable ToolTips",&mEnableToolTips,false); 248 addItemBool("Enable ToolTips",&mEnableToolTips,false);
248#endif 249#endif
249 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 250 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
250 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 251 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
251 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 252 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
252 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 253 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
253 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); 254 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true);
254 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 255 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
255 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 256 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
256 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 257 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
257 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 258 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
258 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; 259 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
259 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 260 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
260 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 261 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
261 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 262 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
262 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 263 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
263 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 264 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
264 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 265 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
265 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); 266 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true);
266 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); 267 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true);
267 addItemBool("MonthViewWeekRowlayout",&mMonthViewWeekRowlayout,false); 268 addItemBool("MonthViewWeekRowlayout",&mMonthViewWeekRowlayout,false);
268 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 269 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
269 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 270 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
270#ifdef DESKTOP_VERSION 271#ifdef DESKTOP_VERSION
271 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 272 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
272#else 273#else
273 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 274 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
274#endif 275#endif
275 addItemInt("Day Begins",&mDayBegins,7); 276 addItemInt("Day Begins",&mDayBegins,7);
276 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 277 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
277 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 278 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
278 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 279 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
279 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 280 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
280 281
281 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 282 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
282 addItemBool("Full View Month",&mFullViewMonth,true); 283 addItemBool("Full View Month",&mFullViewMonth,true);
283 addItemBool("Full View Todo",&mFullViewTodo,true); 284 addItemBool("Full View Todo",&mFullViewTodo,true);
284 addItemBool("Quick Todo",&mEnableQuickTodo,false); 285 addItemBool("Quick Todo",&mEnableQuickTodo,false);
285 286
286 addItemInt("Next X Days",&mNextXDays,3); 287 addItemInt("Next X Days",&mNextXDays,3);
287 288
288 KPrefs::setCurrentGroup("Printer"); 289 KPrefs::setCurrentGroup("Printer");
289 290
290 KPrefs::setCurrentGroup("Layout"); 291 KPrefs::setCurrentGroup("Layout");
291 292
292 addItemBool("CompactDialogs",&mCompactDialogs,false); 293 addItemBool("CompactDialogs",&mCompactDialogs,false);
293 addItemBool("VerticalScreen",&mVerticalScreen,true); 294 addItemBool("VerticalScreen",&mVerticalScreen,true);
294 295
295 KPrefs::setCurrentGroup("KOrganizer Plugins"); 296 KPrefs::setCurrentGroup("KOrganizer Plugins");
296 297
297 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 298 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
298 299
299 KPrefs::setCurrentGroup("Group Scheduling"); 300 KPrefs::setCurrentGroup("Group Scheduling");
300 301
301 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 302 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
302 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 303 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
303 addItemStringList("AdditionalMails",&mAdditionalMails,""); 304 addItemStringList("AdditionalMails",&mAdditionalMails,"");
304 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 305 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
305 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 306 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
306 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 307 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
307 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 308 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
308 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 309 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
309 310
310 KPrefs::setCurrentGroup( "Editors" ); 311 KPrefs::setCurrentGroup( "Editors" );
311 312
312 addItemStringList( "EventTemplates", &mEventTemplates ); 313 addItemStringList( "EventTemplates", &mEventTemplates );
313 addItemStringList( "TodoTemplates", &mTodoTemplates ); 314 addItemStringList( "TodoTemplates", &mTodoTemplates );
314 315
315 addItemInt("DestinationPolicy",&mDestination,standardDestination); 316 addItemInt("DestinationPolicy",&mDestination,standardDestination);
316 317
317 KPrefs::setCurrentGroup( "ViewOptions" ); 318 KPrefs::setCurrentGroup( "ViewOptions" );
318 addItemBool("EVshowDetails",&mEVshowDetails,true); 319 addItemBool("EVshowDetails",&mEVshowDetails,true);
319 addItemBool("EVshowCreated",&mEVshowCreated,true); 320 addItemBool("EVshowCreated",&mEVshowCreated,true);
320 addItemBool("EVshowChanged",&mEVshowChanged,true); 321 addItemBool("EVshowChanged",&mEVshowChanged,true);
321 addItemBool("WTshowDetails",&mWTshowDetails,false); 322 addItemBool("WTshowDetails",&mWTshowDetails,false);
322 addItemBool("WTshowCreated",&mWTshowCreated,false); 323 addItemBool("WTshowCreated",&mWTshowCreated,false);
323 addItemBool("WTshowChanged",&mWTshowChanged,false); 324 addItemBool("WTshowChanged",&mWTshowChanged,false);
324 mCalendars.setAutoDelete( true ); 325 mCalendars.setAutoDelete( true );
325} 326}
326 327
327 328
328KOPrefs::~KOPrefs() 329KOPrefs::~KOPrefs()
329{ 330{
330 if (mInstance == this) 331 if (mInstance == this)
331 mInstance = insd.setObject(0); 332 mInstance = insd.setObject(0);
332 mCalendars.setAutoDelete( true ); 333 mCalendars.setAutoDelete( true );
333 mCalendars.clear(); 334 mCalendars.clear();
334 //qDebug("KOPrefs::~KOPrefs() "); 335 //qDebug("KOPrefs::~KOPrefs() ");
335} 336}
336 337
337 338
338KOPrefs *KOPrefs::instance() 339KOPrefs *KOPrefs::instance()
339{ 340{
340 if (!mInstance) { 341 if (!mInstance) {
341 mInstance = insd.setObject(new KOPrefs()); 342 mInstance = insd.setObject(new KOPrefs());
342 mInstance->readConfig(); 343 mInstance->readConfig();
343 } 344 }
344 345
345 return mInstance; 346 return mInstance;
346} 347}
347 348
348void KOPrefs::usrSetDefaults() 349void KOPrefs::usrSetDefaults()
349{ 350{
350 351
351} 352}
352 353
353void KOPrefs::fillMailDefaults() 354void KOPrefs::fillMailDefaults()
354{ 355{
355 if (mName.isEmpty()) mName = i18n("Anonymous"); 356 if (mName.isEmpty()) mName = i18n("Anonymous");
356 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 357 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
357} 358}
358 359
359void KOPrefs::setTimeZoneIdDefault() 360void KOPrefs::setTimeZoneIdDefault()
360{ 361{
361 ; 362 ;
362} 363}
363 364
364void KOPrefs::setAllDefaults() 365void KOPrefs::setAllDefaults()
365{ 366{
366 setCategoryDefaults(); 367 setCategoryDefaults();
367 mEventSummaryUser = getDefaultList() ; 368 mEventSummaryUser = getDefaultList() ;
368 mTodoSummaryUser = getDefaultList() ; 369 mTodoSummaryUser = getDefaultList() ;
369 mJournalSummaryUser = getDefaultList() ; 370 mJournalSummaryUser = getDefaultList() ;
370 mLocationDefaults = getLocationDefaultList(); 371 mLocationDefaults = getLocationDefaultList();
371} 372}
372 373
373void KOPrefs::setCategoryDefaults() 374void KOPrefs::setCategoryDefaults()
374{ 375{
375 mCustomCategories.clear(); 376 mCustomCategories.clear();
376 mCustomCategories = getDefaultList(); 377 mCustomCategories = getDefaultList();
377 378
378 QStringList::Iterator it; 379 QStringList::Iterator it;
379 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 380 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
380 setCategoryColor(*it,mDefaultCategoryColor); 381 setCategoryColor(*it,mDefaultCategoryColor);
381 } 382 }
382} 383}
383QStringList KOPrefs::getLocationDefaultList() 384QStringList KOPrefs::getLocationDefaultList()
384{ 385{
385 QStringList retval ; 386 QStringList retval ;
386 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 387 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
387 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") 388 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room")
388 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") 389 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
389 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 390 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
390 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 391 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
391 392
392 retval.sort(); 393 retval.sort();
393 return retval; 394 return retval;
394} 395}
395QStringList KOPrefs::getDefaultList() 396QStringList KOPrefs::getDefaultList()
396{ 397{
397 QStringList retval ; 398 QStringList retval ;
398 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer") 399 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer")
399 << i18n("Break") 400 << i18n("Break")
400 << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts") 401 << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts")
401 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") 402 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts")
402 << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal") 403 << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal")
403 << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping") 404 << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping")
404 << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV") 405 << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")
405 << i18n("Vacation") ; 406 << i18n("Vacation") ;
406 retval.sort(); 407 retval.sort();
407 //qDebug("cat %s ", retval.join("-").latin1()); 408 //qDebug("cat %s ", retval.join("-").latin1());
408 return retval; 409 return retval;
409} 410}
410// << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch")<< i18n("University")<< i18n("School")<< i18n("Flight")<< i18n("Key Customer") << i18n("VIP") << i18n("SyncEvent") << i18n("Cinema") 411// << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch")<< i18n("University")<< i18n("School")<< i18n("Flight")<< i18n("Key Customer") << i18n("VIP") << i18n("SyncEvent") << i18n("Cinema")
411void KOPrefs::usrReadConfig() 412void KOPrefs::usrReadConfig()
412{ 413{
413 config()->setGroup("General"); 414 config()->setGroup("General");
414 415
415 //qDebug("KOPrefs::usrReadConfig() "); 416 //qDebug("KOPrefs::usrReadConfig() ");
416 mCustomCategories = config()->readListEntry("Custom Categories"); 417 mCustomCategories = config()->readListEntry("Custom Categories");
417 mOldLoadedLanguage = mOldLanguage ; 418 mOldLoadedLanguage = mOldLanguage ;
418 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 419 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
419 if (mLocationDefaults.isEmpty()) { 420 if (mLocationDefaults.isEmpty()) {
420 mLocationDefaults = getLocationDefaultList(); 421 mLocationDefaults = getLocationDefaultList();
421 } 422 }
422 423
423 if (mEventSummaryUser.isEmpty()) { 424 if (mEventSummaryUser.isEmpty()) {
424 mEventSummaryUser = getDefaultList() ; 425 mEventSummaryUser = getDefaultList() ;
425 } 426 }
426 if (mTodoSummaryUser.isEmpty()) { 427 if (mTodoSummaryUser.isEmpty()) {
427 mTodoSummaryUser = getDefaultList() ; 428 mTodoSummaryUser = getDefaultList() ;
428 } 429 }
429 430
430 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 431 if (mCustomCategories.isEmpty()) setCategoryDefaults();
431 432
432 config()->setGroup("Personal Settings"); 433 config()->setGroup("Personal Settings");
433 mName = config()->readEntry("user_name",""); 434 mName = config()->readEntry("user_name","");
434 mEmail = config()->readEntry("user_email",""); 435 mEmail = config()->readEntry("user_email","");
435 fillMailDefaults(); 436 fillMailDefaults();
436 437
437 config()->setGroup("Category Colors"); 438 config()->setGroup("Category Colors");
438 QStringList::Iterator it; 439 QStringList::Iterator it;
439 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 440 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
440 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 441 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
441 442
442 } 443 }
443 KConfig fc (locateLocal("config","kopicalendarrc")); 444 KConfig fc (locateLocal("config","kopicalendarrc"));
444 fc.setGroup("CC"); 445 fc.setGroup("CC");
445 int numCals = fc.readNumEntry("NumberCalendars",0 ); 446 int numCals = fc.readNumEntry("NumberCalendars",0 );
446 mNextAvailableCalendar = 1; 447 mNextAvailableCalendar = 1;
447 if ( numCals == 0 ) { 448 if ( numCals == 0 ) {
448 KopiCalendarFile *kkf = getNewCalendar(); 449 KopiCalendarFile *kkf = getNewCalendar();
449 kkf->isStandard = true; 450 kkf->isStandard = true;
450 kkf->mName = i18n("Standard"); 451 kkf->mName = i18n("Standard");
451 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 452 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
452 } 453 }
453 while ( mNextAvailableCalendar <= numCals ) { 454 while ( mNextAvailableCalendar <= numCals ) {
454 //qDebug("Read cal #%d ", mNextAvailableCalendar ); 455 //qDebug("Read cal #%d ", mNextAvailableCalendar );
455 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); 456 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar );
456 KopiCalendarFile *kkf = getNewCalendar(); 457 KopiCalendarFile *kkf = getNewCalendar();
457 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); 458 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false );
458 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); 459 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true);
459 kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false ); 460 kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false );
460 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); 461 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true);
461 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); 462 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false);
462 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); 463 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar");
463 kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); 464 kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName);
464 kkf->mSavedFileName = fc.readEntry( prefix+"_SavedFileName", kkf->mFileName); 465 kkf->mSavedFileName = fc.readEntry( prefix+"_SavedFileName", kkf->mFileName);
465 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); 466 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor);
466 if ( kkf->mCalNumber == 1 ) { 467 if ( kkf->mCalNumber == 1 ) {
467 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 468 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
468 } 469 }
469 //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() ); 470 //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() );
470 if ( kkf->mName == i18n("Birthdays") ) { 471 if ( kkf->mName == i18n("Birthdays") ) {
471 kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); 472 kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" );
472 } 473 }
473 if ( kkf->isRelative ) 474 if ( kkf->isRelative )
474 kkf->mFileName = KGlobalSettings::calendarDir() + kkf->mSavedFileName; 475 kkf->mFileName = KGlobalSettings::calendarDir() + kkf->mSavedFileName;
475 } 476 }
476 477
477 KPimPrefs::usrReadConfig(); 478 KPimPrefs::usrReadConfig();
478} 479}
479 480
480KopiCalendarFile * KOPrefs::getCalendar( int num ) 481KopiCalendarFile * KOPrefs::getCalendar( int num )
481{ 482{
482 return mDefCalColors[num-1]; 483 return mDefCalColors[num-1];
483} 484}
484 485
485KopiCalendarFile * KOPrefs::getNewCalendar() 486KopiCalendarFile * KOPrefs::getNewCalendar()
486{ 487{
487 KopiCalendarFile * kkf = new KopiCalendarFile(); 488 KopiCalendarFile * kkf = new KopiCalendarFile();
488 kkf->mCalNumber = mNextAvailableCalendar; 489 kkf->mCalNumber = mNextAvailableCalendar;
489 mDefCalColors.resize( mNextAvailableCalendar ); 490 mDefCalColors.resize( mNextAvailableCalendar );
490 mDefCalColors[mNextAvailableCalendar-1] = kkf; 491 mDefCalColors[mNextAvailableCalendar-1] = kkf;
491 ++mNextAvailableCalendar; 492 ++mNextAvailableCalendar;
492 kkf->mDefaultColor = mEventColor; 493 kkf->mDefaultColor = mEventColor;
493 kkf->mName = i18n("New Calendar"); 494 kkf->mName = i18n("New Calendar");
494 mCalendars.append( kkf ); 495 mCalendars.append( kkf );
495 return kkf; 496 return kkf;
496} 497}
497void KOPrefs::deleteCalendar( int num ) 498void KOPrefs::deleteCalendar( int num )
498{ 499{
499 KopiCalendarFile * kkf = mCalendars.first(); 500 KopiCalendarFile * kkf = mCalendars.first();
500 while ( kkf ) { 501 while ( kkf ) {
501 if ( kkf->mCalNumber == num ) { 502 if ( kkf->mCalNumber == num ) {
502 qDebug("KOPrefs::deleteCalendar %d ", num ); 503 qDebug("KOPrefs::deleteCalendar %d ", num );
503 mCalendars.remove( kkf ); 504 mCalendars.remove( kkf );
504 delete kkf; 505 delete kkf;
505 return; 506 return;
506 } 507 }
507 kkf = mCalendars.next(); 508 kkf = mCalendars.next();
508 } 509 }
509} 510}
510int KOPrefs::getCalendarID( const QString & name ) 511int KOPrefs::getCalendarID( const QString & name )
511{ 512{
512 KopiCalendarFile * kkf = mCalendars.first(); 513 KopiCalendarFile * kkf = mCalendars.first();
513 while ( kkf ) { 514 while ( kkf ) {
514 if ( name == kkf->mName) 515 if ( name == kkf->mName)
515 return kkf->mCalNumber; 516 return kkf->mCalNumber;
516 kkf = mCalendars.next(); 517 kkf = mCalendars.next();
517 } 518 }
518 return 1; 519 return 1;
519} 520}
520QString KOPrefs::calName( int calNum) const 521QString KOPrefs::calName( int calNum) const
521{ 522{
522 return (mDefCalColors[calNum-1])->mName; 523 return (mDefCalColors[calNum-1])->mName;
523} 524}
524QColor KOPrefs::defaultColor( int calNum ) const 525QColor KOPrefs::defaultColor( int calNum ) const
525{ 526{
526 if ( calNum == 1 ) return mEventColor; 527 if ( calNum == 1 ) return mEventColor;
527 return (mDefCalColors[calNum-1])->mDefaultColor; 528 return (mDefCalColors[calNum-1])->mDefaultColor;
528} 529}
529void KOPrefs::usrWriteConfig() 530void KOPrefs::usrWriteConfig()
530{ 531{
531 config()->setGroup("General"); 532 config()->setGroup("General");
532 config()->writeEntry("Custom Categories",mCustomCategories); 533 config()->writeEntry("Custom Categories",mCustomCategories);
533 534
534 config()->setGroup("Personal Settings"); 535 config()->setGroup("Personal Settings");
535 config()->writeEntry("user_name",mName); 536 config()->writeEntry("user_name",mName);
536 config()->writeEntry("user_email",mEmail); 537 config()->writeEntry("user_email",mEmail);
537 538
538 config()->setGroup("Category Colors"); 539 config()->setGroup("Category Colors");
539 QDictIterator<QColor> it(mCategoryColors); 540 QDictIterator<QColor> it(mCategoryColors);
540 while (it.current()) { 541 while (it.current()) {
541 config()->writeEntry(it.currentKey(),*(it.current())); 542 config()->writeEntry(it.currentKey(),*(it.current()));
542 ++it; 543 ++it;
543 } 544 }
544 KConfig fc (locateLocal("config","kopicalendarrc")); 545 KConfig fc (locateLocal("config","kopicalendarrc"));
545 fc.setGroup("CC"); 546 fc.setGroup("CC");
546 fc.deleteGroup( "CC"); 547 fc.deleteGroup( "CC");
547 fc.setGroup("CC"); 548 fc.setGroup("CC");
548 fc.writeEntry("NumberCalendars",mCalendars.count()); 549 fc.writeEntry("NumberCalendars",mCalendars.count());
549 int numCal = 1; 550 int numCal = 1;
550 int writeCal = 0; 551 int writeCal = 0;
551 while ( numCal < mNextAvailableCalendar ) { 552 while ( numCal < mNextAvailableCalendar ) {
552 KopiCalendarFile * kkf = mCalendars.first(); 553 KopiCalendarFile * kkf = mCalendars.first();
553 while ( kkf ) { 554 while ( kkf ) {
554 //qDebug("cal num %d %d ", kkf->mCalNumber, numCal); 555 //qDebug("cal num %d %d ", kkf->mCalNumber, numCal);
555 if ( kkf->mCalNumber == numCal ) { 556 if ( kkf->mCalNumber == numCal ) {
556 ++writeCal; 557 ++writeCal;
557 //qDebug("Write calendar %d %d ", numCal , writeCal); 558 //qDebug("Write calendar %d %d ", numCal , writeCal);
558 QString prefix = "Cal_" + QString::number( writeCal ); 559 QString prefix = "Cal_" + QString::number( writeCal );
559 fc.writeEntry( prefix+"_isStandard", kkf->isStandard ); 560 fc.writeEntry( prefix+"_isStandard", kkf->isStandard );
560 fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled ); 561 fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled );
561 fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); 562 fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled );
562 fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); 563 fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly );
563 fc.writeEntry( prefix+"_isRelative", kkf->isRelative ); 564 fc.writeEntry( prefix+"_isRelative", kkf->isRelative );
564 fc.writeEntry( prefix+"_Name", kkf->mName); 565 fc.writeEntry( prefix+"_Name", kkf->mName);
565 fc.writeEntry( prefix+"_FileName", kkf->mFileName); 566 fc.writeEntry( prefix+"_FileName", kkf->mFileName);
566 fc.writeEntry( prefix+"_SavedFileName", kkf->mSavedFileName); 567 fc.writeEntry( prefix+"_SavedFileName", kkf->mSavedFileName);
567 fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); 568 fc.writeEntry( prefix+"_Color",kkf->mDefaultColor);
568 } 569 }
569 kkf = mCalendars.next(); 570 kkf = mCalendars.next();
570 } 571 }
571 ++numCal; 572 ++numCal;
572 } 573 }
573 fc.sync(); 574 fc.sync();
574 KPimPrefs::usrWriteConfig(); 575 KPimPrefs::usrWriteConfig();
575} 576}
576 577
577void KOPrefs::setCategoryColor(QString cat,const QColor & color) 578void KOPrefs::setCategoryColor(QString cat,const QColor & color)
578{ 579{
579 mCategoryColors.replace(cat,new QColor(color)); 580 mCategoryColors.replace(cat,new QColor(color));
580} 581}
581 582
582QColor *KOPrefs::categoryColor(QString cat) 583QColor *KOPrefs::categoryColor(QString cat)
583{ 584{
584 QColor *color = 0; 585 QColor *color = 0;
585 586
586 if (!cat.isEmpty()) color = mCategoryColors[cat]; 587 if (!cat.isEmpty()) color = mCategoryColors[cat];
587 588
588 if (color) return color; 589 if (color) return color;
589 else return &mDefaultCategoryColor; 590 else return &mDefaultCategoryColor;
590} 591}
591 592
592void KOPrefs::setFullName(const QString &name) 593void KOPrefs::setFullName(const QString &name)
593{ 594{
594 mName = name; 595 mName = name;
595} 596}
596 597
597void KOPrefs::setEmail(const QString &email) 598void KOPrefs::setEmail(const QString &email)
598{ 599{
599 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); 600 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() );
600 mEmail = email; 601 mEmail = email;
601} 602}
602 603
603QString KOPrefs::fullName() 604QString KOPrefs::fullName()
604{ 605{
605 if (mEmailControlCenter) { 606 if (mEmailControlCenter) {
606 KEMailSettings settings; 607 KEMailSettings settings;
607 return settings.getSetting(KEMailSettings::RealName); 608 return settings.getSetting(KEMailSettings::RealName);
608 } else { 609 } else {
609 return mName; 610 return mName;
610 } 611 }
611} 612}
612 613
613QString KOPrefs::email() 614QString KOPrefs::email()
614{ 615{
615 if (mEmailControlCenter) { 616 if (mEmailControlCenter) {
616 KEMailSettings settings; 617 KEMailSettings settings;
617 return settings.getSetting(KEMailSettings::EmailAddress); 618 return settings.getSetting(KEMailSettings::EmailAddress);
618 } else { 619 } else {
619 return mEmail; 620 return mEmail;
620 } 621 }
621} 622}
622KConfig* KOPrefs::getConfig() 623KConfig* KOPrefs::getConfig()
623{ 624{
624 return config(); 625 return config();
625} 626}
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 2ff03fa..9749ba3 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -1,364 +1,365 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOPREFS_H 23#ifndef KOPREFS_H
24#define KOPREFS_H 24#define KOPREFS_H
25 25
26 26
27#include <libkdepim/kpimprefs.h> 27#include <libkdepim/kpimprefs.h>
28#include <qdict.h> 28#include <qdict.h>
29#include <qdir.h> 29#include <qdir.h>
30#include <qobject.h> 30#include <qobject.h>
31 31
32class KConfig; 32class KConfig;
33class QFont; 33class QFont;
34class QColor; 34class QColor;
35class QStringList; 35class QStringList;
36 36
37#define VIEW_WN_VIEW 1 37#define VIEW_WN_VIEW 1
38#define VIEW_NX_VIEW 2 38#define VIEW_NX_VIEW 2
39#define VIEW_J_VIEW 3 39#define VIEW_J_VIEW 3
40#define VIEW_A_VIEW 4 40#define VIEW_A_VIEW 4
41#define VIEW_ML_VIEW 5 41#define VIEW_ML_VIEW 5
42#define VIEW_M_VIEW 6 42#define VIEW_M_VIEW 6
43#define VIEW_L_VIEW 7 43#define VIEW_L_VIEW 7
44#define VIEW_T_VIEW 8 44#define VIEW_T_VIEW 8
45 45
46class KopiCalendarFile : public QObject 46class KopiCalendarFile : public QObject
47{ 47{
48 public: 48 public:
49 KopiCalendarFile( ) : QObject( ) 49 KopiCalendarFile( ) : QObject( )
50 { 50 {
51 isStandard = false; 51 isStandard = false;
52 isEnabled = true; 52 isEnabled = true;
53 isAlarmEnabled = true; 53 isAlarmEnabled = true;
54 isReadOnly = false; 54 isReadOnly = false;
55 mName = "Calendar"; 55 mName = "Calendar";
56 mFileName = QDir::homeDirPath() + "/icalfile.ics"; 56 mFileName = QDir::homeDirPath() + "/icalfile.ics";
57 mSavedFileName = "icalfile.ics"; 57 mSavedFileName = "icalfile.ics";
58 mCalNumber = 0; 58 mCalNumber = 0;
59 mDefaultColor = Qt::red; 59 mDefaultColor = Qt::red;
60 mErrorOnLoad = false; 60 mErrorOnLoad = false;
61 isRelative = false; 61 isRelative = false;
62 } 62 }
63 bool isStandard; 63 bool isStandard;
64 bool isEnabled; 64 bool isEnabled;
65 bool isAlarmEnabled; 65 bool isAlarmEnabled;
66 bool isReadOnly; 66 bool isReadOnly;
67 bool mErrorOnLoad; 67 bool mErrorOnLoad;
68 QString mName; 68 QString mName;
69 QString mFileName; 69 QString mFileName;
70 QString mSavedFileName; 70 QString mSavedFileName;
71 bool isRelative; 71 bool isRelative;
72 int mCalNumber; 72 int mCalNumber;
73 QColor mDefaultColor; 73 QColor mDefaultColor;
74 QDateTime mLoadDt; 74 QDateTime mLoadDt;
75}; 75};
76class KOPrefs : public KPimPrefs 76class KOPrefs : public KPimPrefs
77{ 77{
78 public: 78 public:
79 enum { FormatVCalendar, FormatICalendar }; 79 enum { FormatVCalendar, FormatICalendar };
80 enum { MailClientKMail, MailClientSendmail }; 80 enum { MailClientKMail, MailClientSendmail };
81 enum { IMIPDummy, IMIPKMail }; 81 enum { IMIPDummy, IMIPKMail };
82 enum { IMIPOutbox, IMIPdirectsend }; 82 enum { IMIPOutbox, IMIPdirectsend };
83 enum { neverAuto, addressbookAuto, selectedAuto }; 83 enum { neverAuto, addressbookAuto, selectedAuto };
84 enum { standardDestination, askDestination }; 84 enum { standardDestination, askDestination };
85 85
86 virtual ~KOPrefs(); 86 virtual ~KOPrefs();
87 87
88 /** Get instance of KOPrefs. It is made sure that there is only one 88 /** Get instance of KOPrefs. It is made sure that there is only one
89 instance. */ 89 instance. */
90 static KOPrefs *instance(); 90 static KOPrefs *instance();
91 91
92 /** Set preferences to default values */ 92 /** Set preferences to default values */
93 void usrSetDefaults(); 93 void usrSetDefaults();
94 94
95 /** Read preferences from config file */ 95 /** Read preferences from config file */
96 void usrReadConfig(); 96 void usrReadConfig();
97 97
98 /** Write preferences to config file */ 98 /** Write preferences to config file */
99 void usrWriteConfig(); 99 void usrWriteConfig();
100 void setCategoryDefaults(); 100 void setCategoryDefaults();
101 void setAllDefaults(); 101 void setAllDefaults();
102 KopiCalendarFile * getNewCalendar(); 102 KopiCalendarFile * getNewCalendar();
103 KopiCalendarFile * getCalendar( int ); 103 KopiCalendarFile * getCalendar( int );
104 void deleteCalendar( int ); 104 void deleteCalendar( int );
105 QColor defaultColor( int ) const; 105 QColor defaultColor( int ) const;
106 QString calName( int ) const; 106 QString calName( int ) const;
107 int getCalendarID( const QString & name ); 107 int getCalendarID( const QString & name );
108 protected: 108 protected:
109 void setTimeZoneIdDefault(); 109 void setTimeZoneIdDefault();
110 110
111 /** Fill empty mail fields with default values. */ 111 /** Fill empty mail fields with default values. */
112 void fillMailDefaults(); 112 void fillMailDefaults();
113 113
114 private: 114 private:
115 /** Constructor disabled for public. Use instance() to create a KOPrefs 115 /** Constructor disabled for public. Use instance() to create a KOPrefs
116 object. */ 116 object. */
117 KOPrefs(); 117 KOPrefs();
118 118
119 static KOPrefs *mInstance; 119 static KOPrefs *mInstance;
120 QStringList getDefaultList(); 120 QStringList getDefaultList();
121 QStringList getLocationDefaultList(); 121 QStringList getLocationDefaultList();
122 public: 122 public:
123 // preferences data 123 // preferences data
124 KConfig* getConfig(); 124 KConfig* getConfig();
125 void setFullName(const QString &); 125 void setFullName(const QString &);
126 QString fullName(); 126 QString fullName();
127 void setEmail(const QString &); 127 void setEmail(const QString &);
128 QString email(); 128 QString email();
129 129
130 QString mAdditional; 130 QString mAdditional;
131 131
132 bool mEmailControlCenter; 132 bool mEmailControlCenter;
133 133
134 bool mBcc; 134 bool mBcc;
135 bool mAutoSave; 135 bool mAutoSave;
136 int mAutoSaveInterval; 136 int mAutoSaveInterval;
137 bool mConfirm; 137 bool mConfirm;
138 138
139 bool mEnableGroupScheduling; 139 bool mEnableGroupScheduling;
140 bool mEnableProjectView; 140 bool mEnableProjectView;
141 141
142 int mDefaultFormat; 142 int mDefaultFormat;
143 int mMailClient; 143 int mMailClient;
144 144
145 int mStartTime; 145 int mStartTime;
146 int mDefaultDuration; 146 int mDefaultDuration;
147 int mAlarmTime; 147 int mAlarmTime;
148 148
149 int mWorkingHoursStart; 149 int mWorkingHoursStart;
150 int mWorkingHoursEnd; 150 int mWorkingHoursEnd;
151 bool mExcludeHolidays; 151 bool mExcludeHolidays;
152 bool mExcludeSaturdays; 152 bool mExcludeSaturdays;
153 bool mMarcusBainsShowSeconds; 153 bool mMarcusBainsShowSeconds;
154 154
155 QFont mTimeBarFont; 155 QFont mTimeBarFont;
156 QFont mMonthViewFont; 156 QFont mMonthViewFont;
157 QFont mAgendaViewFont; 157 QFont mAgendaViewFont;
158 QFont mMarcusBainsFont; 158 QFont mMarcusBainsFont;
159 QFont mTimeLabelsFont; 159 QFont mTimeLabelsFont;
160 QFont mTodoViewFont; 160 QFont mTodoViewFont;
161 QFont mListViewFont; 161 QFont mListViewFont;
162 QFont mDateNavigatorFont; 162 QFont mDateNavigatorFont;
163 QFont mEditBoxFont; 163 QFont mEditBoxFont;
164 QFont mJornalViewFont; 164 QFont mJornalViewFont;
165 QFont mWhatsNextFont; 165 QFont mWhatsNextFont;
166 QFont mEventViewFont; 166 QFont mEventViewFont;
167 167
168 168
169 169
170 170
171 QColor mHolidayColor; 171 QColor mHolidayColor;
172 QColor mHighlightColor; 172 QColor mHighlightColor;
173 QColor mEventColor; 173 QColor mEventColor;
174 QColor mTodoDoneColor; 174 QColor mTodoDoneColor;
175 QColor mAgendaBgColor; 175 QColor mAgendaBgColor;
176 QColor mWorkingHoursColor; 176 QColor mWorkingHoursColor;
177 QColor mTodoDueTodayColor; 177 QColor mTodoDueTodayColor;
178 QColor mTodoOverdueColor; 178 QColor mTodoOverdueColor;
179 QColor mTodoRunColor; 179 QColor mTodoRunColor;
180 QColor mMonthViewEvenColor; 180 QColor mMonthViewEvenColor;
181 QColor mMonthViewOddColor; 181 QColor mMonthViewOddColor;
182 QColor mMonthViewHolidayColor; 182 QColor mMonthViewHolidayColor;
183 bool mMonthViewUsesDayColors; 183 bool mMonthViewUsesDayColors;
184 bool mMonthViewSatSunTog; 184 bool mMonthViewSatSunTog;
185 bool mMonthViewWeek; 185 bool mMonthViewWeek;
186 bool mMonthViewWeekRowlayout; 186 bool mMonthViewWeekRowlayout;
187 QColor mAppColor1; 187 QColor mAppColor1;
188 QColor mAppColor2; 188 QColor mAppColor2;
189 bool mUseAppColors; 189 bool mUseAppColors;
190 190
191 int mDayBegins; 191 int mDayBegins;
192 int mHourSize; 192 int mHourSize;
193 int mAllDaySize; 193 int mAllDaySize;
194 bool mShowFullMenu; 194 bool mShowFullMenu;
195 bool mDailyRecur; 195 bool mDailyRecur;
196 bool mWeeklyRecur; 196 bool mWeeklyRecur;
197 bool mMonthDailyRecur; 197 bool mMonthDailyRecur;
198 bool mMonthWeeklyRecur; 198 bool mMonthWeeklyRecur;
199 bool mMonthShowIcons; 199 bool mMonthShowIcons;
200 bool mMonthShowTimes; 200 bool mMonthShowTimes;
201 bool mMonthShowShort; 201 bool mMonthShowShort;
202 bool mEnableToolTips; 202 bool mEnableToolTips;
203 bool mEnableMonthScroll; 203 bool mEnableMonthScroll;
204 bool mFullViewMonth; 204 bool mFullViewMonth;
205 bool mMonthViewUsesCategoryColor; 205 bool mMonthViewUsesCategoryColor;
206 bool mFullViewTodo; 206 bool mFullViewTodo;
207 bool mShowCompletedTodo; 207 bool mShowCompletedTodo;
208 bool mMarcusBainsEnabled; 208 bool mMarcusBainsEnabled;
209 int mNextXDays; 209 int mNextXDays;
210 int mWhatsNextDays; 210 int mWhatsNextDays;
211 bool mWhatsNextTime2Lines;
211 int mWhatsNextPrios; 212 int mWhatsNextPrios;
212 bool mEnableQuickTodo; 213 bool mEnableQuickTodo;
213 214
214 bool mCompactDialogs; 215 bool mCompactDialogs;
215 bool mVerticalScreen; 216 bool mVerticalScreen;
216 217
217 bool mShowIconNewTodo; 218 bool mShowIconNewTodo;
218 bool mShowIconNewEvent; 219 bool mShowIconNewEvent;
219 bool mShowIconSearch; 220 bool mShowIconSearch;
220 bool mShowIconList; 221 bool mShowIconList;
221 bool mShowIconDay1; 222 bool mShowIconDay1;
222 bool mShowIconDay5; 223 bool mShowIconDay5;
223 bool mShowIconDay6; 224 bool mShowIconDay6;
224 bool mShowIconDay7; 225 bool mShowIconDay7;
225 bool mShowIconMonth; 226 bool mShowIconMonth;
226 bool mShowIconTodoview; 227 bool mShowIconTodoview;
227 bool mShowIconBackFast; 228 bool mShowIconBackFast;
228 bool mShowIconBack; 229 bool mShowIconBack;
229 bool mShowIconToday; 230 bool mShowIconToday;
230 bool mShowIconForward; 231 bool mShowIconForward;
231 bool mShowIconForwardFast; 232 bool mShowIconForwardFast;
232 bool mShowIconWhatsThis; 233 bool mShowIconWhatsThis;
233 bool mShowIconWeekNum; 234 bool mShowIconWeekNum;
234 bool mShowIconNextDays; 235 bool mShowIconNextDays;
235 bool mShowIconNext; 236 bool mShowIconNext;
236 bool mShowIconJournal; 237 bool mShowIconJournal;
237 bool mShowIconFilter; 238 bool mShowIconFilter;
238 bool mShowIconOnetoolbar; 239 bool mShowIconOnetoolbar;
239 bool mShowIconNavigator; 240 bool mShowIconNavigator;
240 bool mShowIconAllday; 241 bool mShowIconAllday;
241 bool mShowIconFilterview; 242 bool mShowIconFilterview;
242 bool mShowIconToggleFull; 243 bool mShowIconToggleFull;
243 244
244 bool mShowIconStretch; 245 bool mShowIconStretch;
245 246
246 bool mToolBarHor; 247 bool mToolBarHor;
247 bool mToolBarUp; 248 bool mToolBarUp;
248 bool mToolBarHorV; 249 bool mToolBarHorV;
249 bool mToolBarUpV; 250 bool mToolBarUpV;
250 bool mToolBarHorN; 251 bool mToolBarHorN;
251 bool mToolBarUpN; 252 bool mToolBarUpN;
252 bool mToolBarHorF; 253 bool mToolBarHorF;
253 bool mToolBarUpF; 254 bool mToolBarUpF;
254 bool mToolBarMiniIcons; 255 bool mToolBarMiniIcons;
255 256
256 bool mAskForQuit; 257 bool mAskForQuit;
257 bool mUsePassWd; 258 bool mUsePassWd;
258 bool mShowSyncEvents; 259 bool mShowSyncEvents;
259 bool mShowTodoInAgenda; 260 bool mShowTodoInAgenda;
260 bool mShowCompletedTodoInAgenda; 261 bool mShowCompletedTodoInAgenda;
261 bool mShowTimeInAgenda; 262 bool mShowTimeInAgenda;
262 bool mHideNonStartedTodos; 263 bool mHideNonStartedTodos;
263 264
264 bool mBlockPopupMenu; 265 bool mBlockPopupMenu;
265 266
266 int mLastSyncTime; 267 int mLastSyncTime;
267 void setCategoryColor(QString cat,const QColor & color); 268 void setCategoryColor(QString cat,const QColor & color);
268 QColor *categoryColor(QString cat); 269 QColor *categoryColor(QString cat);
269 270
270 QString mArchiveFile; 271 QString mArchiveFile;
271 QString mHtmlExportFile; 272 QString mHtmlExportFile;
272 bool mHtmlWithSave; 273 bool mHtmlWithSave;
273 274
274 QStringList mSelectedPlugins; 275 QStringList mSelectedPlugins;
275 276
276 QString mLastImportFile; 277 QString mLastImportFile;
277 QString mLastVcalFile; 278 QString mLastVcalFile;
278 QString mLastSaveFile; 279 QString mLastSaveFile;
279 QString mLastLoadFile; 280 QString mLastLoadFile;
280 281
281 282
282 QString mDefaultAlarmFile; 283 QString mDefaultAlarmFile;
283 int mIMIPScheduler; 284 int mIMIPScheduler;
284 int mIMIPSend; 285 int mIMIPSend;
285 QStringList mAdditionalMails; 286 QStringList mAdditionalMails;
286 int mIMIPAutoRefresh; 287 int mIMIPAutoRefresh;
287 int mIMIPAutoInsertReply; 288 int mIMIPAutoInsertReply;
288 int mIMIPAutoInsertRequest; 289 int mIMIPAutoInsertRequest;
289 int mIMIPAutoFreeBusy; 290 int mIMIPAutoFreeBusy;
290 int mIMIPAutoFreeBusyReply; 291 int mIMIPAutoFreeBusyReply;
291 292
292 QStringList mTodoTemplates; 293 QStringList mTodoTemplates;
293 QStringList mEventTemplates; 294 QStringList mEventTemplates;
294 295
295 int mDestination; 296 int mDestination;
296 297
297 298
298 bool mEditOnDoubleClick; 299 bool mEditOnDoubleClick;
299 bool mViewChangeHoldFullscreen; 300 bool mViewChangeHoldFullscreen;
300 bool mViewChangeHoldNonFullscreen; 301 bool mViewChangeHoldNonFullscreen;
301 bool mCenterOnCurrentTime; 302 bool mCenterOnCurrentTime;
302 bool mSetTimeToDayStartAt; 303 bool mSetTimeToDayStartAt;
303 bool mHighlightCurrentDay; 304 bool mHighlightCurrentDay;
304 bool mUseHighlightLightColor; 305 bool mUseHighlightLightColor;
305 bool mListViewMonthTimespan; 306 bool mListViewMonthTimespan;
306 bool mWNViewShowsParents; 307 bool mWNViewShowsParents;
307 bool mWNViewShowsPast; 308 bool mWNViewShowsPast;
308 bool mWNViewShowLocation; 309 bool mWNViewShowLocation;
309 bool mTodoViewShowsPercentage; 310 bool mTodoViewShowsPercentage;
310 bool mTodoViewUsesCatColors; 311 bool mTodoViewUsesCatColors;
311 bool mMonthViewUsesBigFont; 312 bool mMonthViewUsesBigFont;
312 bool mTodoViewUsesSmallFont; 313 bool mTodoViewUsesSmallFont;
313 bool mTodoViewUsesForegroundColor; 314 bool mTodoViewUsesForegroundColor;
314 bool mMonthViewUsesForegroundColor; 315 bool mMonthViewUsesForegroundColor;
315 316
316 bool mHightlightDateTimeEdit; 317 bool mHightlightDateTimeEdit;
317 bool mShortDateInViewer; 318 bool mShortDateInViewer;
318 319
319 bool mShowDateNavigator; 320 bool mShowDateNavigator;
320 321
321 QStringList mLocationDefaults; 322 QStringList mLocationDefaults;
322 QStringList mEventSummaryUser; 323 QStringList mEventSummaryUser;
323 QStringList mTodoSummaryUser; 324 QStringList mTodoSummaryUser;
324 QStringList mJournalSummaryUser; 325 QStringList mJournalSummaryUser;
325 326
326 bool mUseInternalAlarmNotification; 327 bool mUseInternalAlarmNotification;
327 int mAlarmPlayBeeps; 328 int mAlarmPlayBeeps;
328 int mAlarmSuspendTime; 329 int mAlarmSuspendTime;
329 int mAlarmSuspendCount; 330 int mAlarmSuspendCount;
330 int mAlarmBeepInterval; 331 int mAlarmBeepInterval;
331 int mOldLanguage; 332 int mOldLanguage;
332 int mOldLoadedLanguage; 333 int mOldLoadedLanguage;
333 334
334 335
335 QString mActiveSyncPort; 336 QString mActiveSyncPort;
336 QString mActiveSyncIP; 337 QString mActiveSyncIP;
337 338
338 // settings for eventviewer 339 // settings for eventviewer
339 bool mEVshowDetails; 340 bool mEVshowDetails;
340 bool mEVshowCreated; 341 bool mEVshowCreated;
341 bool mEVshowChanged; 342 bool mEVshowChanged;
342 bool mWTshowDetails; 343 bool mWTshowDetails;
343 bool mWTshowCreated; 344 bool mWTshowCreated;
344 bool mWTshowChanged; 345 bool mWTshowChanged;
345 346
346 int mCurrentDisplayedView; 347 int mCurrentDisplayedView;
347 QPtrList<KopiCalendarFile> mCalendars; 348 QPtrList<KopiCalendarFile> mCalendars;
348 int mNextAvailableCalendar; 349 int mNextAvailableCalendar;
349 bool mGlobalUpdateDisabled; 350 bool mGlobalUpdateDisabled;
350 351
351 private: 352 private:
352 QDict<QColor> mCategoryColors; 353 QDict<QColor> mCategoryColors;
353 QArray<KopiCalendarFile*> mDefCalColors; 354 QArray<KopiCalendarFile*> mDefCalColors;
354 QColor mDefaultCategoryColor; 355 QColor mDefaultCategoryColor;
355 356
356 QFont mDefaultTimeBarFont; 357 QFont mDefaultTimeBarFont;
357 QFont mDefaultViewFont; 358 QFont mDefaultViewFont;
358 QFont mDefaultMonthViewFont; 359 QFont mDefaultMonthViewFont;
359 360
360 QString mName; 361 QString mName;
361 QString mEmail; 362 QString mEmail;
362}; 363};
363 364
364#endif 365#endif
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 05bd73f..9e2378a 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -1,1548 +1,1552 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <qvbox.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <qstrlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44 44
45#include <kcolorbutton.h> 45#include <kcolorbutton.h>
46#include <kdebug.h> 46#include <kdebug.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobal.h> 48#include <kglobal.h>
49#include <kfontdialog.h> 49#include <kfontdialog.h>
50#include <kfiledialog.h> 50#include <kfiledialog.h>
51#include <kmessagebox.h> 51#include <kmessagebox.h>
52#include <kcolordialog.h> 52#include <kcolordialog.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54#include <kemailsettings.h> 54#include <kemailsettings.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56#include <kglobalsettings.h> 56#include <kglobalsettings.h>
57 57
58#include <kurlrequester.h> 58#include <kurlrequester.h>
59#include <klineedit.h> 59#include <klineedit.h>
60 60
61#if defined(USE_SOLARIS) 61#if defined(USE_SOLARIS)
62#include <sys/param.h> 62#include <sys/param.h>
63 63
64#define ZONEINFODIR "/usr/share/lib/zoneinfo" 64#define ZONEINFODIR "/usr/share/lib/zoneinfo"
65#define INITFILE "/etc/default/init" 65#define INITFILE "/etc/default/init"
66#endif 66#endif
67 67
68#include "koprefs.h" 68#include "koprefs.h"
69 69
70#include "koprefsdialog.h" 70#include "koprefsdialog.h"
71#include "kpimglobalprefs.h" 71#include "kpimglobalprefs.h"
72 72
73 73
74KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 74KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
75 KPrefsDialog(KOPrefs::instance(),parent,name,true) 75 KPrefsDialog(KOPrefs::instance(),parent,name,true)
76{ 76{
77 77
78 setFont( KGlobalSettings::generalMaxFont() ); 78 setFont( KGlobalSettings::generalMaxFont() );
79 setCaption( i18n("Preferences - some settings need a restart (nr)")); 79 setCaption( i18n("Preferences - some settings need a restart (nr)"));
80 mCategoryDict.setAutoDelete(true); 80 mCategoryDict.setAutoDelete(true);
81 81
82 KGlobal::locale()->insertCatalogue("timezones"); 82 KGlobal::locale()->insertCatalogue("timezones");
83 mSpacingHint = spacingHintSmall(); 83 mSpacingHint = spacingHintSmall();
84 mMarginHint = marginHintSmall(); 84 mMarginHint = marginHintSmall();
85#ifndef DESKTOP_VERSION 85#ifndef DESKTOP_VERSION
86 if ( QApplication::desktop()->height() == 480 ) 86 if ( QApplication::desktop()->height() == 480 )
87 hideButtons(); 87 hideButtons();
88#endif 88#endif
89 89
90 setupMainTab(); 90 setupMainTab();
91 // setupLocaleTab(); 91 // setupLocaleTab();
92 //setupTimeZoneTab(); 92 //setupTimeZoneTab();
93 setupTimeTab(); 93 setupTimeTab();
94 //setupLocaleDateTab(); 94 //setupLocaleDateTab();
95 setupFontsTab(); 95 setupFontsTab();
96 setupColorsTab(); 96 setupColorsTab();
97 setupViewsTab(); 97 setupViewsTab();
98 //setupSyncTab(); 98 //setupSyncTab();
99 //setupSyncAlgTab(); 99 //setupSyncAlgTab();
100 //setupPrinterTab(); 100 //setupPrinterTab();
101 //setupGroupSchedulingTab(); 101 //setupGroupSchedulingTab();
102 //setupGroupAutomationTab(); 102 //setupGroupAutomationTab();
103 103
104 104
105} 105}
106 106
107 107
108KOPrefsDialog::~KOPrefsDialog() 108KOPrefsDialog::~KOPrefsDialog()
109{ 109{
110} 110}
111void KOPrefsDialog::setupGlobalTab() 111void KOPrefsDialog::setupGlobalTab()
112{ 112{
113 113
114 114
115} 115}
116void KOPrefsDialog::setupLocaleDateTab() 116void KOPrefsDialog::setupLocaleDateTab()
117{ 117{
118#if 0 118#if 0
119QFrame *topFrame = addPage(i18n("Date Format"),0,0); 119QFrame *topFrame = addPage(i18n("Date Format"),0,0);
120 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 120 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
121 topLayout->setSpacing(mSpacingHint); 121 topLayout->setSpacing(mSpacingHint);
122 topLayout->setMargin(mMarginHint); 122 topLayout->setMargin(mMarginHint);
123 int iii = 0; 123 int iii = 0;
124 124
125 125
126 KPrefsDialogWidRadios *syncPrefsGroup = 126 KPrefsDialogWidRadios *syncPrefsGroup =
127 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 127 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
128 QString format; 128 QString format;
129 if ( QApplication::desktop()->width() < 480 ) 129 if ( QApplication::desktop()->width() < 480 )
130 format = "(%d.%m.%Y)"; 130 format = "(%d.%m.%Y)";
131 else 131 else
132 format = "(%d.%m.%Y|%A %d %B %Y)"; 132 format = "(%d.%m.%Y|%A %d %B %Y)";
133 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 133 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
134 if ( QApplication::desktop()->width() < 480 ) 134 if ( QApplication::desktop()->width() < 480 )
135 format = "(%m.%d.%Y)"; 135 format = "(%m.%d.%Y)";
136 else 136 else
137 format = "(%m.%d.%Y|%A %B %d %Y)"; 137 format = "(%m.%d.%Y|%A %B %d %Y)";
138 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 138 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
139 if ( QApplication::desktop()->width() < 480 ) 139 if ( QApplication::desktop()->width() < 480 )
140 format = "(%Y-%m-%d)"; 140 format = "(%Y-%m-%d)";
141 else 141 else
142 format = "(%Y-%m-%d|%A %Y %B %d)"; 142 format = "(%Y-%m-%d|%A %Y %B %d)";
143 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 143 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
144 syncPrefsGroup->addRadio(i18n("User defined")); 144 syncPrefsGroup->addRadio(i18n("User defined"));
145 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 145 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
146 ++iii; 146 ++iii;
147 ++iii; 147 ++iii;
148 QLabel * lab; 148 QLabel * lab;
149 mUserDateFormatLong = new QLineEdit(topFrame); 149 mUserDateFormatLong = new QLineEdit(topFrame);
150 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 150 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
151 topLayout->addWidget(lab ,iii,0); 151 topLayout->addWidget(lab ,iii,0);
152 topLayout->addWidget(mUserDateFormatLong,iii,1); 152 topLayout->addWidget(mUserDateFormatLong,iii,1);
153 ++iii; 153 ++iii;
154 mUserDateFormatShort = new QLineEdit(topFrame); 154 mUserDateFormatShort = new QLineEdit(topFrame);
155 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 155 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
156 topLayout->addWidget(lab ,iii,0); 156 topLayout->addWidget(lab ,iii,0);
157 topLayout->addWidget(mUserDateFormatShort,iii,1); 157 topLayout->addWidget(mUserDateFormatShort,iii,1);
158 ++iii; 158 ++iii;
159 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 159 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
160 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 160 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
161 ++iii; 161 ++iii;
162 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 162 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
163 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 163 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
164 ++iii; 164 ++iii;
165 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 165 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
166 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 166 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
167 ++iii; 167 ++iii;
168#endif 168#endif
169 169
170} 170}
171 171
172void KOPrefsDialog::setupLocaleTab() 172void KOPrefsDialog::setupLocaleTab()
173{ 173{
174#if 0 174#if 0
175 QFrame *topFrame = addPage(i18n("Locale"),0,0); 175 QFrame *topFrame = addPage(i18n("Locale"),0,0);
176 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 176 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
177 topLayout->setSpacing(mSpacingHint); 177 topLayout->setSpacing(mSpacingHint);
178 topLayout->setMargin(mMarginHint); 178 topLayout->setMargin(mMarginHint);
179 int iii = 0; 179 int iii = 0;
180 KPrefsDialogWidRadios *syncPrefsGroup = 180 KPrefsDialogWidRadios *syncPrefsGroup =
181 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 181 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
182 syncPrefsGroup->addRadio(i18n("English")); 182 syncPrefsGroup->addRadio(i18n("English"));
183 syncPrefsGroup->addRadio(i18n("German")); 183 syncPrefsGroup->addRadio(i18n("German"));
184 syncPrefsGroup->addRadio(i18n("French")); 184 syncPrefsGroup->addRadio(i18n("French"));
185 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 185 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
186 if ( QApplication::desktop()->width() < 300 ) 186 if ( QApplication::desktop()->width() < 300 )
187 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 187 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
188 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 188 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
189 ++iii; 189 ++iii;
190 190
191 syncPrefsGroup = 191 syncPrefsGroup =
192 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); 192 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
193 if ( QApplication::desktop()->width() > 300 ) 193 if ( QApplication::desktop()->width() > 300 )
194 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 194 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
195 syncPrefsGroup->addRadio(i18n("24:00")); 195 syncPrefsGroup->addRadio(i18n("24:00"));
196 syncPrefsGroup->addRadio(i18n("12:00am")); 196 syncPrefsGroup->addRadio(i18n("12:00am"));
197 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 197 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
198 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 198 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
199 ++iii; 199 ++iii;
200 KPrefsDialogWidBool *sb; 200 KPrefsDialogWidBool *sb;
201 if ( QApplication::desktop()->width() < 300 ) { 201 if ( QApplication::desktop()->width() < 300 ) {
202 sb = 202 sb =
203 addWidBool(i18n("Week starts on Sunday"), 203 addWidBool(i18n("Week starts on Sunday"),
204 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 204 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
205 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 205 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
206 ++iii; 206 ++iii;
207 sb = 207 sb =
208 addWidBool(i18n("Use short date in (WN/E) view"), 208 addWidBool(i18n("Use short date in (WN/E) view"),
209 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 209 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
210 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 210 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
211 } 211 }
212 else { 212 else {
213 QWidget * hb = new QWidget( topFrame ); 213 QWidget * hb = new QWidget( topFrame );
214 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 214 QHBoxLayout *hbLayout = new QHBoxLayout(hb);
215 sb = 215 sb =
216 addWidBool(i18n("Week starts on Sunday"), 216 addWidBool(i18n("Week starts on Sunday"),
217 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 217 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
218 hbLayout->addWidget(sb->checkBox() ); 218 hbLayout->addWidget(sb->checkBox() );
219 sb = 219 sb =
220 addWidBool(i18n("Use short date in (WN/E) view"), 220 addWidBool(i18n("Use short date in (WN/E) view"),
221 &(KOPrefs::instance()->mShortDateInViewer),hb); 221 &(KOPrefs::instance()->mShortDateInViewer),hb);
222 hbLayout->addWidget(sb->checkBox() ); 222 hbLayout->addWidget(sb->checkBox() );
223 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 223 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
224 224
225 } 225 }
226 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION 226 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
227#if 0 227#if 0
228 ++iii; 228 ++iii;
229 sb = 229 sb =
230 addWidBool(i18n("Quick load/save (w/o Unicode)"), 230 addWidBool(i18n("Quick load/save (w/o Unicode)"),
231 &(KOPrefs::instance()->mUseQuicksave),topFrame); 231 &(KOPrefs::instance()->mUseQuicksave),topFrame);
232 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 232 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
233#endif 233#endif
234#endif 234#endif
235} 235}
236 236
237void KOPrefsDialog::setupMainTab() 237void KOPrefsDialog::setupMainTab()
238{ 238{
239 QFrame *topFrame = addPage(i18n("General"),0,0); 239 QFrame *topFrame = addPage(i18n("General"),0,0);
240 // DesktopIcon("identity",KIcon::SizeMedium)); 240 // DesktopIcon("identity",KIcon::SizeMedium));
241 241
242 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 242 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
243 topLayout->setSpacing(mSpacingHint); 243 topLayout->setSpacing(mSpacingHint);
244 topLayout->setMargin(mMarginHint); 244 topLayout->setMargin(mMarginHint);
245 245
246 // KPrefsDialogWidBool *emailControlCenter = 246 // KPrefsDialogWidBool *emailControlCenter =
247// addWidBool(i18n("&Use email settings from Control Center"), 247// addWidBool(i18n("&Use email settings from Control Center"),
248// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 248// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
249// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 249// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
250 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 250 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
251 // SLOT(toggleEmailSettings(bool))); 251 // SLOT(toggleEmailSettings(bool)));
252 252
253 mNameEdit = new QLineEdit(topFrame); 253 mNameEdit = new QLineEdit(topFrame);
254 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 254 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
255 topLayout->addWidget(mNameLabel,0,0); 255 topLayout->addWidget(mNameLabel,0,0);
256 topLayout->addWidget(mNameEdit,0,1); 256 topLayout->addWidget(mNameEdit,0,1);
257 257
258 mEmailEdit = new QLineEdit(topFrame); 258 mEmailEdit = new QLineEdit(topFrame);
259 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 259 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
260 topLayout->addWidget(mEmailLabel,1,0); 260 topLayout->addWidget(mEmailLabel,1,0);
261 topLayout->addWidget(mEmailEdit,1,1); 261 topLayout->addWidget(mEmailEdit,1,1);
262 KPrefsDialogWidBool *wb; 262 KPrefsDialogWidBool *wb;
263 263
264 264
265 265
266 KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"), 266 KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"),
267 &(KOPrefs::instance()->mShowFullMenu),topFrame); 267 &(KOPrefs::instance()->mShowFullMenu),topFrame);
268 topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1); 268 topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1);
269 269
270 270
271 widbool = addWidBool(i18n("Mini icons in toolbar(nr)"), 271 widbool = addWidBool(i18n("Mini icons in toolbar(nr)"),
272 &(KOPrefs::instance()->mToolBarMiniIcons),topFrame); 272 &(KOPrefs::instance()->mToolBarMiniIcons),topFrame);
273 topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1); 273 topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1);
274 274
275 275
276 KPrefsDialogWidBool *verticalScreen = 276 KPrefsDialogWidBool *verticalScreen =
277 addWidBool(i18n("Vertical screen layout(Needs restart)"), 277 addWidBool(i18n("Vertical screen layout(Needs restart)"),
278 &(KOPrefs::instance()->mVerticalScreen),topFrame); 278 &(KOPrefs::instance()->mVerticalScreen),topFrame);
279 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); 279 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
280 topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); 280 topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1);
281 281
282 282
283 int iii = 5; 283 int iii = 5;
284 widbool = addWidBool(i18n("Block popup until mouse button release"), 284 widbool = addWidBool(i18n("Block popup until mouse button release"),
285 &(KOPrefs::instance()->mBlockPopupMenu),topFrame); 285 &(KOPrefs::instance()->mBlockPopupMenu),topFrame);
286 topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1); 286 topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1);
287 ++iii; 287 ++iii;
288 if ( QApplication::desktop()->height() <= 240 ) { 288 if ( QApplication::desktop()->height() <= 240 ) {
289 topFrame = addPage(i18n("General") +" 2",0,0); 289 topFrame = addPage(i18n("General") +" 2",0,0);
290 topLayout = new QGridLayout(topFrame,4,2); 290 topLayout = new QGridLayout(topFrame,4,2);
291 topLayout->setSpacing(2); 291 topLayout->setSpacing(2);
292 topLayout->setMargin(3); 292 topLayout->setMargin(3);
293 iii = 0; 293 iii = 0;
294 } 294 }
295 QHBox *dummy = new QHBox(topFrame); 295 QHBox *dummy = new QHBox(topFrame);
296 new QLabel(i18n("Days in Next-X-Days:"),dummy); 296 new QLabel(i18n("Days in Next-X-Days:"),dummy);
297 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 297 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
298 298
299 topLayout->addMultiCellWidget(dummy,iii,iii,0,1); 299 topLayout->addMultiCellWidget(dummy,iii,iii,0,1);
300 300
301 ++iii; 301 ++iii;
302 302
303 303
304 // KPrefsDialogWidBool *bcc = 304 // KPrefsDialogWidBool *bcc =
305// addWidBool(i18n("Send copy to owner when mailing events"), 305// addWidBool(i18n("Send copy to owner when mailing events"),
306// &(KOPrefs::instance()->mBcc),topFrame); 306// &(KOPrefs::instance()->mBcc),topFrame);
307// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 307// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
308 308
309 309
310 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 310 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
311 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 311 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
312 312
313 // addWidBool(i18n("Enable automatic saving of calendar"), 313 // addWidBool(i18n("Enable automatic saving of calendar"),
314 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 314 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
315 315
316 QHBox *intervalBox = new QHBox(topFrame); 316 QHBox *intervalBox = new QHBox(topFrame);
317 // intervalBox->setSpacing(mSpacingHint); 317 // intervalBox->setSpacing(mSpacingHint);
318 topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1); 318 topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1);
319 ++iii; 319 ++iii;
320 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 320 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
321 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 321 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
322 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 322 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
323 /* 323 /*
324 QHBox * agendasize = new QHBox ( topFrame ); 324 QHBox * agendasize = new QHBox ( topFrame );
325 325
326 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 326 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
327 327
328 328
329 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 329 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
330 topLayout->addMultiCellWidget(agendasize,7,7,0,1); 330 topLayout->addMultiCellWidget(agendasize,7,7,0,1);
331 */ 331 */
332 332
333 333
334 KPrefsDialogWidBool *ask = 334 KPrefsDialogWidBool *ask =
335 addWidBool(i18n("Ask for quit when closing KO/Pi"), 335 addWidBool(i18n("Ask for quit when closing KO/Pi"),
336 &(KOPrefs::instance()->mAskForQuit),topFrame); 336 &(KOPrefs::instance()->mAskForQuit),topFrame);
337 topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1); 337 topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1);
338 ++iii; 338 ++iii;
339 339
340 340
341 /* 341 /*
342 KPrefsDialogWidBool *confirmCheck = 342 KPrefsDialogWidBool *confirmCheck =
343 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), 343 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm),
344 topFrame); 344 topFrame);
345 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); 345 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
346 346
347 347
348 mEnableGroupScheduling = 348 mEnableGroupScheduling =
349 addWidBool(i18n("Enable group scheduling"), 349 addWidBool(i18n("Enable group scheduling"),
350 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); 350 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
351 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); 351 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
352 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), 352 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
353 SLOT(warningGroupScheduling())); 353 SLOT(warningGroupScheduling()));
354 354
355 mEnableProjectView = 355 mEnableProjectView =
356 addWidBool(i18n("Enable project view"), 356 addWidBool(i18n("Enable project view"),
357 &(KOPrefs::instance()->mEnableProjectView),topFrame); 357 &(KOPrefs::instance()->mEnableProjectView),topFrame);
358 topLayout->addWidget(mEnableProjectView->checkBox(),9,0); 358 topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
359 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), 359 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
360 SLOT(warningProjectView())); 360 SLOT(warningProjectView()));
361 361
362 // Can't be disabled anymore 362 // Can't be disabled anymore
363 mEnableGroupScheduling->checkBox()->hide(); 363 mEnableGroupScheduling->checkBox()->hide();
364 364
365 // Disable setting, because this feature now becomes stable 365 // Disable setting, because this feature now becomes stable
366 mEnableProjectView->checkBox()->hide(); 366 mEnableProjectView->checkBox()->hide();
367 367
368 KPrefsDialogWidRadios *defaultFormatGroup = 368 KPrefsDialogWidRadios *defaultFormatGroup =
369 addWidRadios(i18n("Default Calendar Format"), 369 addWidRadios(i18n("Default Calendar Format"),
370 &(KOPrefs::instance()->mDefaultFormat),topFrame); 370 &(KOPrefs::instance()->mDefaultFormat),topFrame);
371 defaultFormatGroup->addRadio(i18n("vCalendar")); 371 defaultFormatGroup->addRadio(i18n("vCalendar"));
372 defaultFormatGroup->addRadio(i18n("iCalendar")); 372 defaultFormatGroup->addRadio(i18n("iCalendar"));
373 373
374 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); 374 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1);
375 375
376 // Default format unconditionally is iCalendar 376 // Default format unconditionally is iCalendar
377 defaultFormatGroup->groupBox()->hide(); 377 defaultFormatGroup->groupBox()->hide();
378 378
379 KPrefsDialogWidRadios *mailClientGroup = 379 KPrefsDialogWidRadios *mailClientGroup =
380 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), 380 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient),
381 topFrame); 381 topFrame);
382 mailClientGroup->addRadio(i18n("KMail")); 382 mailClientGroup->addRadio(i18n("KMail"));
383 mailClientGroup->addRadio(i18n("Sendmail")); 383 mailClientGroup->addRadio(i18n("Sendmail"));
384 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); 384 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1);
385 385
386 KPrefsDialogWidBool *htmlsave = 386 KPrefsDialogWidBool *htmlsave =
387 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), 387 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave),
388 topFrame); 388 topFrame);
389 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); 389 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1);
390 390
391 KPrefsDialogWidRadios *destinationGroup = 391 KPrefsDialogWidRadios *destinationGroup =
392 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), 392 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination),
393 topFrame); 393 topFrame);
394 destinationGroup->addRadio(i18n("be added to the standard resource")); 394 destinationGroup->addRadio(i18n("be added to the standard resource"));
395 destinationGroup->addRadio(i18n("be asked which resource to use")); 395 destinationGroup->addRadio(i18n("be asked which resource to use"));
396 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 396 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
397 397
398 topLayout->setRowStretch(14,1); 398 topLayout->setRowStretch(14,1);
399 */ 399 */
400} 400}
401 401
402 402
403void KOPrefsDialog::setupTimeTab() 403void KOPrefsDialog::setupTimeTab()
404{ 404{
405 QFrame *topFrame = addPage(i18n("Time"),0,0); 405 QFrame *topFrame = addPage(i18n("Time"),0,0);
406 // DesktopIcon("clock",KIcon::SizeMedium)); 406 // DesktopIcon("clock",KIcon::SizeMedium));
407 407
408 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 408 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
409 topLayout->setSpacing(mSpacingHint); 409 topLayout->setSpacing(mSpacingHint);
410 topLayout->setMargin(mMarginHint); 410 topLayout->setMargin(mMarginHint);
411 411
412 QHBox *dummy = new QHBox(topFrame); 412 QHBox *dummy = new QHBox(topFrame);
413 KPrefsDialogWidTime *dayBegins = 413 KPrefsDialogWidTime *dayBegins =
414 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 414 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
415 dummy); 415 dummy);
416 //topLayout->addWidget(dayBegins->label(),2,0); 416 //topLayout->addWidget(dayBegins->label(),2,0);
417 417
418 //topLayout->addWidget(dayBegins->spinBox(),2,1); 418 //topLayout->addWidget(dayBegins->spinBox(),2,1);
419 topLayout->addMultiCellWidget(dummy,0,0,0,1); 419 topLayout->addMultiCellWidget(dummy,0,0,0,1);
420 420
421 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 421 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
422 topFrame),1,0); 422 topFrame),1,0);
423 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 423 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
424 mStartTimeSpin->setSuffix(":00"); 424 mStartTimeSpin->setSuffix(":00");
425 topLayout->addWidget(mStartTimeSpin,1,1); 425 topLayout->addWidget(mStartTimeSpin,1,1);
426 426
427 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), 427 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
428 topFrame),2,0); 428 topFrame),2,0);
429 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); 429 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
430 mDefaultDurationSpin->setSuffix(":00"); 430 mDefaultDurationSpin->setSuffix(":00");
431 topLayout->addWidget(mDefaultDurationSpin,2,1); 431 topLayout->addWidget(mDefaultDurationSpin,2,1);
432 432
433 QStringList alarmList; 433 QStringList alarmList;
434 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 434 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
435 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 435 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
436 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 436 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
437 3,0); 437 3,0);
438 mAlarmTimeCombo = new QComboBox(topFrame); 438 mAlarmTimeCombo = new QComboBox(topFrame);
439 mAlarmTimeCombo->insertStringList(alarmList); 439 mAlarmTimeCombo->insertStringList(alarmList);
440 topLayout->addWidget(mAlarmTimeCombo,3,1); 440 topLayout->addWidget(mAlarmTimeCombo,3,1);
441 int iii = 4; 441 int iii = 4;
442 if ( QApplication::desktop()->height() <= 240 ) { 442 if ( QApplication::desktop()->height() <= 240 ) {
443 topFrame = addPage(i18n("Time") +" 2",0,0); 443 topFrame = addPage(i18n("Time") +" 2",0,0);
444 topLayout = new QGridLayout(topFrame,1,2); 444 topLayout = new QGridLayout(topFrame,1,2);
445 topLayout->setSpacing(2); 445 topLayout->setSpacing(2);
446 topLayout->setMargin(3); 446 topLayout->setMargin(3);
447 iii = 0; 447 iii = 0;
448 } 448 }
449 449
450 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 450 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
451 i18n("Working Hours"), 451 i18n("Working Hours"),
452 topFrame); 452 topFrame);
453 topLayout->addMultiCellWidget(workingHoursGroup,iii,iii,0,1); 453 topLayout->addMultiCellWidget(workingHoursGroup,iii,iii,0,1);
454 workingHoursGroup->layout()->setSpacing( 0 ); 454 workingHoursGroup->layout()->setSpacing( 0 );
455 workingHoursGroup->layout()->setMargin( 4 ); 455 workingHoursGroup->layout()->setMargin( 4 );
456 QHBox *workStartBox = new QHBox(workingHoursGroup); 456 QHBox *workStartBox = new QHBox(workingHoursGroup);
457 // workStartBox->setMargin( 0 ); 457 // workStartBox->setMargin( 0 );
458 addWidTime(i18n("Daily starting hour:"), 458 addWidTime(i18n("Daily starting hour:"),
459 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 459 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
460 460
461 QHBox *workEndBox = new QHBox(workingHoursGroup); 461 QHBox *workEndBox = new QHBox(workingHoursGroup);
462 //workEndBox->setMargin( 0 ); 462 //workEndBox->setMargin( 0 );
463 addWidTime(i18n("Daily ending hour:"), 463 addWidTime(i18n("Daily ending hour:"),
464 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 464 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
465 QVBox *excludeBox = new QVBox(workingHoursGroup); 465 QVBox *excludeBox = new QVBox(workingHoursGroup);
466 //excludeBox->setMargin( 0 ); 466 //excludeBox->setMargin( 0 );
467 addWidBool(i18n("Exclude holidays"), 467 addWidBool(i18n("Exclude holidays"),
468 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 468 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
469 469
470 addWidBool(i18n("Exclude Saturdays"), 470 addWidBool(i18n("Exclude Saturdays"),
471 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 471 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
472 472
473// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 473// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
474 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 474 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
475 // topFrame); 475 // topFrame);
476// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 476// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
477 477
478 // topLayout->setRowStretch(6,1); 478 // topLayout->setRowStretch(6,1);
479} 479}
480 480
481 481
482void KOPrefsDialog::setupViewsTab() 482void KOPrefsDialog::setupViewsTab()
483{ 483{
484 484
485 QFrame *topFrame = addPage(i18n("Views"),0,0); 485 QFrame *topFrame = addPage(i18n("Views"),0,0);
486 // DesktopIcon("viewmag",KIcon::SizeMedium)); 486 // DesktopIcon("viewmag",KIcon::SizeMedium));
487 487
488 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 488 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
489 topLayout->setSpacing(mSpacingHint); 489 topLayout->setSpacing(mSpacingHint);
490 topLayout->setMargin(mMarginHint); 490 topLayout->setMargin(mMarginHint);
491 491
492// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 492// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
493// topLayout->addLayout(dayBeginsLayout,0,0); 493// topLayout->addLayout(dayBeginsLayout,0,0);
494 494
495// KPrefsDialogWidTime *dayBegins = 495// KPrefsDialogWidTime *dayBegins =
496// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 496// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
497// topFrame); 497// topFrame);
498// dayBeginsLayout->addWidget(dayBegins->label()); 498// dayBeginsLayout->addWidget(dayBegins->label());
499// dayBeginsLayout->addStretch(1); 499// dayBeginsLayout->addStretch(1);
500// dayBeginsLayout->addWidget(dayBegins->spinBox()); 500// dayBeginsLayout->addWidget(dayBegins->spinBox());
501 501
502// QBoxLayout *nextDaysLayout = new QHBoxLayout; 502// QBoxLayout *nextDaysLayout = new QHBoxLayout;
503// topLayout->addLayout(nextDaysLayout,1,0); 503// topLayout->addLayout(nextDaysLayout,1,0);
504// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 504// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
505// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 505// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
506// nextDaysLayout->addStretch(1); 506// nextDaysLayout->addStretch(1);
507// nextDaysLayout->addWidget(mNextXDaysSpin); 507// nextDaysLayout->addWidget(mNextXDaysSpin);
508 508
509 509
510 int ii = 0; 510 int ii = 0;
511 KPrefsDialogWidBool *dummy = 511 KPrefsDialogWidBool *dummy =
512 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 512 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
513 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 513 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
514 topLayout->addWidget(dummy->checkBox(),ii++,0); 514 topLayout->addWidget(dummy->checkBox(),ii++,0);
515 515
516 516
517 517
518 518
519 519
520 520
521 // topLayout->addWidget(hourSizeGroup,ii++,0); 521 // topLayout->addWidget(hourSizeGroup,ii++,0);
522 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 522 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
523 //topLayout->setRowStretch(11,1); 523 //topLayout->setRowStretch(11,1);
524 524
525 525
526 526
527 527
528#if 0 528#if 0
529 529
530 topFrame = addPage(i18n("ViewChange"),0,0); 530 topFrame = addPage(i18n("ViewChange"),0,0);
531 // DesktopIcon("viewmag",KIcon::SizeMedium)); 531 // DesktopIcon("viewmag",KIcon::SizeMedium));
532 532
533 topLayout = new QGridLayout(topFrame,6,1); 533 topLayout = new QGridLayout(topFrame,6,1);
534 topLayout->setSpacing(mSpacingHint); 534 topLayout->setSpacing(mSpacingHint);
535 topLayout->setMargin(mMarginHint); 535 topLayout->setMargin(mMarginHint);
536 ii = 0; 536 ii = 0;
537 537
538#endif 538#endif
539 539
540 dummy = 540 dummy =
541 addWidBool(i18n("Hold fullscreen on view change"), 541 addWidBool(i18n("Hold fullscreen on view change"),
542 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 542 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
543 topLayout->addWidget(dummy->checkBox(),ii++,0); 543 topLayout->addWidget(dummy->checkBox(),ii++,0);
544 544
545 dummy = 545 dummy =
546 addWidBool(i18n("Hold non-fullscreen on view change"), 546 addWidBool(i18n("Hold non-fullscreen on view change"),
547 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 547 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
548 topLayout->addWidget(dummy->checkBox(),ii++,0); 548 topLayout->addWidget(dummy->checkBox(),ii++,0);
549 549
550 550
551 551
552 KPrefsDialogWidBool *fullViewMonth = 552 KPrefsDialogWidBool *fullViewMonth =
553 addWidBool(i18n("Next days view uses full window"), 553 addWidBool(i18n("Next days view uses full window"),
554 &(KOPrefs::instance()->mFullViewMonth),topFrame); 554 &(KOPrefs::instance()->mFullViewMonth),topFrame);
555 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 555 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
556 556
557 557
558 KPrefsDialogWidBool *fullViewTodo = 558 KPrefsDialogWidBool *fullViewTodo =
559 addWidBool(i18n("Event list view uses full window"), 559 addWidBool(i18n("Event list view uses full window"),
560 &(KOPrefs::instance()->mFullViewTodo),topFrame); 560 &(KOPrefs::instance()->mFullViewTodo),topFrame);
561 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 561 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
562 dummy = 562 dummy =
563 addWidBool(i18n("Listview uses monthly timespan"), 563 addWidBool(i18n("Listview uses monthly timespan"),
564 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 564 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
565 topLayout->addWidget(dummy->checkBox(),ii++,0); 565 topLayout->addWidget(dummy->checkBox(),ii++,0);
566 dummy = 566 dummy =
567 addWidBool(i18n("Highlight selection in Time Edit"), 567 addWidBool(i18n("Highlight selection in Time Edit"),
568 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 568 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
569 topLayout->addWidget( dummy->checkBox(), ii++,0); 569 topLayout->addWidget( dummy->checkBox(), ii++,0);
570 570
571 KPrefsDialogWidBool *dailyRecur = 571 KPrefsDialogWidBool *dailyRecur =
572 addWidBool(i18n("Show events that recur daily in date nav."), 572 addWidBool(i18n("Show events that recur daily in date nav."),
573 &(KOPrefs::instance()->mDailyRecur),topFrame); 573 &(KOPrefs::instance()->mDailyRecur),topFrame);
574 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 574 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
575 575
576 KPrefsDialogWidBool *weeklyRecur = 576 KPrefsDialogWidBool *weeklyRecur =
577 addWidBool(i18n("Show ev. that recur weekly in date nav."), 577 addWidBool(i18n("Show ev. that recur weekly in date nav."),
578 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 578 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
579 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 579 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
580 580
581#ifdef DESKTOP_VERSION 581#ifdef DESKTOP_VERSION
582 KPrefsDialogWidBool *enableToolTips = 582 KPrefsDialogWidBool *enableToolTips =
583 addWidBool(i18n("Enable tooltips displaying summary of ev."), 583 addWidBool(i18n("Enable tooltips displaying summary of ev."),
584 &(KOPrefs::instance()->mEnableToolTips),topFrame); 584 &(KOPrefs::instance()->mEnableToolTips),topFrame);
585 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 585 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
586#endif 586#endif
587 // ********************************************************* 587 // *********************************************************
588 588
589 topFrame = addPage(i18n("Agenda View"),0,0); 589 topFrame = addPage(i18n("Agenda View"),0,0);
590 // DesktopIcon("viewmag",KIcon::SizeMedium)); 590 // DesktopIcon("viewmag",KIcon::SizeMedium));
591 591
592 topLayout = new QGridLayout(topFrame,5,1); 592 topLayout = new QGridLayout(topFrame,5,1);
593 topLayout->setSpacing(mSpacingHint); 593 topLayout->setSpacing(mSpacingHint);
594 topLayout->setMargin(mMarginHint); 594 topLayout->setMargin(mMarginHint);
595 ii = 0; 595 ii = 0;
596 596
597 597
598 dummy = 598 dummy =
599 addWidBool(i18n("Show time in agenda items"), 599 addWidBool(i18n("Show time in agenda items"),
600 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); 600 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
601 topLayout->addWidget(dummy->checkBox(),ii++,0); 601 topLayout->addWidget(dummy->checkBox(),ii++,0);
602 602
603 dummy = 603 dummy =
604 addWidBool(i18n("Highlight current day in agenda"), 604 addWidBool(i18n("Highlight current day in agenda"),
605 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 605 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
606 topLayout->addWidget(dummy->checkBox(),ii++,0); 606 topLayout->addWidget(dummy->checkBox(),ii++,0);
607 607
608 dummy = 608 dummy =
609 addWidBool(i18n("Use light color for highlight current day"), 609 addWidBool(i18n("Use light color for highlight current day"),
610 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 610 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
611 topLayout->addWidget(dummy->checkBox(),ii++,0); 611 topLayout->addWidget(dummy->checkBox(),ii++,0);
612 612
613 613
614 KPrefsDialogWidBool *marcusBainsEnabled = 614 KPrefsDialogWidBool *marcusBainsEnabled =
615 addWidBool(i18n("Show current time"), 615 addWidBool(i18n("Show current time"),
616 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 616 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
617 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 617 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
618 618
619 619
620 dummy = 620 dummy =
621 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 621 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
622 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 622 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
623 topLayout->addWidget(dummy->checkBox(),ii++,0); 623 topLayout->addWidget(dummy->checkBox(),ii++,0);
624 624
625 dummy = 625 dummy =
626 addWidBool(i18n("Set agenda to current time on change"), 626 addWidBool(i18n("Set agenda to current time on change"),
627 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 627 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
628 topLayout->addWidget(dummy->checkBox(),ii++,0); 628 topLayout->addWidget(dummy->checkBox(),ii++,0);
629 629
630 630
631 dummy = 631 dummy =
632 addWidBool(i18n("Allday Agenda view shows todos"), 632 addWidBool(i18n("Allday Agenda view shows todos"),
633 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 633 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
634 topLayout->addWidget(dummy->checkBox(),ii++,0); 634 topLayout->addWidget(dummy->checkBox(),ii++,0);
635 635
636 636
637 637
638 dummy = 638 dummy =
639 addWidBool(i18n("Agenda view shows completed todos"), 639 addWidBool(i18n("Agenda view shows completed todos"),
640 &(KOPrefs::instance()->mShowCompletedTodoInAgenda),topFrame); 640 &(KOPrefs::instance()->mShowCompletedTodoInAgenda),topFrame);
641 topLayout->addWidget(dummy->checkBox(),ii++,0); 641 topLayout->addWidget(dummy->checkBox(),ii++,0);
642 642
643 643
644 644
645 645
646 646
647 topFrame = addPage(i18n("Month View"),0,0); 647 topFrame = addPage(i18n("Month View"),0,0);
648 // DesktopIcon("viewmag",KIcon::SizeMedium)); 648 // DesktopIcon("viewmag",KIcon::SizeMedium));
649 649
650 topLayout = new QGridLayout(topFrame,5,1); 650 topLayout = new QGridLayout(topFrame,5,1);
651 topLayout->setSpacing(mSpacingHint); 651 topLayout->setSpacing(mSpacingHint);
652 topLayout->setMargin(mMarginHint); 652 topLayout->setMargin(mMarginHint);
653 ii = 0; 653 ii = 0;
654 QLabel *lab; 654 QLabel *lab;
655 QHBox *habo = new QHBox( topFrame ); 655 QHBox *habo = new QHBox( topFrame );
656 if ( QApplication::desktop()->width() <= 480 ) { 656 if ( QApplication::desktop()->width() <= 480 ) {
657 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 657 lab = new QLabel ( i18n("Show events that recur "), topFrame );
658 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 658 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
659 ii++; 659 ii++;
660 } else { 660 } else {
661 new QLabel ( i18n("Show events that recur "), habo ); 661 new QLabel ( i18n("Show events that recur "), habo );
662 } 662 }
663 dailyRecur = 663 dailyRecur =
664 addWidBool(i18n("daily"), 664 addWidBool(i18n("daily"),
665 &(KOPrefs::instance()->mMonthDailyRecur),habo); 665 &(KOPrefs::instance()->mMonthDailyRecur),habo);
666 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 666 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
667 667
668 weeklyRecur = 668 weeklyRecur =
669 addWidBool(i18n("weekly"), 669 addWidBool(i18n("weekly"),
670 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 670 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
671 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 671 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
672 ii++; 672 ii++;
673 673
674 674
675 habo = new QHBox( topFrame ); 675 habo = new QHBox( topFrame );
676 if ( QApplication::desktop()->width() <= 480 ) { 676 if ( QApplication::desktop()->width() <= 480 ) {
677 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 677 lab = new QLabel (i18n("Show in every cell ") , topFrame );
678 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 678 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
679 ii++; 679 ii++;
680 680
681 } else { 681 } else {
682 new QLabel ( i18n("Show in every cell "), habo ); 682 new QLabel ( i18n("Show in every cell "), habo );
683 } 683 }
684 weeklyRecur = 684 weeklyRecur =
685 addWidBool(i18n("short month"), 685 addWidBool(i18n("short month"),
686 &(KOPrefs::instance()->mMonthShowShort),habo); 686 &(KOPrefs::instance()->mMonthShowShort),habo);
687 weeklyRecur = 687 weeklyRecur =
688 addWidBool(i18n("icons"), 688 addWidBool(i18n("icons"),
689 &(KOPrefs::instance()->mMonthShowIcons),habo); 689 &(KOPrefs::instance()->mMonthShowIcons),habo);
690 weeklyRecur = 690 weeklyRecur =
691 addWidBool(i18n("times"), 691 addWidBool(i18n("times"),
692 &(KOPrefs::instance()->mMonthShowTimes),habo); 692 &(KOPrefs::instance()->mMonthShowTimes),habo);
693 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 693 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
694 ii++; 694 ii++;
695#ifdef DESKTOP_VERSION 695#ifdef DESKTOP_VERSION
696 KPrefsDialogWidBool *enableMonthScroll = 696 KPrefsDialogWidBool *enableMonthScroll =
697 addWidBool(i18n("Enable scrollbars in month view cells"), 697 addWidBool(i18n("Enable scrollbars in month view cells"),
698 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 698 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
699 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 699 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
700#endif 700#endif
701 dummy = 701 dummy =
702 addWidBool(i18n("Week view mode uses bigger font"), 702 addWidBool(i18n("Week view mode uses bigger font"),
703 &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame); 703 &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame);
704 topLayout->addWidget(dummy->checkBox(),ii++,0); 704 topLayout->addWidget(dummy->checkBox(),ii++,0);
705 dummy = 705 dummy =
706 addWidBool(i18n("Week view mode uses row layout"), 706 addWidBool(i18n("Week view mode uses row layout"),
707 &(KOPrefs::instance()->mMonthViewWeekRowlayout),topFrame); 707 &(KOPrefs::instance()->mMonthViewWeekRowlayout),topFrame);
708 topLayout->addWidget(dummy->checkBox(),ii++,0); 708 topLayout->addWidget(dummy->checkBox(),ii++,0);
709 dummy = 709 dummy =
710 addWidBool(i18n("Show Sat/Sun together"), 710 addWidBool(i18n("Show Sat/Sun together"),
711 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 711 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
712 topLayout->addWidget(dummy->checkBox(),ii++,0); 712 topLayout->addWidget(dummy->checkBox(),ii++,0);
713 713
714 KPrefsDialogWidBool *coloredCategoriesInMonthView = 714 KPrefsDialogWidBool *coloredCategoriesInMonthView =
715 addWidBool(i18n("Month view uses category colors"), 715 addWidBool(i18n("Month view uses category colors"),
716 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 716 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
717 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 717 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
718 718
719 dummy = 719 dummy =
720 addWidBool(i18n("Category colors are applied to text"), 720 addWidBool(i18n("Category colors are applied to text"),
721 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 721 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
722 topLayout->addWidget(dummy->checkBox(),ii++,0); 722 topLayout->addWidget(dummy->checkBox(),ii++,0);
723 723
724 724
725 725
726 if ( QApplication::desktop()->height() <= 240 ) { 726 if ( QApplication::desktop()->height() <= 240 ) {
727 topFrame = addPage(i18n("Month View") +" 2",0,0); 727 topFrame = addPage(i18n("Month View") +" 2",0,0);
728 topLayout = new QGridLayout(topFrame,4,1); 728 topLayout = new QGridLayout(topFrame,4,1);
729 topLayout->setSpacing(2); 729 topLayout->setSpacing(2);
730 topLayout->setMargin(1); 730 topLayout->setMargin(1);
731 ii = 0; 731 ii = 0;
732 } 732 }
733 733
734 734
735 coloredCategoriesInMonthView = 735 coloredCategoriesInMonthView =
736 addWidBool(i18n("Month view uses day colors"), 736 addWidBool(i18n("Month view uses day colors"),
737 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 737 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
738 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 738 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
739 739
740 KPrefsDialogWidColor *holidayColor = 740 KPrefsDialogWidColor *holidayColor =
741 addWidColor(i18n("Day color odd months"), 741 addWidColor(i18n("Day color odd months"),
742 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 742 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
743 topLayout->addWidget(holidayColor->label(),ii,0); 743 topLayout->addWidget(holidayColor->label(),ii,0);
744 topLayout->addWidget(holidayColor->button(),ii++,1); 744 topLayout->addWidget(holidayColor->button(),ii++,1);
745 745
746 holidayColor = 746 holidayColor =
747 addWidColor(i18n("Day color even months"), 747 addWidColor(i18n("Day color even months"),
748 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 748 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
749 topLayout->addWidget(holidayColor->label(),ii,0); 749 topLayout->addWidget(holidayColor->label(),ii,0);
750 topLayout->addWidget(holidayColor->button(),ii++,1); 750 topLayout->addWidget(holidayColor->button(),ii++,1);
751 751
752 752
753 holidayColor = 753 holidayColor =
754 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 754 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
755 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 755 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
756 topLayout->addWidget(holidayColor->label(),ii,0); 756 topLayout->addWidget(holidayColor->label(),ii,0);
757 topLayout->addWidget(holidayColor->button(),ii++,1); 757 topLayout->addWidget(holidayColor->button(),ii++,1);
758 // *********************** What'sNext View 758 // *********************** What'sNext View
759 topFrame = addPage(i18n("What's Next View"),0,0); 759 topFrame = addPage(i18n("What's Next View"),0,0);
760 // DesktopIcon("viewmag",KIcon::SizeMedium)); 760 // DesktopIcon("viewmag",KIcon::SizeMedium));
761 761
762 topLayout = new QGridLayout(topFrame,4,1); 762 topLayout = new QGridLayout(topFrame,4,1);
763 topLayout->setSpacing(mSpacingHint); 763 topLayout->setSpacing(mSpacingHint);
764 topLayout->setMargin(mMarginHint); 764 topLayout->setMargin(mMarginHint);
765 ii = 0; 765 ii = 0;
766 766
767 767
768 QHBox* hdummy = new QHBox(topFrame); 768 QHBox* hdummy = new QHBox(topFrame);
769 new QLabel(i18n("Days in What's Next:"),hdummy); 769 new QLabel(i18n("Days in What's Next:"),hdummy);
770 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); 770 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy);
771 771
772 topLayout->addWidget(hdummy,ii++,0); 772 topLayout->addWidget(hdummy,ii++,0);
773 773
774 QHBox *prioBox = new QHBox(topFrame); 774 QHBox *prioBox = new QHBox(topFrame);
775 // intervalBox->setSpacing(mSpacingHint); 775 // intervalBox->setSpacing(mSpacingHint);
776 topLayout->addWidget(prioBox,ii++,0); 776 topLayout->addWidget(prioBox,ii++,0);
777 777
778 QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox); 778 QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox);
779 mPrioSpin = new QSpinBox(0,5,1,prioBox); 779 mPrioSpin = new QSpinBox(0,5,1,prioBox);
780 if ( QApplication::desktop()->width() < 300 ) 780 if ( QApplication::desktop()->width() < 300 )
781 mPrioSpin->setFixedWidth( 40 ); 781 mPrioSpin->setFixedWidth( 40 );
782
783 KPrefsDialogWidBool *passwdk = 782 KPrefsDialogWidBool *passwdk =
784 783
784 addWidBool(i18n("Show times on two lines"),
785 &(KOPrefs::instance()->mWhatsNextTime2Lines),topFrame);
786 topLayout->addWidget(passwdk->checkBox(), ii++,0);
787 passwdk =
788
785 addWidBool(i18n("Show events that are done"), 789 addWidBool(i18n("Show events that are done"),
786 &(KOPrefs::instance()->mWNViewShowsPast),topFrame); 790 &(KOPrefs::instance()->mWNViewShowsPast),topFrame);
787 topLayout->addWidget(passwdk->checkBox(), ii++,0); 791 topLayout->addWidget(passwdk->checkBox(), ii++,0);
788 passwdk = 792 passwdk =
789 addWidBool(i18n("Show parent To-Do's"), 793 addWidBool(i18n("Show parent To-Do's"),
790 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 794 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
791 topLayout->addWidget(passwdk->checkBox(), ii++,0); 795 topLayout->addWidget(passwdk->checkBox(), ii++,0);
792 796
793 passwdk = 797 passwdk =
794 addWidBool(i18n("Show location"), 798 addWidBool(i18n("Show location"),
795 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 799 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
796 topLayout->addWidget(passwdk->checkBox(), ii++,0); 800 topLayout->addWidget(passwdk->checkBox(), ii++,0);
797 801
798 802
799 passwdk = 803 passwdk =
800 addWidBool(i18n("Use short date in WN+Event view"), 804 addWidBool(i18n("Use short date in WN+Event view"),
801 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 805 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
802 topLayout->addWidget(passwdk->checkBox(), ii++,0); 806 topLayout->addWidget(passwdk->checkBox(), ii++,0);
803 807
804 808
805 809
806 810
807 // *********************** Todo View 811 // *********************** Todo View
808 812
809 topFrame = addPage(i18n("Todo View"),0,0); 813 topFrame = addPage(i18n("Todo View"),0,0);
810 // DesktopIcon("viewmag",KIcon::SizeMedium)); 814 // DesktopIcon("viewmag",KIcon::SizeMedium));
811 815
812 topLayout = new QGridLayout(topFrame,4,1); 816 topLayout = new QGridLayout(topFrame,4,1);
813 topLayout->setSpacing(mSpacingHint); 817 topLayout->setSpacing(mSpacingHint);
814 topLayout->setMargin(mMarginHint); 818 topLayout->setMargin(mMarginHint);
815 ii = 0; 819 ii = 0;
816dummy = 820dummy =
817 addWidBool(i18n("Hide not running Todos in To-do view"), 821 addWidBool(i18n("Hide not running Todos in To-do view"),
818 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); 822 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame);
819 topLayout->addWidget(dummy->checkBox(),ii++,0); 823 topLayout->addWidget(dummy->checkBox(),ii++,0);
820 824
821 825
822 KPrefsDialogWidBool *showCompletedTodo = 826 KPrefsDialogWidBool *showCompletedTodo =
823 addWidBool(i18n("To-do view shows completed Todos"), 827 addWidBool(i18n("To-do view shows completed Todos"),
824 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 828 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
825 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 829 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
826 dummy = 830 dummy =
827 addWidBool(i18n("To-do view shows complete as 'xx %'"), 831 addWidBool(i18n("To-do view shows complete as 'xx %'"),
828 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 832 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
829 topLayout->addWidget(dummy->checkBox(),ii++,0); 833 topLayout->addWidget(dummy->checkBox(),ii++,0);
830 834
831 dummy = 835 dummy =
832 addWidBool(i18n("Small To-do view uses smaller font"), 836 addWidBool(i18n("Small To-do view uses smaller font"),
833 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 837 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
834 topLayout->addWidget(dummy->checkBox(),ii++,0); 838 topLayout->addWidget(dummy->checkBox(),ii++,0);
835 839
836 840
837 841
838 dummy = 842 dummy =
839 addWidBool(i18n("Todo view uses category colors"), 843 addWidBool(i18n("Todo view uses category colors"),
840 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 844 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
841 topLayout->addWidget(dummy->checkBox(),ii++,0); 845 topLayout->addWidget(dummy->checkBox(),ii++,0);
842 846
843 847
844 QWidget* wid = new QWidget( topFrame ); 848 QWidget* wid = new QWidget( topFrame );
845 // Todo run today color 849 // Todo run today color
846 KPrefsDialogWidColor *todoRunColor = 850 KPrefsDialogWidColor *todoRunColor =
847 addWidColor(i18n("Color for running todos:"), 851 addWidColor(i18n("Color for running todos:"),
848 &(KOPrefs::instance()->mTodoRunColor),wid); 852 &(KOPrefs::instance()->mTodoRunColor),wid);
849 QHBoxLayout *widLayout = new QHBoxLayout(wid); 853 QHBoxLayout *widLayout = new QHBoxLayout(wid);
850 widLayout->addWidget( todoRunColor->label() ); 854 widLayout->addWidget( todoRunColor->label() );
851 widLayout->addWidget( todoRunColor->button() ); 855 widLayout->addWidget( todoRunColor->button() );
852 topLayout->addWidget(wid,ii++,0); 856 topLayout->addWidget(wid,ii++,0);
853 857
854 wid = new QWidget( topFrame ); 858 wid = new QWidget( topFrame );
855 // Todo due today color 859 // Todo due today color
856 KPrefsDialogWidColor *todoDueTodayColor = 860 KPrefsDialogWidColor *todoDueTodayColor =
857 addWidColor(i18n("Todo due today color:"), 861 addWidColor(i18n("Todo due today color:"),
858 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 862 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
859 widLayout = new QHBoxLayout(wid); 863 widLayout = new QHBoxLayout(wid);
860 widLayout->addWidget( todoDueTodayColor->label() ); 864 widLayout->addWidget( todoDueTodayColor->label() );
861 widLayout->addWidget( todoDueTodayColor->button() ); 865 widLayout->addWidget( todoDueTodayColor->button() );
862 topLayout->addWidget(wid,ii++,0); 866 topLayout->addWidget(wid,ii++,0);
863 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 867 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
864 868
865 // Todo overdue color 869 // Todo overdue color
866 wid = new QWidget( topFrame ); 870 wid = new QWidget( topFrame );
867 widLayout = new QHBoxLayout(wid); 871 widLayout = new QHBoxLayout(wid);
868 KPrefsDialogWidColor *todoOverdueColor = 872 KPrefsDialogWidColor *todoOverdueColor =
869 addWidColor(i18n("Todo overdue color:"), 873 addWidColor(i18n("Todo overdue color:"),
870 &(KOPrefs::instance()->mTodoOverdueColor),wid); 874 &(KOPrefs::instance()->mTodoOverdueColor),wid);
871 widLayout->addWidget(todoOverdueColor->label()); 875 widLayout->addWidget(todoOverdueColor->label());
872 widLayout->addWidget(todoOverdueColor->button()); 876 widLayout->addWidget(todoOverdueColor->button());
873 topLayout->addWidget(wid,ii++,0); 877 topLayout->addWidget(wid,ii++,0);
874 878
875 dummy = 879 dummy =
876 addWidBool(i18n("Colors are applied to text"), 880 addWidBool(i18n("Colors are applied to text"),
877 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 881 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
878 topLayout->addWidget(dummy->checkBox(),ii++,0); 882 topLayout->addWidget(dummy->checkBox(),ii++,0);
879 883
880 884
881 885
882 topFrame = addPage(i18n("View Options"),0,0); 886 topFrame = addPage(i18n("View Options"),0,0);
883 887
884 topLayout = new QGridLayout(topFrame,4,1); 888 topLayout = new QGridLayout(topFrame,4,1);
885 topLayout->setSpacing(mSpacingHint); 889 topLayout->setSpacing(mSpacingHint);
886 topLayout->setMargin(mMarginHint); 890 topLayout->setMargin(mMarginHint);
887 ii = 0; 891 ii = 0;
888 892
889 dummy = 893 dummy =
890 addWidBool(i18n("Show Sync Events"), 894 addWidBool(i18n("Show Sync Events"),
891 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 895 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
892 topLayout->addWidget(dummy->checkBox(), ii++,0); 896 topLayout->addWidget(dummy->checkBox(), ii++,0);
893 897
894 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); 898 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame);
895 topLayout->addWidget(lab ,ii++,0); 899 topLayout->addWidget(lab ,ii++,0);
896 900
897 dummy = addWidBool(i18n("Details"), 901 dummy = addWidBool(i18n("Details"),
898 &(KOPrefs::instance()->mEVshowDetails),topFrame); 902 &(KOPrefs::instance()->mEVshowDetails),topFrame);
899 topLayout->addWidget(dummy->checkBox(),ii++,0); 903 topLayout->addWidget(dummy->checkBox(),ii++,0);
900 dummy = addWidBool(i18n("Created time"), 904 dummy = addWidBool(i18n("Created time"),
901 &(KOPrefs::instance()->mEVshowCreated),topFrame); 905 &(KOPrefs::instance()->mEVshowCreated),topFrame);
902 topLayout->addWidget(dummy->checkBox(),ii++,0); 906 topLayout->addWidget(dummy->checkBox(),ii++,0);
903 dummy = addWidBool(i18n("Last modified time"), 907 dummy = addWidBool(i18n("Last modified time"),
904 &(KOPrefs::instance()->mEVshowChanged),topFrame); 908 &(KOPrefs::instance()->mEVshowChanged),topFrame);
905 topLayout->addWidget(dummy->checkBox(),ii++,0); 909 topLayout->addWidget(dummy->checkBox(),ii++,0);
906 910
907 911
908 lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame); 912 lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame);
909 topLayout->addWidget(lab ,ii++,0); 913 topLayout->addWidget(lab ,ii++,0);
910 914
911 dummy = addWidBool(i18n("Details"), 915 dummy = addWidBool(i18n("Details"),
912 &(KOPrefs::instance()->mWTshowDetails),topFrame); 916 &(KOPrefs::instance()->mWTshowDetails),topFrame);
913 topLayout->addWidget(dummy->checkBox(),ii++,0); 917 topLayout->addWidget(dummy->checkBox(),ii++,0);
914 dummy = addWidBool(i18n("Created time"), 918 dummy = addWidBool(i18n("Created time"),
915 &(KOPrefs::instance()->mWTshowCreated),topFrame); 919 &(KOPrefs::instance()->mWTshowCreated),topFrame);
916 topLayout->addWidget(dummy->checkBox(),ii++,0); 920 topLayout->addWidget(dummy->checkBox(),ii++,0);
917 dummy = addWidBool(i18n("Last modified time"), 921 dummy = addWidBool(i18n("Last modified time"),
918 &(KOPrefs::instance()->mWTshowChanged),topFrame); 922 &(KOPrefs::instance()->mWTshowChanged),topFrame);
919 topLayout->addWidget(dummy->checkBox(),ii++,0); 923 topLayout->addWidget(dummy->checkBox(),ii++,0);
920 924
921 925
922 topFrame = addPage(i18n("Alarm"),0,0); 926 topFrame = addPage(i18n("Alarm"),0,0);
923 // DesktopIcon("viewmag",KIcon::SizeMedium)); 927 // DesktopIcon("viewmag",KIcon::SizeMedium));
924 928
925 topLayout = new QGridLayout(topFrame,2,1); 929 topLayout = new QGridLayout(topFrame,2,1);
926 topLayout->setSpacing(mSpacingHint); 930 topLayout->setSpacing(mSpacingHint);
927 topLayout->setMargin(mMarginHint); 931 topLayout->setMargin(mMarginHint);
928 int iii = 0; 932 int iii = 0;
929 933
930 dummy = 934 dummy =
931 addWidBool(i18n("Use internal alarm notification"), 935 addWidBool(i18n("Use internal alarm notification"),
932 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 936 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
933 topLayout->addWidget(dummy->checkBox(),iii++,0); 937 topLayout->addWidget(dummy->checkBox(),iii++,0);
934 938
935 if ( QApplication::desktop()->height() > 240 ) { 939 if ( QApplication::desktop()->height() > 240 ) {
936 940
937 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); 941 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);
938 942
939 topLayout->addWidget(lab ,iii++,0); 943 topLayout->addWidget(lab ,iii++,0);
940 } 944 }
941#ifndef DESKTOP_VERSION 945#ifndef DESKTOP_VERSION
942 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 946 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
943#else 947#else
944 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 948 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
945 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 949 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
946#endif 950#endif
947 951
948 QHBox* dummyBox = new QHBox(topFrame); 952 QHBox* dummyBox = new QHBox(topFrame);
949 new QLabel(i18n("Play beeps count:"),dummyBox); 953 new QLabel(i18n("Play beeps count:"),dummyBox);
950 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 954 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
951 topLayout->addWidget(dummyBox,iii++,0); 955 topLayout->addWidget(dummyBox,iii++,0);
952 956
953 dummyBox = new QHBox(topFrame); 957 dummyBox = new QHBox(topFrame);
954 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 958 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
955 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 959 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
956 topLayout->addWidget(dummyBox,iii++,0); 960 topLayout->addWidget(dummyBox,iii++,0);
957 961
958 dummyBox = new QHBox(topFrame); 962 dummyBox = new QHBox(topFrame);
959 new QLabel(i18n("Default suspend time in min:"),dummyBox); 963 new QLabel(i18n("Default suspend time in min:"),dummyBox);
960 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 964 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
961 topLayout->addWidget(dummyBox,iii++,0); 965 topLayout->addWidget(dummyBox,iii++,0);
962 966
963 dummyBox = new QHBox(topFrame); 967 dummyBox = new QHBox(topFrame);
964 new QLabel(i18n("Auto suspend count:"),dummyBox); 968 new QLabel(i18n("Auto suspend count:"),dummyBox);
965 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 969 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
966 topLayout->addWidget(dummyBox,iii++,0); 970 topLayout->addWidget(dummyBox,iii++,0);
967 971
968 972
969 973
970 QHBox* hbo = new QHBox ( topFrame ); 974 QHBox* hbo = new QHBox ( topFrame );
971 mDefaultAlarmFile = new QLineEdit(hbo); 975 mDefaultAlarmFile = new QLineEdit(hbo);
972 QPushButton * loadTemplate = new QPushButton(hbo); 976 QPushButton * loadTemplate = new QPushButton(hbo);
973 QPixmap icon; 977 QPixmap icon;
974 if ( QApplication::desktop()->width() < 321 ) 978 if ( QApplication::desktop()->width() < 321 )
975 icon = SmallIcon("fileimport16"); 979 icon = SmallIcon("fileimport16");
976 else 980 else
977 icon = SmallIcon("fileimport"); 981 icon = SmallIcon("fileimport");
978 loadTemplate->setIconSet (icon ) ; 982 loadTemplate->setIconSet (icon ) ;
979 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 983 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
980 int size = loadTemplate->sizeHint().height(); 984 int size = loadTemplate->sizeHint().height();
981 loadTemplate->setFixedSize( size, size ); 985 loadTemplate->setFixedSize( size, size );
982 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 986 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
983 // topLayout->addWidget(lab ,iii++,0); 987 // topLayout->addWidget(lab ,iii++,0);
984 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); 988 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
985 topLayout->addWidget(lab ,iii++,0); 989 topLayout->addWidget(lab ,iii++,0);
986 topLayout->addWidget(hbo,iii++,0); 990 topLayout->addWidget(hbo,iii++,0);
987 // 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); 991 // 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);
988 992
989// topLayout->addWidget(lab ,iii++,0); 993// topLayout->addWidget(lab ,iii++,0);
990// #ifndef DESKTOP_VERSION 994// #ifndef DESKTOP_VERSION
991// lab->setAlignment( AlignLeft|WordBreak|AlignTop); 995// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
992// #else 996// #else
993// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 997// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
994// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 998// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
995// #endif 999// #endif
996 1000
997 1001
998} 1002}
999 1003
1000void KOPrefsDialog::selectSoundFile() 1004void KOPrefsDialog::selectSoundFile()
1001{ 1005{
1002 QString fileName = mDefaultAlarmFile->text(); 1006 QString fileName = mDefaultAlarmFile->text();
1003 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 1007 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
1004 if ( fileName.length() > 0 ) 1008 if ( fileName.length() > 0 )
1005 mDefaultAlarmFile->setText( fileName ); 1009 mDefaultAlarmFile->setText( fileName );
1006} 1010}
1007void KOPrefsDialog::setupFontsTab() 1011void KOPrefsDialog::setupFontsTab()
1008{ 1012{
1009 1013
1010 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 1014 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
1011 // DesktopIcon("fonts",KIcon::SizeMedium)); 1015 // DesktopIcon("fonts",KIcon::SizeMedium));
1012 1016
1013 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 1017 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
1014 topLayout->setSpacing(1); 1018 topLayout->setSpacing(1);
1015 topLayout->setMargin(3); 1019 topLayout->setMargin(3);
1016 KPrefsDialogWidFont * tVFont; 1020 KPrefsDialogWidFont * tVFont;
1017 int i = 0; 1021 int i = 0;
1018 KPrefsDialogWidFont *timeLabelsFont = 1022 KPrefsDialogWidFont *timeLabelsFont =
1019 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 1023 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
1020 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 1024 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
1021 topLayout->addWidget(timeLabelsFont->label(),i,0); 1025 topLayout->addWidget(timeLabelsFont->label(),i,0);
1022 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1026 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1023 topLayout->addWidget(timeLabelsFont->button(),i,2); 1027 topLayout->addWidget(timeLabelsFont->button(),i,2);
1024 ++i; 1028 ++i;
1025 1029
1026 1030
1027 timeLabelsFont = 1031 timeLabelsFont =
1028 addWidFont(i18n("Mon 15"),i18n("Date Labels:"), 1032 addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
1029 &(KOPrefs::instance()->mTimeLabelsFont),topFrame); 1033 &(KOPrefs::instance()->mTimeLabelsFont),topFrame);
1030 topLayout->addWidget(timeLabelsFont->label(),i,0); 1034 topLayout->addWidget(timeLabelsFont->label(),i,0);
1031 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1035 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1032 topLayout->addWidget(timeLabelsFont->button(),i,2); 1036 topLayout->addWidget(timeLabelsFont->button(),i,2);
1033 ++i; 1037 ++i;
1034 1038
1035 KPrefsDialogWidFont *timeBarFont = 1039 KPrefsDialogWidFont *timeBarFont =
1036 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), 1040 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
1037 &(KOPrefs::instance()->mTimeBarFont),topFrame); 1041 &(KOPrefs::instance()->mTimeBarFont),topFrame);
1038 topLayout->addWidget(timeBarFont->label(),i,0); 1042 topLayout->addWidget(timeBarFont->label(),i,0);
1039 topLayout->addWidget(timeBarFont->preview(),i,1); 1043 topLayout->addWidget(timeBarFont->preview(),i,1);
1040 topLayout->addWidget(timeBarFont->button(),i,2); 1044 topLayout->addWidget(timeBarFont->button(),i,2);
1041 ++i; 1045 ++i;
1042 1046
1043 1047
1044 KPrefsDialogWidFont *marcusBainsFont = 1048 KPrefsDialogWidFont *marcusBainsFont =
1045 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), 1049 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
1046 &(KOPrefs::instance()->mMarcusBainsFont),topFrame); 1050 &(KOPrefs::instance()->mMarcusBainsFont),topFrame);
1047 topLayout->addWidget(marcusBainsFont->label(),i,0); 1051 topLayout->addWidget(marcusBainsFont->label(),i,0);
1048 topLayout->addWidget(marcusBainsFont->preview(),i,1); 1052 topLayout->addWidget(marcusBainsFont->preview(),i,1);
1049 topLayout->addWidget(marcusBainsFont->button(),i,2); 1053 topLayout->addWidget(marcusBainsFont->button(),i,2);
1050 ++i; 1054 ++i;
1051 1055
1052 tVFont = 1056 tVFont =
1053 addWidFont(i18n("Summary"),i18n("Event Viewer:"), 1057 addWidFont(i18n("Summary"),i18n("Event Viewer:"),
1054 &(KOPrefs::instance()->mEventViewFont),topFrame); 1058 &(KOPrefs::instance()->mEventViewFont),topFrame);
1055 topLayout->addWidget(tVFont->label(),i,0); 1059 topLayout->addWidget(tVFont->label(),i,0);
1056 topLayout->addWidget(tVFont->preview(),i,1); 1060 topLayout->addWidget(tVFont->preview(),i,1);
1057 topLayout->addWidget(tVFont->button(),i,2); 1061 topLayout->addWidget(tVFont->button(),i,2);
1058 ++i; 1062 ++i;
1059 1063
1060 1064
1061 1065
1062 tVFont = 1066 tVFont =
1063 addWidFont(i18n("Details"),i18n("EditorBox:"), 1067 addWidFont(i18n("Details"),i18n("EditorBox:"),
1064 &(KOPrefs::instance()->mEditBoxFont),topFrame); 1068 &(KOPrefs::instance()->mEditBoxFont),topFrame);
1065 topLayout->addWidget(tVFont->label(),i,0); 1069 topLayout->addWidget(tVFont->label(),i,0);
1066 topLayout->addWidget(tVFont->preview(),i,1); 1070 topLayout->addWidget(tVFont->preview(),i,1);
1067 topLayout->addWidget(tVFont->button(),i,2); 1071 topLayout->addWidget(tVFont->button(),i,2);
1068 ++i; 1072 ++i;
1069 1073
1070 1074
1071 1075
1072 topLayout->setColStretch(1,1); 1076 topLayout->setColStretch(1,1);
1073 topLayout->setRowStretch(4,1); 1077 topLayout->setRowStretch(4,1);
1074 1078
1075 1079
1076 i = 0; 1080 i = 0;
1077 topFrame = addPage(i18n("View Fonts"),0, 1081 topFrame = addPage(i18n("View Fonts"),0,
1078 DesktopIcon("fonts",KIcon::SizeMedium)); 1082 DesktopIcon("fonts",KIcon::SizeMedium));
1079 1083
1080 topLayout = new QGridLayout(topFrame,7,3); 1084 topLayout = new QGridLayout(topFrame,7,3);
1081 topLayout->setSpacing(1); 1085 topLayout->setSpacing(1);
1082 topLayout->setMargin(3); 1086 topLayout->setMargin(3);
1083 1087
1084 tVFont = 1088 tVFont =
1085 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1089 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1086 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1090 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1087 topLayout->addWidget(tVFont->label(),i,0); 1091 topLayout->addWidget(tVFont->label(),i,0);
1088 topLayout->addWidget(tVFont->preview(),i,1); 1092 topLayout->addWidget(tVFont->preview(),i,1);
1089 topLayout->addWidget(tVFont->button(),i,2); 1093 topLayout->addWidget(tVFont->button(),i,2);
1090 ++i; 1094 ++i;
1091 KPrefsDialogWidFont *agendaViewFont = 1095 KPrefsDialogWidFont *agendaViewFont =
1092 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1096 addWidFont(i18n("Event text"),i18n("Agenda view:"),
1093 &(KOPrefs::instance()->mAgendaViewFont),topFrame); 1097 &(KOPrefs::instance()->mAgendaViewFont),topFrame);
1094 topLayout->addWidget(agendaViewFont->label(),i,0); 1098 topLayout->addWidget(agendaViewFont->label(),i,0);
1095 topLayout->addWidget(agendaViewFont->preview(),i,1); 1099 topLayout->addWidget(agendaViewFont->preview(),i,1);
1096 topLayout->addWidget(agendaViewFont->button(),i,2); 1100 topLayout->addWidget(agendaViewFont->button(),i,2);
1097 ++i; 1101 ++i;
1098 1102
1099 1103
1100 KPrefsDialogWidFont *monthViewFont = 1104 KPrefsDialogWidFont *monthViewFont =
1101 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), 1105 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
1102 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); 1106 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
1103 topLayout->addWidget(monthViewFont->label(),i,0); 1107 topLayout->addWidget(monthViewFont->label(),i,0);
1104 topLayout->addWidget(monthViewFont->preview(),i,1); 1108 topLayout->addWidget(monthViewFont->preview(),i,1);
1105 topLayout->addWidget(monthViewFont->button(),i,2); 1109 topLayout->addWidget(monthViewFont->button(),i,2);
1106 ++i; 1110 ++i;
1107 1111
1108 1112
1109 KPrefsDialogWidFont *lVFont = 1113 KPrefsDialogWidFont *lVFont =
1110 addWidFont(i18n("Event"),i18n("List View:"), 1114 addWidFont(i18n("Event"),i18n("List View:"),
1111 &(KOPrefs::instance()->mListViewFont),topFrame); 1115 &(KOPrefs::instance()->mListViewFont),topFrame);
1112 topLayout->addWidget(lVFont->label(),i,0); 1116 topLayout->addWidget(lVFont->label(),i,0);
1113 topLayout->addWidget(lVFont->preview(),i,1); 1117 topLayout->addWidget(lVFont->preview(),i,1);
1114 topLayout->addWidget(lVFont->button(),i,2); 1118 topLayout->addWidget(lVFont->button(),i,2);
1115 ++i; 1119 ++i;
1116 1120
1117 1121
1118 tVFont = 1122 tVFont =
1119 addWidFont(i18n("ToDo"),i18n("ToDoView:"), 1123 addWidFont(i18n("ToDo"),i18n("ToDoView:"),
1120 &(KOPrefs::instance()->mTodoViewFont),topFrame); 1124 &(KOPrefs::instance()->mTodoViewFont),topFrame);
1121 topLayout->addWidget(tVFont->label(),i,0); 1125 topLayout->addWidget(tVFont->label(),i,0);
1122 topLayout->addWidget(tVFont->preview(),i,1); 1126 topLayout->addWidget(tVFont->preview(),i,1);
1123 topLayout->addWidget(tVFont->button(),i,2); 1127 topLayout->addWidget(tVFont->button(),i,2);
1124 ++i; 1128 ++i;
1125 1129
1126 1130
1127 tVFont = 1131 tVFont =
1128 addWidFont(i18n("Today"),i18n("JournalView:"), 1132 addWidFont(i18n("Today"),i18n("JournalView:"),
1129 &(KOPrefs::instance()->mJornalViewFont),topFrame); 1133 &(KOPrefs::instance()->mJornalViewFont),topFrame);
1130 topLayout->addWidget(tVFont->label(),i,0); 1134 topLayout->addWidget(tVFont->label(),i,0);
1131 topLayout->addWidget(tVFont->preview(),i,1); 1135 topLayout->addWidget(tVFont->preview(),i,1);
1132 topLayout->addWidget(tVFont->button(),i,2); 1136 topLayout->addWidget(tVFont->button(),i,2);
1133 ++i; 1137 ++i;
1134 1138
1135 1139
1136 1140
1137 1141
1138 topLayout->setColStretch(1,1); 1142 topLayout->setColStretch(1,1);
1139 topLayout->setRowStretch(4,1); 1143 topLayout->setRowStretch(4,1);
1140 1144
1141 1145
1142 1146
1143 1147
1144} 1148}
1145 1149
1146void KOPrefsDialog::setupColorsTab() 1150void KOPrefsDialog::setupColorsTab()
1147{ 1151{
1148 QFrame *topFrame = addPage(i18n("Colors"),0,0); 1152 QFrame *topFrame = addPage(i18n("Colors"),0,0);
1149 // DesktopIcon("colorize",KIcon::SizeMedium)); 1153 // DesktopIcon("colorize",KIcon::SizeMedium));
1150 1154
1151 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1155 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1152 // topLayout->setSpacing(mSpacingHint); 1156 // topLayout->setSpacing(mSpacingHint);
1153 // topLayout->setMargin(mMarginHint); 1157 // topLayout->setMargin(mMarginHint);
1154 1158
1155 topLayout->setSpacing(2); 1159 topLayout->setSpacing(2);
1156 topLayout->setMargin(3); 1160 topLayout->setMargin(3);
1157 1161
1158 int ii = 1; 1162 int ii = 1;
1159 QGroupBox *categoryGroup ; 1163 QGroupBox *categoryGroup ;
1160 1164
1161 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), 1165 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"),
1162 topFrame); 1166 topFrame);
1163 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); 1167 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
1164 1168
1165 mCategoryCombo = new QComboBox(categoryGroup); 1169 mCategoryCombo = new QComboBox(categoryGroup);
1166 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1170 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1167 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); 1171 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
1168 1172
1169 mCategoryButton = new KColorButton(categoryGroup); 1173 mCategoryButton = new KColorButton(categoryGroup);
1170 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); 1174 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
1171 updateCategoryColor(); 1175 updateCategoryColor();
1172 1176
1173 1177
1174 // Holiday Color 1178 // Holiday Color
1175 1179
1176 KPrefsDialogWidColor *holidayColor = 1180 KPrefsDialogWidColor *holidayColor =
1177 addWidColor(i18n("Holiday color:"), 1181 addWidColor(i18n("Holiday color:"),
1178 &(KOPrefs::instance()->mHolidayColor),topFrame); 1182 &(KOPrefs::instance()->mHolidayColor),topFrame);
1179 topLayout->addWidget(holidayColor->label(),ii,0); 1183 topLayout->addWidget(holidayColor->label(),ii,0);
1180 topLayout->addWidget(holidayColor->button(),ii++,1); 1184 topLayout->addWidget(holidayColor->button(),ii++,1);
1181 1185
1182 // Highlight Color 1186 // Highlight Color
1183 KPrefsDialogWidColor *highlightColor = 1187 KPrefsDialogWidColor *highlightColor =
1184 addWidColor(i18n("Highlight color:"), 1188 addWidColor(i18n("Highlight color:"),
1185 &(KOPrefs::instance()->mHighlightColor),topFrame); 1189 &(KOPrefs::instance()->mHighlightColor),topFrame);
1186 topLayout->addWidget(highlightColor->label(),ii,0); 1190 topLayout->addWidget(highlightColor->label(),ii,0);
1187 topLayout->addWidget(highlightColor->button(),ii++,1); 1191 topLayout->addWidget(highlightColor->button(),ii++,1);
1188 1192
1189 // Event color 1193 // Event color
1190 KPrefsDialogWidColor *eventColor = 1194 KPrefsDialogWidColor *eventColor =
1191 addWidColor(i18n("Default event color:"), 1195 addWidColor(i18n("Default event color:"),
1192 &(KOPrefs::instance()->mEventColor),topFrame); 1196 &(KOPrefs::instance()->mEventColor),topFrame);
1193 topLayout->addWidget(eventColor->label(),ii,0); 1197 topLayout->addWidget(eventColor->label(),ii,0);
1194 topLayout->addWidget(eventColor->button(),ii++,1); 1198 topLayout->addWidget(eventColor->button(),ii++,1);
1195 eventColor = 1199 eventColor =
1196 addWidColor(i18n("Default todo done color:"), 1200 addWidColor(i18n("Default todo done color:"),
1197 &(KOPrefs::instance()->mTodoDoneColor),topFrame); 1201 &(KOPrefs::instance()->mTodoDoneColor),topFrame);
1198 topLayout->addWidget(eventColor->label(),ii,0); 1202 topLayout->addWidget(eventColor->label(),ii,0);
1199 topLayout->addWidget(eventColor->button(),ii++,1); 1203 topLayout->addWidget(eventColor->button(),ii++,1);
1200 1204
1201 if ( QApplication::desktop()->height() <= 240 ) { 1205 if ( QApplication::desktop()->height() <= 240 ) {
1202 topFrame = addPage(i18n("Colors") +" 2",0,0); 1206 topFrame = addPage(i18n("Colors") +" 2",0,0);
1203 // DesktopIcon("colorize",KIcon::SizeMedium)); 1207 // DesktopIcon("colorize",KIcon::SizeMedium));
1204 1208
1205 topLayout = new QGridLayout(topFrame,5,2); 1209 topLayout = new QGridLayout(topFrame,5,2);
1206 // topLayout->setSpacing(mSpacingHint); 1210 // topLayout->setSpacing(mSpacingHint);
1207 // topLayout->setMargin(mMarginHint); 1211 // topLayout->setMargin(mMarginHint);
1208 1212
1209 topLayout->setSpacing(2); 1213 topLayout->setSpacing(2);
1210 topLayout->setMargin(3); 1214 topLayout->setMargin(3);
1211 } 1215 }
1212 1216
1213 1217
1214 // agenda view background color 1218 // agenda view background color
1215 KPrefsDialogWidColor *agendaBgColor = 1219 KPrefsDialogWidColor *agendaBgColor =
1216 addWidColor(i18n("Agenda view background color:"), 1220 addWidColor(i18n("Agenda view background color:"),
1217 &(KOPrefs::instance()->mAgendaBgColor),topFrame); 1221 &(KOPrefs::instance()->mAgendaBgColor),topFrame);
1218 topLayout->addWidget(agendaBgColor->label(),ii,0); 1222 topLayout->addWidget(agendaBgColor->label(),ii,0);
1219 topLayout->addWidget(agendaBgColor->button(),ii++,1); 1223 topLayout->addWidget(agendaBgColor->button(),ii++,1);
1220 1224
1221 // working hours color 1225 // working hours color
1222 KPrefsDialogWidColor *workingHoursColor = 1226 KPrefsDialogWidColor *workingHoursColor =
1223 addWidColor(i18n("Working hours color:"), 1227 addWidColor(i18n("Working hours color:"),
1224 &(KOPrefs::instance()->mWorkingHoursColor),topFrame); 1228 &(KOPrefs::instance()->mWorkingHoursColor),topFrame);
1225 topLayout->addWidget(workingHoursColor->label(),ii,0); 1229 topLayout->addWidget(workingHoursColor->label(),ii,0);
1226 topLayout->addWidget(workingHoursColor->button(),ii++,1); 1230 topLayout->addWidget(workingHoursColor->button(),ii++,1);
1227 1231
1228 KPrefsDialogWidBool *sb = 1232 KPrefsDialogWidBool *sb =
1229 addWidBool(i18n("Use colors for application:"), 1233 addWidBool(i18n("Use colors for application:"),
1230 &(KOPrefs::instance()->mUseAppColors),topFrame); 1234 &(KOPrefs::instance()->mUseAppColors),topFrame);
1231 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); 1235 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 );
1232 1236
1233 ii++; 1237 ii++;
1234 KPrefsDialogWidColor * workingHoursColor1 = 1238 KPrefsDialogWidColor * workingHoursColor1 =
1235 addWidColor(i18n("Buttons, menus, etc.:"), 1239 addWidColor(i18n("Buttons, menus, etc.:"),
1236 &(KOPrefs::instance()->mAppColor1),topFrame); 1240 &(KOPrefs::instance()->mAppColor1),topFrame);
1237 topLayout->addWidget(workingHoursColor1->label(),ii,0); 1241 topLayout->addWidget(workingHoursColor1->label(),ii,0);
1238 topLayout->addWidget(workingHoursColor1->button(),ii++,1); 1242 topLayout->addWidget(workingHoursColor1->button(),ii++,1);
1239 1243
1240 KPrefsDialogWidColor * workingHoursColor2 = 1244 KPrefsDialogWidColor * workingHoursColor2 =
1241 addWidColor(i18n("Frames, labels, etc.:"), 1245 addWidColor(i18n("Frames, labels, etc.:"),
1242 &(KOPrefs::instance()->mAppColor2),topFrame); 1246 &(KOPrefs::instance()->mAppColor2),topFrame);
1243 topLayout->addWidget(workingHoursColor2->label(),ii,0); 1247 topLayout->addWidget(workingHoursColor2->label(),ii,0);
1244 topLayout->addWidget(workingHoursColor2->button(),ii++,1); 1248 topLayout->addWidget(workingHoursColor2->button(),ii++,1);
1245 1249
1246 1250
1247 1251
1248} 1252}
1249 1253
1250void KOPrefsDialog::setCategoryColor() 1254void KOPrefsDialog::setCategoryColor()
1251{ 1255{
1252 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); 1256 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color()));
1253} 1257}
1254 1258
1255void KOPrefsDialog::updateCategoryColor() 1259void KOPrefsDialog::updateCategoryColor()
1256{ 1260{
1257 QString cat = mCategoryCombo->currentText(); 1261 QString cat = mCategoryCombo->currentText();
1258 QColor *color = mCategoryDict.find(cat); 1262 QColor *color = mCategoryDict.find(cat);
1259 if (!color) { 1263 if (!color) {
1260 color = KOPrefs::instance()->categoryColor(cat); 1264 color = KOPrefs::instance()->categoryColor(cat);
1261 } 1265 }
1262 if (color) { 1266 if (color) {
1263 mCategoryButton->setColor(*color); 1267 mCategoryButton->setColor(*color);
1264 } 1268 }
1265} 1269}
1266 1270
1267void KOPrefsDialog::setupPrinterTab() 1271void KOPrefsDialog::setupPrinterTab()
1268{ 1272{
1269 mPrinterTab = addPage(i18n("Printing"),0, 1273 mPrinterTab = addPage(i18n("Printing"),0,
1270 DesktopIcon("fileprint",KIcon::SizeMedium)); 1274 DesktopIcon("fileprint",KIcon::SizeMedium));
1271 1275
1272 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); 1276 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2);
1273 topLayout->setSpacing(mSpacingHint); 1277 topLayout->setSpacing(mSpacingHint);
1274 topLayout->setMargin(mMarginHint); 1278 topLayout->setMargin(mMarginHint);
1275 1279
1276 topLayout->setRowStretch(4,1); 1280 topLayout->setRowStretch(4,1);
1277} 1281}
1278 1282
1279void KOPrefsDialog::setupGroupSchedulingTab() 1283void KOPrefsDialog::setupGroupSchedulingTab()
1280{ 1284{
1281#if 0 1285#if 0
1282 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1286 QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
1283 DesktopIcon("personal",KIcon::SizeMedium)); 1287 DesktopIcon("personal",KIcon::SizeMedium));
1284 1288
1285 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1289 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
1286 topLayout->setSpacing(mSpacingHint); 1290 topLayout->setSpacing(mSpacingHint);
1287 topLayout->setMargin(mMarginHint); 1291 topLayout->setMargin(mMarginHint);
1288 1292
1289#if 0 1293#if 0
1290 KPrefsDialogWidRadios *schedulerGroup = 1294 KPrefsDialogWidRadios *schedulerGroup =
1291 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1295 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1292 topFrame); 1296 topFrame);
1293 schedulerGroup->addRadio("Dummy"); // Only for debugging 1297 schedulerGroup->addRadio("Dummy"); // Only for debugging
1294 schedulerGroup->addRadio(i18n("Mail client")); 1298 schedulerGroup->addRadio(i18n("Mail client"));
1295 1299
1296 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1300 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1297#endif 1301#endif
1298 1302
1299 KPrefsDialogWidRadios *sendGroup = 1303 KPrefsDialogWidRadios *sendGroup =
1300 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1304 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1301 topFrame); 1305 topFrame);
1302 sendGroup->addRadio(i18n("Send to outbox")); 1306 sendGroup->addRadio(i18n("Send to outbox"));
1303 sendGroup->addRadio(i18n("Send directly")); 1307 sendGroup->addRadio(i18n("Send directly"));
1304 1308
1305 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1309 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1306 1310
1307 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1311 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1308 mAMails = new QListView(topFrame); 1312 mAMails = new QListView(topFrame);
1309 mAMails->addColumn(i18n("Email"),300); 1313 mAMails->addColumn(i18n("Email"),300);
1310 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1314 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1311 1315
1312 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1316 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1313 aEmailsEdit = new QLineEdit(topFrame); 1317 aEmailsEdit = new QLineEdit(topFrame);
1314 aEmailsEdit->setEnabled(false); 1318 aEmailsEdit->setEnabled(false);
1315 topLayout->addWidget(aEmailsEdit,4,1); 1319 topLayout->addWidget(aEmailsEdit,4,1);
1316 1320
1317 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1321 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1318 topLayout->addWidget(add,5,0); 1322 topLayout->addWidget(add,5,0);
1319 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1323 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1320 topLayout->addWidget(del,5,1); 1324 topLayout->addWidget(del,5,1);
1321 1325
1322 //topLayout->setRowStretch(2,1); 1326 //topLayout->setRowStretch(2,1);
1323 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1327 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1324 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1328 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1325 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1329 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1326 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1330 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
1327#endif 1331#endif
1328} 1332}
1329 1333
1330void KOPrefsDialog::setupGroupAutomationTab() 1334void KOPrefsDialog::setupGroupAutomationTab()
1331{ 1335{
1332 return; 1336 return;
1333 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1337 QFrame *topFrame = addPage(i18n("Group Automation"),0,
1334 DesktopIcon("personal",KIcon::SizeMedium)); 1338 DesktopIcon("personal",KIcon::SizeMedium));
1335 1339
1336 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1340 QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
1337 topLayout->setSpacing(mSpacingHint); 1341 topLayout->setSpacing(mSpacingHint);
1338 topLayout->setMargin(mMarginHint); 1342 topLayout->setMargin(mMarginHint);
1339 1343
1340 KPrefsDialogWidRadios *autoRefreshGroup = 1344 KPrefsDialogWidRadios *autoRefreshGroup =
1341 addWidRadios(i18n("Auto Send Refresh"), 1345 addWidRadios(i18n("Auto Send Refresh"),
1342 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1346 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1343 autoRefreshGroup->addRadio(i18n("Never")); 1347 autoRefreshGroup->addRadio(i18n("Never"));
1344 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1348 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1345 //autoRefreshGroup->addRadio(i18n("selected emails")); 1349 //autoRefreshGroup->addRadio(i18n("selected emails"));
1346 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1350 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1347 1351
1348 KPrefsDialogWidRadios *autoInsertGroup = 1352 KPrefsDialogWidRadios *autoInsertGroup =
1349 addWidRadios(i18n("Auto Insert IMIP Replies"), 1353 addWidRadios(i18n("Auto Insert IMIP Replies"),
1350 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); 1354 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
1351 autoInsertGroup->addRadio(i18n("Never")); 1355 autoInsertGroup->addRadio(i18n("Never"));
1352 autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); 1356 autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
1353 //autoInsertGroup->addRadio(i18n("selected emails")); 1357 //autoInsertGroup->addRadio(i18n("selected emails"));
1354 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); 1358 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
1355 1359
1356 KPrefsDialogWidRadios *autoRequestGroup = 1360 KPrefsDialogWidRadios *autoRequestGroup =
1357 addWidRadios(i18n("Auto Insert IMIP Requests"), 1361 addWidRadios(i18n("Auto Insert IMIP Requests"),
1358 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); 1362 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
1359 autoRequestGroup->addRadio(i18n("Never")); 1363 autoRequestGroup->addRadio(i18n("Never"));
1360 autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); 1364 autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
1361 //autoInsertGroup->addRadio(i18n("selected emails")); 1365 //autoInsertGroup->addRadio(i18n("selected emails"));
1362 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); 1366 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
1363 1367
1364 KPrefsDialogWidRadios *autoFreeBusyGroup = 1368 KPrefsDialogWidRadios *autoFreeBusyGroup =
1365 addWidRadios(i18n("Auto Send FreeBusy Information"), 1369 addWidRadios(i18n("Auto Send FreeBusy Information"),
1366 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); 1370 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
1367 autoFreeBusyGroup->addRadio(i18n("Never")); 1371 autoFreeBusyGroup->addRadio(i18n("Never"));
1368 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); 1372 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
1369 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1373 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1370 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); 1374 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
1371 1375
1372 KPrefsDialogWidRadios *autoFreeBusyReplyGroup = 1376 KPrefsDialogWidRadios *autoFreeBusyReplyGroup =
1373 addWidRadios(i18n("Auto Save FreeBusy Replies"), 1377 addWidRadios(i18n("Auto Save FreeBusy Replies"),
1374 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); 1378 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
1375 autoFreeBusyReplyGroup->addRadio(i18n("Never")); 1379 autoFreeBusyReplyGroup->addRadio(i18n("Never"));
1376 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); 1380 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
1377 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1381 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1378 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); 1382 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
1379} 1383}
1380 1384
1381void KOPrefsDialog::showPrinterTab() 1385void KOPrefsDialog::showPrinterTab()
1382{ 1386{
1383 showPage(pageIndex(mPrinterTab)); 1387 showPage(pageIndex(mPrinterTab));
1384} 1388}
1385 1389
1386 1390
1387void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, 1391void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
1388 const QStringList *tags) 1392 const QStringList *tags)
1389{ 1393{
1390 if (tags) { 1394 if (tags) {
1391 int i = tags->findIndex(text); 1395 int i = tags->findIndex(text);
1392 if (i > 0) combo->setCurrentItem(i); 1396 if (i > 0) combo->setCurrentItem(i);
1393 } else { 1397 } else {
1394 for(int i=0;i<combo->count();++i) { 1398 for(int i=0;i<combo->count();++i) {
1395 if (combo->text(i) == text) { 1399 if (combo->text(i) == text) {
1396 combo->setCurrentItem(i); 1400 combo->setCurrentItem(i);
1397 break; 1401 break;
1398 } 1402 }
1399 } 1403 }
1400 } 1404 }
1401} 1405}
1402 1406
1403void KOPrefsDialog::usrReadConfig() 1407void KOPrefsDialog::usrReadConfig()
1404{ 1408{
1405 1409
1406 mNameEdit->setText(KOPrefs::instance()->fullName()); 1410 mNameEdit->setText(KOPrefs::instance()->fullName());
1407 mEmailEdit->setText(KOPrefs::instance()->email()); 1411 mEmailEdit->setText(KOPrefs::instance()->email());
1408 1412
1409 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); 1413 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
1410 1414
1411 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); 1415 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
1412 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); 1416 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
1413 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); 1417 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
1414 1418
1415 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); 1419 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
1416 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); 1420 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
1417 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); 1421 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
1418 // mAMails->clear(); 1422 // mAMails->clear();
1419 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); 1423 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
1420// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { 1424// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
1421// QListViewItem *item = new QListViewItem(mAMails); 1425// QListViewItem *item = new QListViewItem(mAMails);
1422// item->setText(0,*it); 1426// item->setText(0,*it);
1423// mAMails->insertItem(item); 1427// mAMails->insertItem(item);
1424// } 1428// }
1425 1429
1426 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 1430 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
1427 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); 1431 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
1428 updateCategories(); 1432 updateCategories();
1429 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); 1433 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
1430 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); 1434 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
1431 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); 1435 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
1432 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); 1436 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
1433 mCatDefaultColor = KOPrefs::instance()->mEventColor; 1437 mCatDefaultColor = KOPrefs::instance()->mEventColor;
1434} 1438}
1435 1439
1436 1440
1437void KOPrefsDialog::usrWriteConfig() 1441void KOPrefsDialog::usrWriteConfig()
1438{ 1442{
1439 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); 1443 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
1440 KOPrefs::instance()->setFullName(mNameEdit->text()); 1444 KOPrefs::instance()->setFullName(mNameEdit->text());
1441 KOPrefs::instance()->setEmail(mEmailEdit->text()); 1445 KOPrefs::instance()->setEmail(mEmailEdit->text());
1442 1446
1443 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); 1447 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
1444 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1448 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1445 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1449 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1446 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1450 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1447 if ( mCatDefaultColor != KOPrefs::instance()->mEventColor ) { 1451 if ( mCatDefaultColor != KOPrefs::instance()->mEventColor ) {
1448 QStringList cat = KOPrefs::instance()->mCustomCategories; 1452 QStringList cat = KOPrefs::instance()->mCustomCategories;
1449 int iii = 0; 1453 int iii = 0;
1450 while ( iii < cat.count() ) { 1454 while ( iii < cat.count() ) {
1451 if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor ) 1455 if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor )
1452 KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor ); 1456 KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor );
1453 ++iii; 1457 ++iii;
1454 } 1458 }
1455 } 1459 }
1456 QDictIterator<QColor> it(mCategoryDict); 1460 QDictIterator<QColor> it(mCategoryDict);
1457 while (it.current()) { 1461 while (it.current()) {
1458 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1462 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1459 ++it; 1463 ++it;
1460 } 1464 }
1461 1465
1462 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1466 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1463 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1467 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1464 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1468 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1465 1469
1466 KOPrefs::instance()->mAdditionalMails.clear(); 1470 KOPrefs::instance()->mAdditionalMails.clear();
1467 // QListViewItem *item; 1471 // QListViewItem *item;
1468 // item = mAMails->firstChild(); 1472 // item = mAMails->firstChild();
1469 // while (item) 1473 // while (item)
1470 // { 1474 // {
1471 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); 1475 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
1472 // item = item->nextSibling(); 1476 // item = item->nextSibling();
1473 // } 1477 // }
1474 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); 1478 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
1475 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; 1479 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
1476 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; 1480 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
1477 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; 1481 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
1478} 1482}
1479 1483
1480void KOPrefsDialog::updateCategories() 1484void KOPrefsDialog::updateCategories()
1481{ 1485{
1482 mCategoryCombo->clear(); 1486 mCategoryCombo->clear();
1483 mCategoryDict.clear(); 1487 mCategoryDict.clear();
1484 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1488 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1485 updateCategoryColor(); 1489 updateCategoryColor();
1486} 1490}
1487 1491
1488void KOPrefsDialog::toggleEmailSettings(bool on) 1492void KOPrefsDialog::toggleEmailSettings(bool on)
1489{ 1493{
1490 if (on) { 1494 if (on) {
1491 mEmailEdit->setEnabled(false); 1495 mEmailEdit->setEnabled(false);
1492 mNameEdit->setEnabled(false); 1496 mNameEdit->setEnabled(false);
1493 mEmailLabel->setEnabled(false); 1497 mEmailLabel->setEnabled(false);
1494 mNameLabel->setEnabled(false); 1498 mNameLabel->setEnabled(false);
1495 1499
1496 KEMailSettings settings; 1500 KEMailSettings settings;
1497 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); 1501 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
1498 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); 1502 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
1499 } else { 1503 } else {
1500 mEmailEdit->setEnabled(true); 1504 mEmailEdit->setEnabled(true);
1501 mNameEdit->setEnabled(true); 1505 mNameEdit->setEnabled(true);
1502 mEmailLabel->setEnabled(true); 1506 mEmailLabel->setEnabled(true);
1503 mNameLabel->setEnabled(true); 1507 mNameLabel->setEnabled(true);
1504 } 1508 }
1505} 1509}
1506 1510
1507void KOPrefsDialog::addItem() 1511void KOPrefsDialog::addItem()
1508{ 1512{
1509 // aEmailsEdit->setEnabled(true); 1513 // aEmailsEdit->setEnabled(true);
1510// QListViewItem *item = new QListViewItem(mAMails); 1514// QListViewItem *item = new QListViewItem(mAMails);
1511// mAMails->insertItem(item); 1515// mAMails->insertItem(item);
1512// mAMails->setSelected(item,true); 1516// mAMails->setSelected(item,true);
1513// aEmailsEdit->setText(i18n("(EmptyEmail)")); 1517// aEmailsEdit->setText(i18n("(EmptyEmail)"));
1514} 1518}
1515 1519
1516void KOPrefsDialog::removeItem() 1520void KOPrefsDialog::removeItem()
1517{ 1521{
1518// QListViewItem *item; 1522// QListViewItem *item;
1519// item = mAMails->selectedItem(); 1523// item = mAMails->selectedItem();
1520// if (!item) return; 1524// if (!item) return;
1521// mAMails->takeItem(item); 1525// mAMails->takeItem(item);
1522// item = mAMails->selectedItem(); 1526// item = mAMails->selectedItem();
1523// if (!item) { 1527// if (!item) {
1524// aEmailsEdit->setText(""); 1528// aEmailsEdit->setText("");
1525// aEmailsEdit->setEnabled(false); 1529// aEmailsEdit->setEnabled(false);
1526// } 1530// }
1527// if (mAMails->childCount() == 0) { 1531// if (mAMails->childCount() == 0) {
1528// aEmailsEdit->setEnabled(false); 1532// aEmailsEdit->setEnabled(false);
1529// } 1533// }
1530} 1534}
1531 1535
1532void KOPrefsDialog::updateItem() 1536void KOPrefsDialog::updateItem()
1533{ 1537{
1534 // QListViewItem *item; 1538 // QListViewItem *item;
1535// item = mAMails->selectedItem(); 1539// item = mAMails->selectedItem();
1536// if (!item) return; 1540// if (!item) return;
1537// item->setText(0,aEmailsEdit->text()); 1541// item->setText(0,aEmailsEdit->text());
1538} 1542}
1539 1543
1540void KOPrefsDialog::updateInput() 1544void KOPrefsDialog::updateInput()
1541{ 1545{
1542// QListViewItem *item; 1546// QListViewItem *item;
1543// item = mAMails->selectedItem(); 1547// item = mAMails->selectedItem();
1544// if (!item) return; 1548// if (!item) return;
1545// aEmailsEdit->setEnabled(true); 1549// aEmailsEdit->setEnabled(true);
1546// aEmailsEdit->setText(item->text(0)); 1550// aEmailsEdit->setText(item->text(0));
1547} 1551}
1548 1552
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 221debc..fafcb58 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -1,789 +1,803 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <qlayout.h> 20#include <qlayout.h>
21#include <qtextbrowser.h> 21#include <qtextbrowser.h>
22#include <qtextcodec.h> 22#include <qtextcodec.h>
23#include <qfileinfo.h> 23#include <qfileinfo.h>
24#include <qlabel.h> 24#include <qlabel.h>
25 25
26#include <qapplication.h> 26#include <qapplication.h>
27#ifdef DESKTOP_VERSION 27#ifdef DESKTOP_VERSION
28#include <qpaintdevicemetrics.h> 28#include <qpaintdevicemetrics.h>
29#endif 29#endif
30#include <kglobal.h> 30#include <kglobal.h>
31#include <klocale.h> 31#include <klocale.h>
32#include <kdebug.h> 32#include <kdebug.h>
33#include <kiconloader.h> 33#include <kiconloader.h>
34#include <kmessagebox.h> 34#include <kmessagebox.h>
35 35
36#include <libkcal/calendar.h> 36#include <libkcal/calendar.h>
37 37
38#ifndef KORG_NOPRINTER 38#ifndef KORG_NOPRINTER
39#include "calprinter.h" 39#include "calprinter.h"
40#endif 40#endif
41#include "koglobals.h" 41#include "koglobals.h"
42#include "koprefs.h" 42#include "koprefs.h"
43#include "koeventviewerdialog.h" 43#include "koeventviewerdialog.h"
44#include "koeventviewer.h" 44#include "koeventviewer.h"
45#include <qstylesheet.h> 45#include <qstylesheet.h>
46#include "kowhatsnextview.h" 46#include "kowhatsnextview.h"
47using namespace KOrg; 47using namespace KOrg;
48 48
49void WhatsNextTextBrowser::setSource(const QString& n) 49void WhatsNextTextBrowser::setSource(const QString& n)
50{ 50{
51 51
52 if (n.startsWith("event:")) { 52 if (n.startsWith("event:")) {
53 emit showIncidence(n); 53 emit showIncidence(n);
54 return; 54 return;
55 } else if (n.startsWith("todo:")) { 55 } else if (n.startsWith("todo:")) {
56 emit showIncidence(n); 56 emit showIncidence(n);
57 return; 57 return;
58 } else { 58 } else {
59 QTextBrowser::setSource(n); 59 QTextBrowser::setSource(n);
60 } 60 }
61} 61}
62void WhatsNextTextBrowser::printMe() 62void WhatsNextTextBrowser::printMe()
63{ 63{
64#ifdef DESKTOP_VERSION 64#ifdef DESKTOP_VERSION
65 KOPrintPrefs pp ( this ); 65 KOPrintPrefs pp ( this );
66 if (!pp.exec() ) 66 if (!pp.exec() )
67 return; 67 return;
68 int scaleval = pp.printMode() ; 68 int scaleval = pp.printMode() ;
69 69
70 QPrinter printer; 70 QPrinter printer;
71 if (!printer.setup() ) 71 if (!printer.setup() )
72 return; 72 return;
73 QPainter p; 73 QPainter p;
74 p.begin ( &printer ); 74 p.begin ( &printer );
75 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 75 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
76 float dx, dy; 76 float dx, dy;
77 int wid = (m.width() * 9)/10; 77 int wid = (m.width() * 9)/10;
78 dx = (float) wid/(float)contentsWidth (); 78 dx = (float) wid/(float)contentsWidth ();
79 dy = (float)(m.height()) / (float)contentsHeight (); 79 dy = (float)(m.height()) / (float)contentsHeight ();
80 float scale; 80 float scale;
81 // scale to fit the width or height of the paper 81 // scale to fit the width or height of the paper
82 if ( dx < dy ) 82 if ( dx < dy )
83 scale = dx; 83 scale = dx;
84 else 84 else
85 scale = dy; 85 scale = dy;
86 p.translate( m.width()/10,0 ); 86 p.translate( m.width()/10,0 );
87 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) { 87 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
88 p.scale( scale, scale ); 88 p.scale( scale, scale );
89 } 89 }
90 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); 90 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
91 p.end(); 91 p.end();
92#endif 92#endif
93} 93}
94 94
95KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, 95KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent,
96 const char *name) 96 const char *name)
97 : KOrg::BaseView(calendar, parent, name) 97 : KOrg::BaseView(calendar, parent, name)
98{ 98{
99 // mDateLabel = 99 // mDateLabel =
100 // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); 100 // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this);
101 // mDateLabel->setMargin(2); 101 // mDateLabel->setMargin(2);
102 // mDateLabel->setAlignment(AlignCenter); 102 // mDateLabel->setAlignment(AlignCenter);
103 setFont( KOPrefs::instance()->mWhatsNextFont ); 103 setFont( KOPrefs::instance()->mWhatsNextFont );
104 mView = new WhatsNextTextBrowser(this); 104 mView = new WhatsNextTextBrowser(this);
105 connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); 105 connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &)));
106 QStyleSheet* stsh = mView->styleSheet(); 106 QStyleSheet* stsh = mView->styleSheet();
107 QStyleSheetItem * style ; 107 QStyleSheetItem * style ;
108 style = stsh->item ("h2" ); 108 style = stsh->item ("h2" );
109 if ( style ) { 109 if ( style ) {
110 style->setMargin(QStyleSheetItem::MarginAll,0); 110 style->setMargin(QStyleSheetItem::MarginAll,0);
111 } 111 }
112 style = stsh->item ("h3" ); 112 style = stsh->item ("h3" );
113 if ( style ) { 113 if ( style ) {
114 style->setMargin(QStyleSheetItem::MarginAll,0); 114 style->setMargin(QStyleSheetItem::MarginAll,0);
115 } 115 }
116 mEventViewer = 0; 116 mEventViewer = 0;
117 117
118 QBoxLayout *topLayout = new QVBoxLayout(this); 118 QBoxLayout *topLayout = new QVBoxLayout(this);
119 // topLayout->addWidget(mDateLabel); 119 // topLayout->addWidget(mDateLabel);
120 topLayout->addWidget(mView); 120 topLayout->addWidget(mView);
121 mTimer = new QTimer( this ); 121 mTimer = new QTimer( this );
122 connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); 122 connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView()));
123 123
124 connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); 124 connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
125 connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); 125 connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
126} 126}
127 127
128KOWhatsNextView::~KOWhatsNextView() 128KOWhatsNextView::~KOWhatsNextView()
129{ 129{
130} 130}
131 131
132int KOWhatsNextView::maxDatesHint() 132int KOWhatsNextView::maxDatesHint()
133{ 133{
134 return 0; 134 return 0;
135} 135}
136 136
137int KOWhatsNextView::currentDateCount() 137int KOWhatsNextView::currentDateCount()
138{ 138{
139 return 0; 139 return 0;
140} 140}
141 141
142void KOWhatsNextView::clearList() 142void KOWhatsNextView::clearList()
143{ 143{
144 mTimer->stop(); 144 mTimer->stop();
145 mView->setText(" "); 145 mView->setText(" ");
146} 146}
147QPtrList<Incidence> KOWhatsNextView::selectedIncidences() 147QPtrList<Incidence> KOWhatsNextView::selectedIncidences()
148{ 148{
149 QPtrList<Incidence> eventList; 149 QPtrList<Incidence> eventList;
150 150
151 return eventList; 151 return eventList;
152} 152}
153 153
154void KOWhatsNextView::printMe() 154void KOWhatsNextView::printMe()
155{ 155{
156#ifdef DESKTOP_VERSION 156#ifdef DESKTOP_VERSION
157 mView->printMe(); 157 mView->printMe();
158#endif 158#endif
159} 159}
160void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd, 160void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd,
161 const QDate &td) 161 const QDate &td)
162{ 162{
163#ifndef KORG_NOPRINTER 163#ifndef KORG_NOPRINTER
164 calPrinter->preview(CalPrinter::Day, fd, td); 164 calPrinter->preview(CalPrinter::Day, fd, td);
165#endif 165#endif
166} 166}
167void KOWhatsNextView::updateConfig() 167void KOWhatsNextView::updateConfig()
168{ 168{
169 setFont( KOPrefs::instance()->mWhatsNextFont ); 169 setFont( KOPrefs::instance()->mWhatsNextFont );
170 updateView(); 170 updateView();
171 171
172} 172}
173void KOWhatsNextView::showEvent ( QShowEvent * e ) 173void KOWhatsNextView::showEvent ( QShowEvent * e )
174{ 174{
175 //qDebug("KOWhatsNextView::showEvent "); 175 //qDebug("KOWhatsNextView::showEvent ");
176 restartTimer(); 176 restartTimer();
177 QWidget::showEvent ( e ); 177 QWidget::showEvent ( e );
178} 178}
179void KOWhatsNextView::hideEvent ( QHideEvent * e) 179void KOWhatsNextView::hideEvent ( QHideEvent * e)
180{ 180{
181 //qDebug(" KOWhatsNextView::hideEvent"); 181 //qDebug(" KOWhatsNextView::hideEvent");
182 mTimer->stop(); 182 mTimer->stop();
183 QWidget::hideEvent ( e ); 183 QWidget::hideEvent ( e );
184} 184}
185void KOWhatsNextView::restartTimer() 185void KOWhatsNextView::restartTimer()
186{ 186{
187 //qDebug("KOWhatsNextView::restartTimer() "); 187 //qDebug("KOWhatsNextView::restartTimer() ");
188 mTimer->start( 300000 ); 188 mTimer->start( 300000 );
189 //mTimer->start( 5000 ); 189 //mTimer->start( 5000 );
190} 190}
191void KOWhatsNextView::updateView() 191void KOWhatsNextView::updateView()
192{ 192{
193 //qDebug("KOWhatsNextView::updateView() "); 193 //qDebug("KOWhatsNextView::updateView() ");
194 if ( mTimer->isActive() ) 194 if ( mTimer->isActive() )
195 restartTimer(); 195 restartTimer();
196 mCurrentMaxPrio = 5; 196 mCurrentMaxPrio = 5;
197 //qDebug("KOWhatsNextView::updateView() "); 197 //qDebug("KOWhatsNextView::updateView() ");
198 // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); 198 // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate()));
199 KIconLoader kil("korganizer"); 199 KIconLoader kil("korganizer");
200 QString ipath;// = new QString(); 200 QString ipath;// = new QString();
201 // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); 201 // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath);
202 //<big><big><strong>" + date + "</strong></big></big>\n"; 202 //<big><big><strong>" + date + "</strong></big></big>\n";
203 mText = "<table width=\"100%\">\n"; 203 mText = "<table width=\"100%\">\n";
204 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; 204 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
205#ifdef DESKTOP_VERSION 205#ifdef DESKTOP_VERSION
206 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>"; 206 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>";
207#else 207#else
208 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; 208 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
209#endif 209#endif
210 // mText += "<img src=\""; 210 // mText += "<img src=\"";
211 // mText += ipath; 211 // mText += ipath;
212 // mText += "\">"; 212 // mText += "\">";
213 mEventDate = QDate::currentDate(); 213 mEventDate = QDate::currentDate();
214#ifdef DESKTOP_VERSION 214#ifdef DESKTOP_VERSION
215 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>"; 215 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>";
216#else 216#else
217 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; 217 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>";
218#endif 218#endif
219 mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; 219 mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>";
220 int iii; 220 int iii;
221 mTodos.clear(); 221 mTodos.clear();
222 QPtrList<Event> events; 222 QPtrList<Event> events;
223 QPtrList<Todo> todos = calendar()->todos(); 223 QPtrList<Todo> todos = calendar()->todos();
224 Todo * todo; 224 Todo * todo;
225 //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; 225 //mText += "<h2>" + i18n("Events: ") + "</h2>\n";
226 int daysToShow = KOPrefs::instance()->mWhatsNextDays ; 226 int daysToShow = KOPrefs::instance()->mWhatsNextDays ;
227 bool itemAdded = false; 227 bool itemAdded = false;
228 for ( iii = 0; iii < daysToShow; ++iii ) { 228 for ( iii = 0; iii < daysToShow; ++iii ) {
229 QString date; 229 QString date;
230 itemAdded = false; 230 itemAdded = false;
231 events = calendar()->events( mEventDate, true ); 231 events = calendar()->events( mEventDate, true );
232 232
233 if ( iii == 0 ) { // today !!! 233 if ( iii == 0 ) { // today !!!
234 todo = todos.first(); 234 todo = todos.first();
235 while(todo) { 235 while(todo) {
236 if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() < mEventDate ) { 236 if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() < mEventDate ) {
237 if ( ! itemAdded ) { 237 if ( ! itemAdded ) {
238 appendDay ( iii, mEventDate ); 238 appendDay ( iii, mEventDate );
239 //itemAdded = true; 239 //itemAdded = true;
240 240
241 } //bool reply=false, bool notRed = true, bool appendTable = false); 241 } //bool reply=false, bool notRed = true, bool appendTable = false);
242 appendEvent(todo, false, false, !itemAdded ); 242 appendEvent(todo, false, false, !itemAdded );
243 itemAdded = true; 243 itemAdded = true;
244 } 244 }
245 todo = todos.next(); 245 todo = todos.next();
246 } 246 }
247 } 247 }
248 248
249 249
250 if (events.count() > 0) { 250 if (events.count() > 0) {
251 // mText += "<p></p>"; 251 // mText += "<p></p>";
252 // kil.loadIcon("month",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); 252 // kil.loadIcon("month",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
253 // mText += "<h2>"; 253 // mText += "<h2>";
254 //mText += " <img src=\""; 254 //mText += " <img src=\"";
255 //mText += ipath; 255 //mText += ipath;
256 //mText += "\">"; 256 //mText += "\">";
257 if ( ! itemAdded ) { 257 if ( ! itemAdded ) {
258 appendDay ( iii, mEventDate ); 258 appendDay ( iii, mEventDate );
259 259
260 } 260 }
261 // for first day (iii == 0) 261 // for first day (iii == 0)
262 // we may have syncevents, or events in the past, which maybe should not be diaplayed 262 // we may have syncevents, or events in the past, which maybe should not be diaplayed
263 // for that reason we cannot append <table> in appendDay () for iii == 0 263 // for that reason we cannot append <table> in appendDay () for iii == 0
264 // we must append it in the first successful call of appendEvent() 264 // we must append it in the first successful call of appendEvent()
265 Event *ev = events.first(); 265 Event *ev = events.first();
266 while(ev) { 266 while(ev) {
267 //qDebug("+++++event append %s", ev->summary().latin1()); 267 //qDebug("+++++event append %s", ev->summary().latin1());
268 if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) { 268 if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) {
269 if ( appendEvent(ev, false , iii!= 0,!itemAdded ) ) 269 if ( appendEvent(ev, false , iii!= 0,!itemAdded ) )
270 itemAdded = true; 270 itemAdded = true;
271 } 271 }
272 ev = events.next(); 272 ev = events.next();
273 } 273 }
274 274
275 //mText += "</table>\n"; 275 //mText += "</table>\n";
276 } 276 }
277 277
278 todo = todos.first(); 278 todo = todos.first();
279 while(todo) { 279 while(todo) {
280 if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() == mEventDate ) { 280 if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() == mEventDate ) {
281 if ( ! itemAdded ) { 281 if ( ! itemAdded ) {
282 appendDay ( iii, mEventDate ); 282 appendDay ( iii, mEventDate );
283 //itemAdded = true; 283 //itemAdded = true;
284 } 284 }
285 appendEvent(todo, false , iii!= 0,!itemAdded); 285 appendEvent(todo, false , iii!= 0,!itemAdded);
286 itemAdded = true; 286 itemAdded = true;
287 } 287 }
288 todo = todos.next(); 288 todo = todos.next();
289 } 289 }
290 if ( !itemAdded && iii == 0 ) { 290 if ( !itemAdded && iii == 0 ) {
291 // appendDay ( iii, mEventDate ); 291 // appendDay ( iii, mEventDate );
292 //mText += "<table>"; 292 //mText += "<table>";
293 // mText += "<b><font color=\"#000080\"><em>"+i18n("No event, nothing to do.") +"</em></font></b>\n"; 293 // mText += "<b><font color=\"#000080\"><em>"+i18n("No event, nothing to do.") +"</em></font></b>\n";
294 mText += "<h3 align=\"center\"><font color=\"#008000\"><em>"+i18n("No event, nothing to do.") +"</em></font></h3>\n"; 294 mText += "<h3 align=\"center\"><font color=\"#008000\"><em>"+i18n("No event, nothing to do.") +"</em></font></h3>\n";
295 //mText +="</table>"; 295 //mText +="</table>";
296 } 296 }
297 if ( itemAdded ) 297 if ( itemAdded )
298 mText += "</table>\n"; 298 mText += "</table>\n";
299 mEventDate = mEventDate.addDays( 1 ); 299 mEventDate = mEventDate.addDays( 1 );
300 } 300 }
301 301
302 int topmostPrios = KOPrefs::instance()->mWhatsNextPrios; 302 int topmostPrios = KOPrefs::instance()->mWhatsNextPrios;
303 if (todos.count() > 0 && topmostPrios > 0 ) { 303 if (todos.count() > 0 && topmostPrios > 0 ) {
304 // kil.loadIcon("todo",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); 304 // kil.loadIcon("todo",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
305 // mText += "<h2>"; 305 // mText += "<h2>";
306 //<img src=\""; 306 //<img src=\"";
307 // mText += ipath; 307 // mText += ipath;
308 // mText += "\">"; 308 // mText += "\">";
309 // mText += i18n("Overdue To-Do:") + "</h2>\n"; 309 // mText += i18n("Overdue To-Do:") + "</h2>\n";
310 310
311 //mText += "<ul>\n"; 311 //mText += "<ul>\n";
312 bool gotone = false; 312 bool gotone = false;
313 int priority = 1; 313 int priority = 1;
314 int priosFound = 0; 314 int priosFound = 0;
315#ifdef DESKTOP_VERSION 315#ifdef DESKTOP_VERSION
316 mText +="<p></p>"; 316 mText +="<p></p>";
317#endif 317#endif
318 318
319 mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n"; 319 mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n";
320 mText += "<ul>\n"; 320 mText += "<ul>\n";
321 while (!gotone && priority<6) { 321 while (!gotone && priority<6) {
322 todo = todos.first(); 322 todo = todos.first();
323 while(todo) { 323 while(todo) {
324 if (!todo->isCompleted() && (todo->priority() == priority) ) { 324 if (!todo->isCompleted() && (todo->priority() == priority) ) {
325 mCurrentMaxPrio = priority - priosFound + topmostPrios -1; 325 mCurrentMaxPrio = priority - priosFound + topmostPrios -1;
326 if ( appendTodo(todo) ) 326 if ( appendTodo(todo) )
327 gotone = true; 327 gotone = true;
328 } 328 }
329 todo = todos.next(); 329 todo = todos.next();
330 } 330 }
331 if ( gotone ) { 331 if ( gotone ) {
332 gotone = false; 332 gotone = false;
333 ++priosFound; 333 ++priosFound;
334 if ( priosFound == topmostPrios ) 334 if ( priosFound == topmostPrios )
335 break; 335 break;
336 } 336 }
337 priority++; 337 priority++;
338 // kdDebug() << "adding the todos..." << endl; 338 // kdDebug() << "adding the todos..." << endl;
339 } 339 }
340 mText += "</ul>\n"; 340 mText += "</ul>\n";
341 } 341 }
342 342
343 int replys = 0; 343 int replys = 0;
344 events = calendar()->events(QDate::currentDate(), QDate(2975,12,6)); 344 events = calendar()->events(QDate::currentDate(), QDate(2975,12,6));
345 if (events.count() > 0) { 345 if (events.count() > 0) {
346 Event *ev = events.first(); 346 Event *ev = events.first();
347 while(ev) { 347 while(ev) {
348 Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 348 Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
349 if (me!=0) { 349 if (me!=0) {
350 if (me->status()==Attendee::NeedsAction && me->RSVP()) { 350 if (me->status()==Attendee::NeedsAction && me->RSVP()) {
351 if (replys == 0) { 351 if (replys == 0) {
352 mText += "<p></p>"; 352 mText += "<p></p>";
353 // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); 353 // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
354 //mText += "<h2>"; 354 //mText += "<h2>";
355 //<img src=\""; 355 //<img src=\"";
356 // mText += ipath; 356 // mText += ipath;
357 // mText += "\">"; 357 // mText += "\">";
358 //mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n"; 358 //mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n";
359 mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n"; 359 mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n";
360 mText += "<table>\n"; 360 mText += "<table>\n";
361 } 361 }
362 replys++; 362 replys++;
363 appendEvent(ev,true); 363 appendEvent(ev,true);
364 } 364 }
365 } 365 }
366 ev = events.next(); 366 ev = events.next();
367 } 367 }
368 } 368 }
369 todos = calendar()->todos(); 369 todos = calendar()->todos();
370 if (todos.count() > 0) { 370 if (todos.count() > 0) {
371 Todo *to = todos.first(); 371 Todo *to = todos.first();
372 while(to) { 372 while(to) {
373 if ( !to->isCompleted() ){ 373 if ( !to->isCompleted() ){
374 Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 374 Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
375 if (me!=0) { 375 if (me!=0) {
376 if (me->status()==Attendee::NeedsAction && me->RSVP()) { 376 if (me->status()==Attendee::NeedsAction && me->RSVP()) {
377 if (replys == 0) { 377 if (replys == 0) {
378 mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n"; 378 mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n";
379 mText += "<table>\n"; 379 mText += "<table>\n";
380 } 380 }
381 replys++; 381 replys++;
382 appendEvent(to, true); 382 appendEvent(to, true);
383 } 383 }
384 } 384 }
385 } 385 }
386 to = todos.next(); 386 to = todos.next();
387 } 387 }
388 } 388 }
389 if (replys > 0 ) mText += "</table>\n"; 389 if (replys > 0 ) mText += "</table>\n";
390 390
391 391
392 mText += "</td></tr>\n</table>\n"; 392 mText += "</td></tr>\n</table>\n";
393 393
394 mView->setText(mText); 394 mView->setText(mText);
395 mView->setFocus(); 395 mView->setFocus();
396 396
397 // QPixmap bPix = SmallIcon( "back" ); 397 // QPixmap bPix = SmallIcon( "back" );
398 // qDebug("xxxxxxxxxxxxxxxxxxxxx "); 398 // qDebug("xxxxxxxxxxxxxxxxxxxxx ");
399 // QWidget* test = new QWidget(); 399 // QWidget* test = new QWidget();
400 // test->setBackgroundMode(FixedPixmap ); 400 // test->setBackgroundMode(FixedPixmap );
401 // test->setBackgroundPixmap ( bPix ); 401 // test->setBackgroundPixmap ( bPix );
402 // test->resize( 300, 400 ); 402 // test->resize( 300, 400 );
403 // test->show(); 403 // test->show();
404 // mView->setBackgroundMode(FixedPixmap ); 404 // mView->setBackgroundMode(FixedPixmap );
405 // mView->setBackgroundPixmap ( bPix ); 405 // mView->setBackgroundPixmap ( bPix );
406 // qDebug("%s ",mText.latin1()); 406 // qDebug("%s ",mText.latin1());
407} 407}
408 408
409void KOWhatsNextView::appendDay( int i, QDate eventDate ) 409void KOWhatsNextView::appendDay( int i, QDate eventDate )
410{ 410{
411 QString date; 411 QString date;
412 QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); 412 QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer);
413 if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { 413 if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) {
414 if ( i == 0 ) { 414 if ( i == 0 ) {
415 //mText += "<table>\n"; 415 //mText += "<table>\n";
416 return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; 416 return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>";
417 } 417 }
418 else if ( i == 1 ) 418 else if ( i == 1 )
419 date = "<em><font color=\"#000080\">" + day + "</font></em>" ; 419 date = "<em><font color=\"#000080\">" + day + "</font></em>" ;
420 else date = "<em><font color=\"#000080\">" + day + "</font></em>"; 420 else date = "<em><font color=\"#000080\">" + day + "</font></em>";
421 mText += "<h2>" + date + "</h2>\n"; 421 mText += "<h2>" + date + "</h2>\n";
422 //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; 422 //mText += "<big><big><strong>" + date + "</strong></big></big>\n";
423 mText += "<table>\n"; 423 mText += "<table>\n";
424 424
425 425
426 426
427 } else { 427 } else {
428 if ( i == 0 ) { 428 if ( i == 0 ) {
429 //mText += "<table>\n"; 429 //mText += "<table>\n";
430 return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>"; 430 return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>";
431 } 431 }
432 432
433#ifdef DESKTOP_VERSION 433#ifdef DESKTOP_VERSION
434 else if ( i == 1 ) { 434 else if ( i == 1 ) {
435 date = "<h2><em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em></h2>" ; 435 date = "<h2><em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em></h2>" ;
436 } 436 }
437 else date = "<h2><em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em></h2>"; 437 else date = "<h2><em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em></h2>";
438#else 438#else
439 else if ( i == 1 ) { 439 else if ( i == 1 ) {
440 date = "<em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em>" ; 440 date = "<em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em>" ;
441 } 441 }
442 else date = "<em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em>"; 442 else date = "<em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em>";
443 443
444#endif 444#endif
445 mText += "<h2>" + date + "</h2>\n"; 445 mText += "<h2>" + date + "</h2>\n";
446 //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; 446 //mText += "<big><big><strong>" + date + "</strong></big></big>\n";
447 mText += "<table>\n"; 447 mText += "<table>\n";
448 } 448 }
449} 449}
450 450
451 451
452void KOWhatsNextView::showDates(const QDate &, const QDate &) 452void KOWhatsNextView::showDates(const QDate &, const QDate &)
453{ 453{
454 updateView(); 454 updateView();
455} 455}
456 456
457void KOWhatsNextView::showEvents(QPtrList<Event>) 457void KOWhatsNextView::showEvents(QPtrList<Event>)
458{ 458{
459} 459}
460 460
461void KOWhatsNextView::changeEventDisplay(Event *, int action) 461void KOWhatsNextView::changeEventDisplay(Event *, int action)
462{ 462{
463 switch(action) { 463 switch(action) {
464 case KOGlobals::EVENTADDED: 464 case KOGlobals::EVENTADDED:
465 updateView(); 465 updateView();
466 break; 466 break;
467 case KOGlobals::EVENTEDITED: 467 case KOGlobals::EVENTEDITED:
468 updateView(); 468 updateView();
469 break; 469 break;
470 case KOGlobals::EVENTDELETED: 470 case KOGlobals::EVENTDELETED:
471 updateView(); 471 updateView();
472 break; 472 break;
473 default: 473 default:
474 updateView(); 474 updateView();
475 kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl; 475 kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl;
476 } 476 }
477} 477}
478 478
479bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable ) 479bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable )
480{ 480{
481 if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") ) 481 if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") )
482 return false; 482 return false;
483 QDateTime cdt = QDateTime::currentDateTime(); 483 QDateTime cdt = QDateTime::currentDateTime();
484 QDateTime noc; 484 QDateTime noc;
485 QString tempText; 485 QString tempText;
486 if ( appendTable && !notRed ) { 486 if ( appendTable && !notRed ) {
487 tempText = "<table>"; 487 tempText = "<table>";
488 } 488 }
489 bool ok = true; 489 bool ok = true;
490 if ( reply ) { 490 if ( reply ) {
491 noc = ev->getNextOccurence( cdt, &ok ); 491 noc = ev->getNextOccurence( cdt, &ok );
492 if (! ok && ev->typeID() == eventID) 492 if (! ok && ev->typeID() == eventID)
493 return false; 493 return false;
494 } 494 }
495 bool bDay = false; 495 bool bDay = false;
496 if ( ev->isBirthday() || ev->isAnniversary() ) 496 if ( ev->isBirthday() || ev->isAnniversary() )
497 bDay = true; 497 bDay = true;
498 tempText += "<tr><td><b>"; 498 tempText += "<tr><td><b>";
499 if (ev->typeID() == eventID ) { 499 if (ev->typeID() == eventID ) {
500 if (reply) { 500 if (reply) {
501 if (!ev->doesFloat()) 501 if (!ev->doesFloat())
502 tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": "; 502 tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": ";
503 else 503 else
504 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 504 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
505 505
506 } else { 506 } else {
507 if (!ev->doesFloat()) { 507 if (!ev->doesFloat()) {
508 Event *event = static_cast<Event *>(ev); 508 Event *event = static_cast<Event *>(ev);
509 QDateTime st,end; 509 QDateTime st,end;
510 if ( event->recurrence()->doesRecur() ) { 510 if ( event->recurrence()->doesRecur() ) {
511 QDate recDate= mEventDate; 511 QDate recDate= mEventDate;
512 int days = event->dtStart().date().daysTo (event->dtEnd().date() ); 512 int days = event->dtStart().date().daysTo (event->dtEnd().date() );
513 while ( ! event->recursOn( recDate ) ) { 513 while ( ! event->recursOn( recDate ) ) {
514 recDate = recDate.addDays( -1 ); 514 recDate = recDate.addDays( -1 );
515 515
516 } 516 }
517 st = QDateTime ( recDate, event->dtStart().time() ); 517 st = QDateTime ( recDate, event->dtStart().time() );
518 end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() ); 518 end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() );
519 } 519 }
520 else { 520 else {
521 st = event->dtStart(); 521 st = event->dtStart();
522 end = event->dtEnd(); 522 end = event->dtEnd();
523 } 523 }
524 524
525 525
526 QString dateText; 526 QString dateText;
527 // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() ); 527 // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() );
528 if ( st.date() < mEventDate ) 528 if ( st.date() < mEventDate )
529 dateText = "++:++-"; 529 dateText = "++:++-";
530 else 530 else
531 dateText = event->dtStartTimeStr() + "-"; 531 dateText = event->dtStartTimeStr() + "-";
532 if ( KOPrefs::instance()->mWhatsNextTime2Lines )
533 dateText += " ";
532 if ( end.date() > mEventDate ) 534 if ( end.date() > mEventDate )
533 dateText += "++:++"; 535 dateText += "++:++";
534 else 536 else
535 dateText += event->dtEndTimeStr(); 537 dateText += event->dtEndTimeStr();
536 if ( notRed ) 538 if ( notRed )
537 tempText += dateText; 539 tempText += dateText;
538 else { 540 else {
539 if ( end < cdt ) { 541 if ( end < cdt ) {
540 if ( !KOPrefs::instance()->mWNViewShowsPast ) 542 if ( !KOPrefs::instance()->mWNViewShowsPast )
541 return false; 543 return false;
542 tempText += "<font color=\"#F00000\">" + dateText + "</font>"; 544 tempText += "<font color=\"#F00000\">" + dateText + "</font>";
543 } 545 }
544 else if ( st < cdt ) 546 else if ( st < cdt )
545 tempText += "<font color=\"#008000\">" + dateText + "</font>"; 547 tempText += "<font color=\"#008000\">" + dateText + "</font>";
546 else 548 else
547 tempText += dateText; 549 tempText += dateText;
548 550
549 } 551 }
550 552
551 } else { 553 } else {
552 if ( bDay ) { 554 if ( bDay ) {
553 555
554 if ( ev->isBirthday()) 556 if ( ev->isBirthday())
555 tempText += "<font color=\"#00B000\">" + i18n("Birthday") +":</font>"; 557 tempText += "<font color=\"#00B000\">" + i18n("Birthday") +":</font>";
556 else 558 else
557 tempText += "<font color=\"#00B0000\">" + i18n("Anniversary")+":</font>"; 559 tempText += "<font color=\"#00B0000\">" + i18n("Anniversary")+":</font>";
558 } else { 560 } else {
559 tempText += i18n("Allday:"); 561 if ( ((Event*)ev)->isMultiDay() ) {
562 QString dfs = KGlobal::locale()->dateFormatShort();
563 KGlobal::locale()->setDateFormatShort("%d.%b");
564 tempText +=KGlobal::locale()->formatDate(((Event*)ev)->dtStart().date(), true, KLocale::Userdefined) + "-";
565 if ( KOPrefs::instance()->mWhatsNextTime2Lines )
566 tempText += " ";
567 tempText +=KGlobal::locale()->formatDate(((Event*)ev)->dtEnd().date(), true, KLocale::Userdefined);
568 KGlobal::locale()->setDateFormatShort(dfs);
569 } else {
570 tempText += " " ;//i18n("Allday:");
571 }
560 } 572 }
561 573
562 } 574 }
563 } 575 }
564 } else { 576 } else {
565 mTodos.append( ev ); 577 mTodos.append( ev );
566 tempText += i18n("ToDo:"); 578 tempText += i18n("ToDo:");
579 if ( KOPrefs::instance()->mWhatsNextTime2Lines )
580 tempText += " ";
567 if (reply) { 581 if (reply) {
568 tempText += " "; 582 tempText += " ";
569 if ( noc != cdt ) { 583 if ( noc != cdt ) {
570 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 584 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
571 } 585 }
572 } else { 586 } else {
573 if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) { 587 if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) {
574 // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 588 // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
575 QString dfs = KGlobal::locale()->dateFormatShort(); 589 QString dfs = KGlobal::locale()->dateFormatShort();
576 KGlobal::locale()->setDateFormatShort("%d.%b"); 590 KGlobal::locale()->setDateFormatShort("%d.%b");
577 tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; 591 tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>";
578 KGlobal::locale()->setDateFormatShort(dfs); 592 KGlobal::locale()->setDateFormatShort(dfs);
579 } else { 593 } else {
580 if (!ev->doesFloat() ) 594 if (!ev->doesFloat() )
581 if( ( (Todo*)ev)->dtDue() < cdt ) { 595 if( ( (Todo*)ev)->dtDue() < cdt ) {
582 tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; 596 tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>";
583 597
584 598
585 } else 599 } else
586 tempText +=((Todo*)ev)->dtDueTimeStr(); 600 tempText +=((Todo*)ev)->dtDueTimeStr();
587 mTodos.append( ev ); 601 mTodos.append( ev );
588 } 602 }
589 } 603 }
590 } 604 }
591 tempText += "</b></td><td>"; 605 tempText += "</b></td><td>";
592 bool needClose = false; 606 bool needClose = false;
593 if ( ev->cancelled() ) { 607 if ( ev->cancelled() ) {
594 tempText += "<font color=\"#F00000\">[c"; 608 tempText += "<font color=\"#F00000\">[c";
595 needClose =true; 609 needClose =true;
596 610
597 } 611 }
598 if ( ev->isAlarmEnabled() && ev->alarmEnabled()) { 612 if ( ev->isAlarmEnabled() && ev->alarmEnabled()) {
599 if ( !needClose) 613 if ( !needClose)
600 tempText +="["; 614 tempText +="[";
601 tempText += "a"; 615 tempText += "a";
602 needClose =true; 616 needClose =true;
603 617
604 } 618 }
605 if ( ev->description().length() > 0 ) { 619 if ( ev->description().length() > 0 ) {
606 if ( !needClose) 620 if ( !needClose)
607 tempText +="["; 621 tempText +="[";
608 tempText += "i"; 622 tempText += "i";
609 needClose =true; 623 needClose =true;
610 } 624 }
611 if ( ev->recurrence()->doesRecur() ) { 625 if ( ev->recurrence()->doesRecur() ) {
612 if ( !needClose) 626 if ( !needClose)
613 tempText +="["; 627 tempText +="[";
614 tempText += "r"; 628 tempText += "r";
615 needClose =true; 629 needClose =true;
616 } 630 }
617 if ( needClose ) { 631 if ( needClose ) {
618 tempText += "] "; 632 tempText += "] ";
619 } 633 }
620 if ( ev->cancelled() ) 634 if ( ev->cancelled() )
621 tempText += "</font>"; 635 tempText += "</font>";
622 tempText += "<a "; 636 tempText += "<a ";
623 if (ev->typeID() == eventID ) tempText += "href=\"event:"; 637 if (ev->typeID() == eventID ) tempText += "href=\"event:";
624 if (ev->typeID() == todoID ) tempText += "href=\"todo:"; 638 if (ev->typeID() == todoID ) tempText += "href=\"todo:";
625 tempText += ev->uid() + "\">"; 639 tempText += ev->uid() + "\">";
626 if ( ev->summary().length() > 0 ) 640 if ( ev->summary().length() > 0 )
627 tempText += ev->summary(); 641 tempText += ev->summary();
628 else 642 else
629 tempText += i18n("-no summary-"); 643 tempText += i18n("-no summary-");
630 if ( bDay ) { 644 if ( bDay ) {
631 noc = ev->getNextOccurence( cdt.addDays(-1), &ok ); 645 noc = ev->getNextOccurence( cdt.addDays(-1), &ok );
632 if ( ok ) { 646 if ( ok ) {
633 int years = 0; 647 int years = 0;
634 if ( ev->typeID() == todoID ) { 648 if ( ev->typeID() == todoID ) {
635 years = noc.date().year() -((Todo*)ev)->dtDue().date().year(); 649 years = noc.date().year() -((Todo*)ev)->dtDue().date().year();
636 } else 650 } else
637 years = noc.date().year() - ev->dtStart().date().year(); 651 years = noc.date().year() - ev->dtStart().date().year();
638 tempText += i18n(" (%1 y.)"). arg( years ); 652 tempText += i18n(" (%1 y.)"). arg( years );
639 } 653 }
640 } 654 }
641 655
642 tempText += "</a>"; 656 tempText += "</a>";
643 if ( KOPrefs::instance()->mWNViewShowLocation ) 657 if ( KOPrefs::instance()->mWNViewShowLocation )
644 if ( !ev->location().isEmpty() ) 658 if ( !ev->location().isEmpty() )
645 tempText += " ("+ev->location() +")"; 659 tempText += " ("+ev->location() +")";
646 if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) 660 if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents)
647 tempText += " ["+ev->relatedTo()->summary() +"]"; 661 tempText += " ["+ev->relatedTo()->summary() +"]";
648 tempText += "</td></tr>\n"; 662 tempText += "</td></tr>\n";
649 mText += tempText; 663 mText += tempText;
650 return true; 664 return true;
651} 665}
652 666
653bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) 667bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
654{ 668{
655 if ( mTodos.find( ev ) != mTodos.end() ) return false; 669 if ( mTodos.find( ev ) != mTodos.end() ) return false;
656 670
657 mTodos.append( ev ); 671 mTodos.append( ev );
658 if ( !isSub ) 672 if ( !isSub )
659 mText += "<p>"; 673 mText += "<p>";
660 else 674 else
661 mText += "<li>"; 675 mText += "<li>";
662 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; 676 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] ";
663 677
664 678
665 mText += ind; 679 mText += ind;
666 bool needClose = false; 680 bool needClose = false;
667 if ( ev->cancelled() ) { 681 if ( ev->cancelled() ) {
668 mText += "<font color=\"#F00000\">[c"; 682 mText += "<font color=\"#F00000\">[c";
669 needClose =true; 683 needClose =true;
670 684
671 } 685 }
672 if ( ev->isAlarmEnabled() && ev->alarmEnabled() ) { 686 if ( ev->isAlarmEnabled() && ev->alarmEnabled() ) {
673 if ( !needClose) 687 if ( !needClose)
674 mText +="["; 688 mText +="[";
675 mText += "a"; 689 mText += "a";
676 needClose =true; 690 needClose =true;
677 691
678 } 692 }
679 693
680 if ( ev->description().length() > 0 ) { 694 if ( ev->description().length() > 0 ) {
681 if ( !needClose) 695 if ( !needClose)
682 mText +="["; 696 mText +="[";
683 mText += "i"; 697 mText += "i";
684 needClose =true; 698 needClose =true;
685 } 699 }
686 if ( ev->doesRecur() ) { 700 if ( ev->doesRecur() ) {
687 if ( !needClose) 701 if ( !needClose)
688 mText +="["; 702 mText +="[";
689 mText += "r"; 703 mText += "r";
690 needClose =true; 704 needClose =true;
691 } 705 }
692 // if ( ev->recurrence()->doesRecur() ) { 706 // if ( ev->recurrence()->doesRecur() ) {
693 // if ( !needClose) 707 // if ( !needClose)
694 // mText +="("; 708 // mText +="(";
695 // mText += "r"; 709 // mText += "r";
696 // needClose =true; 710 // needClose =true;
697 // } 711 // }
698 if ( needClose ) 712 if ( needClose )
699 mText += "] "; 713 mText += "] ";
700 if ( ev->cancelled() ) 714 if ( ev->cancelled() )
701 mText += "</font>"; 715 mText += "</font>";
702 mText += "<a href=\"todo:" + ev->uid() + "\">"; 716 mText += "<a href=\"todo:" + ev->uid() + "\">";
703 if ( ev->summary().length() > 0 ) 717 if ( ev->summary().length() > 0 )
704 mText += ev->summary(); 718 mText += ev->summary();
705 else 719 else
706 mText += i18n("-no summary-"); 720 mText += i18n("-no summary-");
707 mText += "</a>"; 721 mText += "</a>";
708 if ( ((Todo*)ev)->hasDueDate () ) { 722 if ( ((Todo*)ev)->hasDueDate () ) {
709 QString year = ""; 723 QString year = "";
710 int ye = ((Todo*)ev)->dtDue().date().year(); 724 int ye = ((Todo*)ev)->dtDue().date().year();
711 if ( QDateTime::currentDateTime().date().year() != ye ) 725 if ( QDateTime::currentDateTime().date().year() != ye )
712 year = QString::number( ye ); 726 year = QString::number( ye );
713 QString dfs = KGlobal::locale()->dateFormatShort(); 727 QString dfs = KGlobal::locale()->dateFormatShort();
714 KGlobal::locale()->setDateFormatShort("%d.%b"); 728 KGlobal::locale()->setDateFormatShort("%d.%b");
715 mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>"; 729 mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>";
716 KGlobal::locale()->setDateFormatShort(dfs); 730 KGlobal::locale()->setDateFormatShort(dfs);
717 } 731 }
718 if ( KOPrefs::instance()->mWNViewShowLocation ) 732 if ( KOPrefs::instance()->mWNViewShowLocation )
719 if ( !ev->location().isEmpty() ) 733 if ( !ev->location().isEmpty() )
720 mText += " ("+ev->location() +")"; 734 mText += " ("+ev->location() +")";
721 if ( !isSub ) { 735 if ( !isSub ) {
722 if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents) 736 if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents)
723 mText += " ["+ev->relatedTo()->summary() +"]"; 737 mText += " ["+ev->relatedTo()->summary() +"]";
724 mText += "</p>\n"; 738 mText += "</p>\n";
725 } 739 }
726 else { 740 else {
727 ind += "-"; 741 ind += "-";
728 mText += "</li>\n"; 742 mText += "</li>\n";
729 } 743 }
730 QPtrList<Incidence> Relations = ev->relations(); 744 QPtrList<Incidence> Relations = ev->relations();
731 Incidence *to; 745 Incidence *to;
732 for (to=Relations.first();to;to=Relations.next()) { 746 for (to=Relations.first();to;to=Relations.next()) {
733 if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio ) 747 if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio )
734 appendTodo( to, ind , true ); 748 appendTodo( to, ind , true );
735 } 749 }
736 750
737 return true; 751 return true;
738} 752}
739 753
740/* 754/*
741 void KOWhatsNextView::createEventViewer() 755 void KOWhatsNextView::createEventViewer()
742 { 756 {
743 if (!mEventViewer) { 757 if (!mEventViewer) {
744 758
745 mEventViewer = new KOEventViewerDialog(this); 759 mEventViewer = new KOEventViewerDialog(this);
746 } 760 }
747 } 761 }
748*/ 762*/
749void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) 763void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v )
750{ 764{
751 mEventViewer = v; 765 mEventViewer = v;
752} 766}
753 767
754// TODO: Create this function in CalendarView and remove it from here 768// TODO: Create this function in CalendarView and remove it from here
755void KOWhatsNextView::showIncidence(const QString &uid) 769void KOWhatsNextView::showIncidence(const QString &uid)
756{ 770{
757 771
758 if ( !mEventViewer ) { 772 if ( !mEventViewer ) {
759 qDebug("KOWhatsNextView::showIncidence::sorry, no event viewer set "); 773 qDebug("KOWhatsNextView::showIncidence::sorry, no event viewer set ");
760 return; 774 return;
761 } 775 }
762 //kdDebug() << "KOWhatsNextView::showIncidence(): " << uid << endl; 776 //kdDebug() << "KOWhatsNextView::showIncidence(): " << uid << endl;
763 //qDebug("KOWhatsNextView::showIncidence %s ", uid.latin1()); 777 //qDebug("KOWhatsNextView::showIncidence %s ", uid.latin1());
764 if (uid.startsWith("event:")) { 778 if (uid.startsWith("event:")) {
765#ifdef DESKTOP_VERSION 779#ifdef DESKTOP_VERSION
766 Event *event = calendar()->event(uid.mid(8)); 780 Event *event = calendar()->event(uid.mid(8));
767#else 781#else
768 Event *event = calendar()->event(uid.mid(6)); 782 Event *event = calendar()->event(uid.mid(6));
769#endif 783#endif
770 //qDebug("event %d uid %s ", event, uid.mid(6).latin1()); 784 //qDebug("event %d uid %s ", event, uid.mid(6).latin1());
771 if (!event) return; 785 if (!event) return;
772 //createEventViewer(); 786 //createEventViewer();
773 mEventViewer->setEvent(event); 787 mEventViewer->setEvent(event);
774 } else if (uid.startsWith("todo:")) { 788 } else if (uid.startsWith("todo:")) {
775#ifdef DESKTOP_VERSION 789#ifdef DESKTOP_VERSION
776 Todo *todo = calendar()->todo(uid.mid(7)); 790 Todo *todo = calendar()->todo(uid.mid(7));
777#else 791#else
778 Todo *todo = calendar()->todo(uid.mid(5)); 792 Todo *todo = calendar()->todo(uid.mid(5));
779#endif 793#endif
780 if (!todo) return; 794 if (!todo) return;
781 //createEventViewer(); 795 //createEventViewer();
782 mEventViewer->setTodo(todo); 796 mEventViewer->setTodo(todo);
783 } else { 797 } else {
784 return; 798 return;
785 799
786 } 800 }
787 mEventViewer->showMe(); 801 mEventViewer->showMe();
788 mEventViewer->raise(); 802 mEventViewer->raise();
789} 803}