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