summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-28 19:26:15 (UTC)
committer zautrix <zautrix>2005-03-28 19:26:15 (UTC)
commitea070abfcff313cac87dbb4d5c9410784740de21 (patch) (unidiff)
tree3e95608a0444030016eb6845b95a582e265c1dad /korganizer
parent57f95bb15f732ede3ddc68b077b6a5476246e971 (diff)
downloadkdepimpi-ea070abfcff313cac87dbb4d5c9410784740de21.zip
kdepimpi-ea070abfcff313cac87dbb4d5c9410784740de21.tar.gz
kdepimpi-ea070abfcff313cac87dbb4d5c9410784740de21.tar.bz2
print fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp13
-rw-r--r--korganizer/koeventviewer.h53
-rw-r--r--korganizer/koeventviewerdialog.cpp8
-rw-r--r--korganizer/kowhatsnextview.cpp12
4 files changed, 76 insertions, 10 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 445fc86..dbe0668 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -1,479 +1,490 @@
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 <qcstring.h> 20#include <qcstring.h>
21#include <qwhatsthis.h> 21#include <qwhatsthis.h>
22#include <qdialog.h> 22#include <qdialog.h>
23#include <qapplication.h> 23#include <qapplication.h>
24#include <qlabel.h> 24#include <qlabel.h>
25#include <qlayout.h> 25#include <qlayout.h>
26 26
27#include <klocale.h> 27#include <klocale.h>
28#include <kapplication.h> 28#include <kapplication.h>
29#include <libkcal/event.h> 29#include <libkcal/event.h>
30#include <libkcal/todo.h> 30#include <libkcal/todo.h>
31#include <kdebug.h> 31#include <kdebug.h>
32#include <kiconloader.h> 32#include <kiconloader.h>
33#include <krun.h> 33#include <krun.h>
34#include <kglobal.h> 34#include <kglobal.h>
35#include <kprocess.h> 35#include <kprocess.h>
36#include "koprefs.h" 36#include "koprefs.h"
37 37
38#include <kabc/stdaddressbook.h> 38#include <kabc/stdaddressbook.h>
39 39
40#ifndef KORG_NODCOP 40#ifndef KORG_NODCOP
41#include <dcopclient.h> 41#include <dcopclient.h>
42#include "korganizer.h" 42#include "korganizer.h"
43#include "koprefs.h" 43#include "koprefs.h"
44#include "actionmanager.h" 44#include "actionmanager.h"
45#endif 45#endif
46 46
47#include "koeventviewer.h" 47#include "koeventviewer.h"
48//#ifndef KORG_NOKABC 48//#ifndef KORG_NOKABC
49//#include <kabc/stdaddressbook.h> 49//#include <kabc/stdaddressbook.h>
50//#define size count 50//#define size count
51//#endif 51//#endif
52 52
53#ifdef DESKTOP_VERSION 53#ifdef DESKTOP_VERSION
54#include <kabc/addresseedialog.h> 54#include <kabc/addresseedialog.h>
55#include <kabc/addresseeview.h> 55#include <kabc/addresseeview.h>
56#include <qprinter.h> 56#include <qprinter.h>
57#include <qpainter.h> 57#include <qpainter.h>
58#include <qpaintdevicemetrics.h> 58#include <qpaintdevicemetrics.h>
59#else //DESKTOP_VERSION 59#else //DESKTOP_VERSION
60#include <externalapphandler.h> 60#include <externalapphandler.h>
61#include <qtopia/qcopenvelope_qws.h> 61#include <qtopia/qcopenvelope_qws.h>
62#endif //DESKTOP_VERSION 62#endif //DESKTOP_VERSION
63 63
64KOEventViewer::KOEventViewer(QWidget *parent,const char *name) 64KOEventViewer::KOEventViewer(QWidget *parent,const char *name)
65 : QTextBrowser(parent,name) 65 : QTextBrowser(parent,name)
66{ 66{
67 mSyncMode = false; 67 mSyncMode = false;
68 mColorMode = 0; 68 mColorMode = 0;
69} 69}
70 70
71KOEventViewer::~KOEventViewer() 71KOEventViewer::~KOEventViewer()
72{ 72{
73} 73}
74 74
75void KOEventViewer::printMe() 75void KOEventViewer::printMe()
76{ 76{
77#ifdef DESKTOP_VERSION 77#ifdef DESKTOP_VERSION
78
79 KOPrintPrefs pp ( this );
80 if (!pp.exec() )
81 return;
82 int scaleval = pp.printMode() ;
83
78 QPrinter printer; 84 QPrinter printer;
79 if (!printer.setup() ) 85 if (!printer.setup() )
80 return; 86 return;
81 QPainter p; 87 QPainter p;
82 p.begin ( &printer ); 88 p.begin ( &printer );
83 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 89 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
84 float dx, dy; 90 float dx, dy;
85 int wid = (m.width() * 9)/10; 91 int wid = (m.width() * 9)/10;
86 dx = (float) wid/(float)contentsWidth (); 92 dx = (float) wid/(float)contentsWidth ();
87 dy = (float)(m.height()) / (float)contentsHeight (); 93 dy = (float)(m.height()) / (float)contentsHeight ();
88 float scale; 94 float scale;
89 // scale to fit the width or height of the paper 95 // scale to fit the width or height of the paper
90 if ( dx < dy ) 96 if ( dx < dy )
91 scale = dx; 97 scale = dx;
92 else 98 else
93 scale = dy; 99 scale = dy;
100
94 p.translate( m.width()/10,0 ); 101 p.translate( m.width()/10,0 );
95 p.scale( scale, scale ); 102 qDebug("Scale: %f ", scale );
103 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
104 qDebug("SCALE ");
105 p.scale( scale, scale );
106 }
96 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); 107 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
97 p.end(); 108 p.end();
98#endif 109#endif
99 110
100} 111}
101void KOEventViewer::setSource(const QString& n) 112void KOEventViewer::setSource(const QString& n)
102{ 113{
103 114
104 if ( n.left(3) == "uid" ) 115 if ( n.left(3) == "uid" )
105#ifdef DESKTOP_VERSION 116#ifdef DESKTOP_VERSION
106 { 117 {
107 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 118 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
108 KABC::AddressBook::Iterator it; 119 KABC::AddressBook::Iterator it;
109 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 120 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
110 // LR I do not understand, why the uid string is different on zaurus and desktop 121 // LR I do not understand, why the uid string is different on zaurus and desktop
111 QString uid = "uid://"+(*it).uid(); 122 QString uid = "uid://"+(*it).uid();
112 123
113 //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); 124 //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1());
114 if (n == uid ) { 125 if (n == uid ) {
115 //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); 126 //qDebug("found %s ",(*it).mobileHomePhone().latin1() );
116 QDialog dia( this,"dia123", true ); 127 QDialog dia( this,"dia123", true );
117 dia.setCaption( i18n("Details of attendee") ); 128 dia.setCaption( i18n("Details of attendee") );
118 QVBoxLayout lay ( &dia ); 129 QVBoxLayout lay ( &dia );
119 KABC::AddresseeView av ( &dia ); 130 KABC::AddresseeView av ( &dia );
120 av.setAddressee( (*it) ); 131 av.setAddressee( (*it) );
121 lay.addWidget( &av ); 132 lay.addWidget( &av );
122 if ( QApplication::desktop()->width() < 480 ) 133 if ( QApplication::desktop()->width() < 480 )
123 dia.resize( 220, 240); 134 dia.resize( 220, 240);
124 else { 135 else {
125 dia.resize( 400,400); 136 dia.resize( 400,400);
126 } 137 }
127 dia.exec(); 138 dia.exec();
128 break; 139 break;
129 } 140 }
130 } 141 }
131 return; 142 return;
132 } 143 }
133#else 144#else
134 { 145 {
135 if ( "uid:organizer" == n ) { 146 if ( "uid:organizer" == n ) {
136 ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); 147 ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),"");
137 return; 148 return;
138 } 149 }
139 QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); 150 QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
140 if (attendees.count()) { 151 if (attendees.count()) {
141 Attendee *a; 152 Attendee *a;
142 for(a=attendees.first();a;a=attendees.next()) { 153 for(a=attendees.first();a;a=attendees.next()) {
143 if ( "uid:"+a->uid() == n ) { 154 if ( "uid:"+a->uid() == n ) {
144 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); 155 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid());
145 return; 156 return;
146 } 157 }
147 } 158 }
148 } 159 }
149 return; 160 return;
150 } 161 }
151 //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 162 //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
152 // the result should now arrive through method insertAttendees 163 // the result should now arrive through method insertAttendees
153 //QString uid = "uid:"+(*it).uid(); 164 //QString uid = "uid:"+(*it).uid();
154#endif 165#endif
155 if ( n.left(6) == "mailto" ) { 166 if ( n.left(6) == "mailto" ) {
156 // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); 167 // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1());
157#ifndef DESKTOP_VERSION 168#ifndef DESKTOP_VERSION
158 if ( n.mid(7,3) == "ALL" ) { 169 if ( n.mid(7,3) == "ALL" ) {
159 qDebug("all "); 170 qDebug("all ");
160 mailToAttendees( true ); 171 mailToAttendees( true );
161 } else if ( n.mid(7,4) == "RSVP" ) { 172 } else if ( n.mid(7,4) == "RSVP" ) {
162 mailToAttendees( false ); 173 mailToAttendees( false );
163 qDebug("rsvp "); 174 qDebug("rsvp ");
164 } else { 175 } else {
165 QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); 176 QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" );
166 e << n.mid(7); 177 e << n.mid(7);
167 } 178 }
168#endif 179#endif
169 180
170 } 181 }
171 182
172 183
173#ifndef KORG_NODCOP 184#ifndef KORG_NODCOP
174 kdDebug() << "KOEventViewer::setSource(): " << n << endl; 185 kdDebug() << "KOEventViewer::setSource(): " << n << endl;
175 QString tmpStr; 186 QString tmpStr;
176 if (n.startsWith("mailto:")) { 187 if (n.startsWith("mailto:")) {
177 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); 188 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null);
178 //emit showIncidence(n); 189 //emit showIncidence(n);
179 return; 190 return;
180 } else if (n.startsWith("uid:")) { 191 } else if (n.startsWith("uid:")) {
181 DCOPClient *client = KApplication::kApplication()->dcopClient(); 192 DCOPClient *client = KApplication::kApplication()->dcopClient();
182 const QByteArray noParamData; 193 const QByteArray noParamData;
183 const QByteArray paramData; 194 const QByteArray paramData;
184 QByteArray replyData; 195 QByteArray replyData;
185 QCString replyTypeStr; 196 QCString replyTypeStr;
186#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) 197#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData))
187 bool foundAbbrowser = PING_ABBROWSER; 198 bool foundAbbrowser = PING_ABBROWSER;
188 199
189 if (foundAbbrowser) { 200 if (foundAbbrowser) {
190 //KAddressbook is already running, so just DCOP to it to bring up the contact editor 201 //KAddressbook is already running, so just DCOP to it to bring up the contact editor
191 //client->send("kaddressbook","KAddressBookIface", 202 //client->send("kaddressbook","KAddressBookIface",
192 QDataStream arg(paramData, IO_WriteOnly); 203 QDataStream arg(paramData, IO_WriteOnly);
193 arg << n.mid(6); 204 arg << n.mid(6);
194 client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); 205 client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData);
195 return; 206 return;
196 } else { 207 } else {
197 /* 208 /*
198 KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. 209 KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater.
199 We start it without its main interface 210 We start it without its main interface
200 */ 211 */
201 KIconLoader* iconLoader = new KIconLoader(); 212 KIconLoader* iconLoader = new KIconLoader();
202 QString iconPath = iconLoader->iconPath("go",KIcon::Small); 213 QString iconPath = iconLoader->iconPath("go",KIcon::Small);
203 ActionManager::setStartedKAddressBook(true); 214 ActionManager::setStartedKAddressBook(true);
204 tmpStr = "kaddressbook --editor-only --uid "; 215 tmpStr = "kaddressbook --editor-only --uid ";
205 tmpStr += KProcess::quote(n.mid(6)); 216 tmpStr += KProcess::quote(n.mid(6));
206 KRun::runCommand(tmpStr,"KAddressBook",iconPath); 217 KRun::runCommand(tmpStr,"KAddressBook",iconPath);
207 return; 218 return;
208 } 219 }
209 } else { 220 } else {
210 //QTextBrowser::setSource(n); 221 //QTextBrowser::setSource(n);
211 } 222 }
212#endif 223#endif
213} 224}
214void KOEventViewer::mailToAttendees( bool all ) 225void KOEventViewer::mailToAttendees( bool all )
215{ 226{
216 QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); 227 QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
217 if (attendees.count() == 0) return; 228 if (attendees.count() == 0) return;
218 QStringList nameList; 229 QStringList nameList;
219 QStringList emailList; 230 QStringList emailList;
220 QStringList uidList; 231 QStringList uidList;
221 Attendee* a; 232 Attendee* a;
222 for(a=attendees.first();a;a=attendees.next()) { 233 for(a=attendees.first();a;a=attendees.next()) {
223 if ( !all && !a->RSVP() ) continue; 234 if ( !all && !a->RSVP() ) continue;
224 if (!a->email().isEmpty()) { 235 if (!a->email().isEmpty()) {
225 nameList.append (a->name() ); 236 nameList.append (a->name() );
226 emailList.append (a->email() ); 237 emailList.append (a->email() );
227 uidList.append (a->uid() ); 238 uidList.append (a->uid() );
228 } 239 }
229 } 240 }
230 QString uid = "ComposeMailUIpick2"+mMailSubject; 241 QString uid = "ComposeMailUIpick2"+mMailSubject;
231#ifndef DESKTOP_VERSION 242#ifndef DESKTOP_VERSION
232 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 243 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
233#endif 244#endif
234 245
235} 246}
236void KOEventViewer::addTag(const QString & tag,const QString & text) 247void KOEventViewer::addTag(const QString & tag,const QString & text)
237{ 248{
238 int number=text.contains("\n"); 249 int number=text.contains("\n");
239 QString str = "<" + tag + ">"; 250 QString str = "<" + tag + ">";
240 QString tmpText=text; 251 QString tmpText=text;
241 QString tmpStr=str; 252 QString tmpStr=str;
242 if(number !=-1) 253 if(number !=-1)
243 { 254 {
244 if (number > 0) { 255 if (number > 0) {
245 int pos=0; 256 int pos=0;
246 QString tmp; 257 QString tmp;
247 for(int i=0;i<=number;i++) { 258 for(int i=0;i<=number;i++) {
248 pos=tmpText.find("\n"); 259 pos=tmpText.find("\n");
249 tmp=tmpText.left(pos); 260 tmp=tmpText.left(pos);
250 tmpText=tmpText.right(tmpText.length()-pos-1); 261 tmpText=tmpText.right(tmpText.length()-pos-1);
251 tmpStr+=tmp+"<br>"; 262 tmpStr+=tmp+"<br>";
252 } 263 }
253 } 264 }
254 else tmpStr += tmpText; 265 else tmpStr += tmpText;
255 tmpStr+="</" + tag + ">"; 266 tmpStr+="</" + tag + ">";
256 mText.append(tmpStr); 267 mText.append(tmpStr);
257 } 268 }
258 else 269 else
259 { 270 {
260 str += text + "</" + tag + ">"; 271 str += text + "</" + tag + ">";
261 mText.append(str); 272 mText.append(str);
262 } 273 }
263} 274}
264 275
265void KOEventViewer::setColorMode( int m ) 276void KOEventViewer::setColorMode( int m )
266{ 277{
267 mColorMode = m; 278 mColorMode = m;
268} 279}
269void KOEventViewer::appendEvent(Event *event, int mode ) 280void KOEventViewer::appendEvent(Event *event, int mode )
270{ 281{
271 mMailSubject = ""; 282 mMailSubject = "";
272 mCurrentIncidence = event; 283 mCurrentIncidence = event;
273 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 284 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
274 topLevelWidget()->setCaption(i18n("Event Viewer")); 285 topLevelWidget()->setCaption(i18n("Event Viewer"));
275 if ( mode == 0 ) { 286 if ( mode == 0 ) {
276 addTag("h2",deTag(event->summary())); 287 addTag("h2",deTag(event->summary()));
277 } 288 }
278 else { 289 else {
279 if ( mColorMode == 1 ) { 290 if ( mColorMode == 1 ) {
280 mText +="<font color=\"#00A000\">"; 291 mText +="<font color=\"#00A000\">";
281 } 292 }
282 if ( mColorMode == 2 ) { 293 if ( mColorMode == 2 ) {
283 mText +="<font color=\"#C00000\">"; 294 mText +="<font color=\"#C00000\">";
284 } 295 }
285 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 296 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
286 if ( mode == 1 ) { 297 if ( mode == 1 ) {
287 addTag("h2",i18n( "Local: " ) +deTag(event->summary())); 298 addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
288 } else { 299 } else {
289 addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); 300 addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
290 } 301 }
291 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 302 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
292 if ( mColorMode ) 303 if ( mColorMode )
293 mText += "</font>"; 304 mText += "</font>";
294 } 305 }
295 mMailSubject += i18n( "Meeting " )+ event->summary(); 306 mMailSubject += i18n( "Meeting " )+ event->summary();
296 if (event->cancelled ()) { 307 if (event->cancelled ()) {
297 mText +="<font color=\"#B00000\">"; 308 mText +="<font color=\"#B00000\">";
298 addTag("i",i18n("This event has been cancelled!")); 309 addTag("i",i18n("This event has been cancelled!"));
299 mText.append("<br>"); 310 mText.append("<br>");
300 mText += "</font>"; 311 mText += "</font>";
301 mMailSubject += i18n("(cancelled)"); 312 mMailSubject += i18n("(cancelled)");
302 } 313 }
303 if (!event->location().isEmpty()) { 314 if (!event->location().isEmpty()) {
304 addTag("b",i18n("Location: ")); 315 addTag("b",i18n("Location: "));
305 mText.append(deTag(event->location())+"<br>"); 316 mText.append(deTag(event->location())+"<br>");
306 mMailSubject += i18n(" at ") + event->location(); 317 mMailSubject += i18n(" at ") + event->location();
307 } 318 }
308 if (event->doesFloat()) { 319 if (event->doesFloat()) {
309 if (event->isMultiDay()) { 320 if (event->isMultiDay()) {
310 mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") 321 mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>")
311 .arg(event->dtStartDateStr(shortDate)) 322 .arg(event->dtStartDateStr(shortDate))
312 .arg(event->dtEndDateStr(shortDate))); 323 .arg(event->dtEndDateStr(shortDate)));
313 } else { 324 } else {
314 mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); 325 mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate )));
315 } 326 }
316 } else { 327 } else {
317 if (event->isMultiDay()) { 328 if (event->isMultiDay()) {
318 mText.append(i18n("<p><b>From:</b> %1</p> ") 329 mText.append(i18n("<p><b>From:</b> %1</p> ")
319 .arg(event->dtStartStr( shortDate))); 330 .arg(event->dtStartStr( shortDate)));
320 mText.append(i18n("<p><b>To:</b> %1</p>") 331 mText.append(i18n("<p><b>To:</b> %1</p>")
321 .arg(event->dtEndStr(shortDate))); 332 .arg(event->dtEndStr(shortDate)));
322 } else { 333 } else {
323 mText.append(i18n("<p><b>On:</b> %1</p> ") 334 mText.append(i18n("<p><b>On:</b> %1</p> ")
324 .arg(event->dtStartDateStr( shortDate ))); 335 .arg(event->dtStartDateStr( shortDate )));
325 mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") 336 mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>")
326 .arg(event->dtStartTimeStr()) 337 .arg(event->dtStartTimeStr())
327 .arg(event->dtEndTimeStr())); 338 .arg(event->dtEndTimeStr()));
328 } 339 }
329 } 340 }
330 341
331 if (event->recurrence()->doesRecur()) { 342 if (event->recurrence()->doesRecur()) {
332 343
333 QString recurText = event->recurrence()->recurrenceText(); 344 QString recurText = event->recurrence()->recurrenceText();
334 addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); 345 addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>");
335 bool ok; 346 bool ok;
336 QDate start = QDate::currentDate(); 347 QDate start = QDate::currentDate();
337 QDateTime next; 348 QDateTime next;
338 next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); 349 next = event->getNextOccurence( QDateTime::currentDateTime() , &ok );
339 if ( ok ) { 350 if ( ok ) {
340 addTag("p",i18n("<b>Next recurrence is on:</b>") ); 351 addTag("p",i18n("<b>Next recurrence is on:</b>") );
341 addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); 352 addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate ));
342 mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); 353 mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true );
343 354
344 } else { 355 } else {
345 bool last; 356 bool last;
346 QDate nextd; 357 QDate nextd;
347 nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); 358 nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last );
348 if ( last ) { 359 if ( last ) {
349 addTag("p",i18n("<b>Last recurrence was on:</b>") ); 360 addTag("p",i18n("<b>Last recurrence was on:</b>") );
350 addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); 361 addTag("p", KGlobal::locale()->formatDate( nextd, shortDate ));
351 } 362 }
352 } 363 }
353 } else { 364 } else {
354 mMailSubject += i18n(" - " )+event->dtStartStr( true ); 365 mMailSubject += i18n(" - " )+event->dtStartStr( true );
355 366
356 } 367 }
357 368
358 369
359 if (event->isAlarmEnabled()) { 370 if (event->isAlarmEnabled()) {
360 Alarm *alarm =event->alarms().first() ; 371 Alarm *alarm =event->alarms().first() ;
361 QDateTime t = alarm->time(); 372 QDateTime t = alarm->time();
362 int min = t.secsTo( event->dtStart() )/60; 373 int min = t.secsTo( event->dtStart() )/60;
363 QString s =i18n("( %1 min before )").arg( min ); 374 QString s =i18n("( %1 min before )").arg( min );
364 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 375 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
365 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 376 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
366 //addTag("p",s); 377 //addTag("p",s);
367 } 378 }
368 379
369 addTag("b",i18n("Access: ")); 380 addTag("b",i18n("Access: "));
370 mText.append(event->secrecyStr()+"<br>"); 381 mText.append(event->secrecyStr()+"<br>");
371 382
372 383
373 if ( KOPrefs::instance()->mEVshowDetails ) { 384 if ( KOPrefs::instance()->mEVshowDetails ) {
374 if (!event->description().isEmpty()) { 385 if (!event->description().isEmpty()) {
375 addTag("p",i18n("<b>Details: </b>")); 386 addTag("p",i18n("<b>Details: </b>"));
376 addTag("p",deTag(event->description())); 387 addTag("p",deTag(event->description()));
377 } 388 }
378 } 389 }
379 formatCategories(event); 390 formatCategories(event);
380 391
381 formatReadOnly(event); 392 formatReadOnly(event);
382 formatAttendees(event); 393 formatAttendees(event);
383 394
384 if ( KOPrefs::instance()->mEVshowCreated ) { 395 if ( KOPrefs::instance()->mEVshowCreated ) {
385 addTag("p",i18n("<b>Created: ") +" </b>"); 396 addTag("p",i18n("<b>Created: ") +" </b>");
386 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); 397 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
387 398
388 } 399 }
389 if ( KOPrefs::instance()->mEVshowChanged ) { 400 if ( KOPrefs::instance()->mEVshowChanged ) {
390 addTag("p",i18n("<b>Last modified: ") +" </b>"); 401 addTag("p",i18n("<b>Last modified: ") +" </b>");
391 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); 402 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
392 403
393 } 404 }
394 setText(mText); 405 setText(mText);
395 //QWhatsThis::add(this,mText); 406 //QWhatsThis::add(this,mText);
396 407
397} 408}
398 409
399void KOEventViewer::appendTodo(Todo *event, int mode ) 410void KOEventViewer::appendTodo(Todo *event, int mode )
400{ 411{
401 mMailSubject = ""; 412 mMailSubject = "";
402 mCurrentIncidence = event; 413 mCurrentIncidence = event;
403 topLevelWidget()->setCaption(i18n("Todo Viewer")); 414 topLevelWidget()->setCaption(i18n("Todo Viewer"));
404 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 415 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
405 if (mode == 0 ) 416 if (mode == 0 )
406 addTag("h2",deTag(event->summary())); 417 addTag("h2",deTag(event->summary()));
407 else { 418 else {
408 if ( mColorMode == 1 ) { 419 if ( mColorMode == 1 ) {
409 mText +="<font color=\"#00A000\">"; 420 mText +="<font color=\"#00A000\">";
410 } 421 }
411 if ( mColorMode == 2 ) { 422 if ( mColorMode == 2 ) {
412 mText +="<font color=\"#B00000\">"; 423 mText +="<font color=\"#B00000\">";
413 } 424 }
414 if ( mode == 1 ) { 425 if ( mode == 1 ) {
415 addTag("h2",i18n( "Local: " ) +deTag(event->summary())); 426 addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
416 } else { 427 } else {
417 addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); 428 addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
418 } 429 }
419 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 430 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
420 if ( mColorMode ) 431 if ( mColorMode )
421 mText += "</font>"; 432 mText += "</font>";
422 } 433 }
423 mMailSubject += i18n( "Todo " )+ event->summary(); 434 mMailSubject += i18n( "Todo " )+ event->summary();
424 435
425 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { 436 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
426 mText +="<font color=\"#B00000\">"; 437 mText +="<font color=\"#B00000\">";
427 addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); 438 addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) );
428 mText += "</font>"; 439 mText += "</font>";
429 } else { 440 } else {
430 mText.append(i18n("<p><i>%1 % completed</i></p>") 441 mText.append(i18n("<p><i>%1 % completed</i></p>")
431 .arg(event->percentComplete())); 442 .arg(event->percentComplete()));
432 } 443 }
433 444
434 if (event->cancelled ()) { 445 if (event->cancelled ()) {
435 mText +="<font color=\"#B00000\">"; 446 mText +="<font color=\"#B00000\">";
436 addTag("i",i18n("This todo has been cancelled!")); 447 addTag("i",i18n("This todo has been cancelled!"));
437 mText.append("<br>"); 448 mText.append("<br>");
438 mText += "</font>"; 449 mText += "</font>";
439 mMailSubject += i18n("(cancelled)"); 450 mMailSubject += i18n("(cancelled)");
440 } 451 }
441 452
442 if (!event->location().isEmpty()) { 453 if (!event->location().isEmpty()) {
443 addTag("b",i18n("Location: ")); 454 addTag("b",i18n("Location: "));
444 mText.append(deTag(event->location())+"<br>"); 455 mText.append(deTag(event->location())+"<br>");
445 mMailSubject += i18n(" at ") + event->location(); 456 mMailSubject += i18n(" at ") + event->location();
446 } 457 }
447 458
448 if (event->recurrence()->doesRecur()) { 459 if (event->recurrence()->doesRecur()) {
449 460
450 QString recurText = event->recurrence()->recurrenceText(); 461 QString recurText = event->recurrence()->recurrenceText();
451 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); 462 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
452 463
453 } 464 }
454 if (event->hasStartDate()) { 465 if (event->hasStartDate()) {
455 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); 466 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
456 } 467 }
457 if (event->hasDueDate()) { 468 if (event->hasDueDate()) {
458 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); 469 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
459 mMailSubject += i18n(" - " )+event->dtDueStr( true ); 470 mMailSubject += i18n(" - " )+event->dtDueStr( true );
460 } 471 }
461 addTag("b",i18n("Access: ")); 472 addTag("b",i18n("Access: "));
462 mText.append(event->secrecyStr()+"<br>"); 473 mText.append(event->secrecyStr()+"<br>");
463 if ( KOPrefs::instance()->mEVshowDetails ) { 474 if ( KOPrefs::instance()->mEVshowDetails ) {
464 if (!event->description().isEmpty()) { 475 if (!event->description().isEmpty()) {
465 addTag("p",i18n("<b>Details: </b>")); 476 addTag("p",i18n("<b>Details: </b>"));
466 addTag("p",deTag(event->description())); 477 addTag("p",deTag(event->description()));
467 } 478 }
468 } 479 }
469 480
470 formatCategories(event); 481 formatCategories(event);
471 482
472 mText.append(i18n("<p><b>Priority:</b> %2</p>") 483 mText.append(i18n("<p><b>Priority:</b> %2</p>")
473 .arg(QString::number(event->priority()))); 484 .arg(QString::number(event->priority())));
474 485
475 formatReadOnly(event); 486 formatReadOnly(event);
476 formatAttendees(event); 487 formatAttendees(event);
477 if ( event->relatedTo() ) { 488 if ( event->relatedTo() ) {
478 addTag("b",i18n("Parent todo:<br>")); 489 addTag("b",i18n("Parent todo:<br>"));
479 mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); 490 mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>");
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h
index ca5bc15..6ecc233 100644
--- a/korganizer/koeventviewer.h
+++ b/korganizer/koeventviewer.h
@@ -1,78 +1,131 @@
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#ifndef KOEVENTVIEWER_H 19#ifndef KOEVENTVIEWER_H
20#define KOEVENTVIEWER_H 20#define KOEVENTVIEWER_H
21// 21//
22// Viewer widget for events. 22// Viewer widget for events.
23// 23//
24 24
25#include <qtextbrowser.h> 25#include <qtextbrowser.h>
26 26
27#include <libkcal/event.h> 27#include <libkcal/event.h>
28#include <libkcal/journal.h> 28#include <libkcal/journal.h>
29 29
30 30
31using namespace KCal; 31using namespace KCal;
32 32
33#ifdef DESKTOP_VERSION
34
35#include <qradiobutton.h>
36#include <qpushbutton.h>
37#include <qlayout.h>
38#include <qdialog.h>
39#include <qlabel.h>
40#include <qbuttongroup.h>
41#include <kglobal.h>
42
43class KOPrintPrefs : public QDialog
44{
45 public:
46 KOPrintPrefs( QWidget *parent=0, const char *name=0 ) :
47 QDialog( parent, name, true )
48 {
49 setCaption( i18n("KO/Pi Printout") );
50 QVBoxLayout* lay = new QVBoxLayout( this );
51 lay->setSpacing( 3 );
52 lay->setMargin( 3 );
53 QLabel * lab = new QLabel( i18n("This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog."), this );
54 lay->addWidget( lab );
55 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Printout Mode"), this );
56 lay->addWidget( format );
57 format->setExclusive ( true ) ;
58 pmNo = new QRadioButton(i18n("Print unscaled"), format );
59 pmScaledDown = new QRadioButton(i18n("Print scaled down to fit one page"), format );
60 new QRadioButton(i18n("Print scaled up/down to fit one page"), format );
61 pmScaledDown->setChecked( true );
62 QPushButton * ok = new QPushButton( i18n("OK"), this );
63 lay->addWidget( ok );
64 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
65 lay->addWidget( cancel );
66 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
67 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
68 resize( 200, 200 );
69 }
70
71 int printMode()
72 {
73 if ( pmNo->isChecked() )
74 return 0;
75 if ( pmScaledDown->isChecked() )
76 return 1;
77 return 2;
78 }
79private:
80 QRadioButton* pmNo;
81 QRadioButton* pmScaledDown;
82};
83
84#endif
85
33class KOEventViewer : public QTextBrowser { 86class KOEventViewer : public QTextBrowser {
34 Q_OBJECT 87 Q_OBJECT
35 public: 88 public:
36 KOEventViewer(QWidget *parent=0,const char *name=0); 89 KOEventViewer(QWidget *parent=0,const char *name=0);
37 virtual ~KOEventViewer(); 90 virtual ~KOEventViewer();
38 91
39 void setSource(const QString &); 92 void setSource(const QString &);
40 void setEvent(Event *event); 93 void setEvent(Event *event);
41 void addEvent(Event *event); 94 void addEvent(Event *event);
42 void setTodo(Todo *event, bool clearV = true ); 95 void setTodo(Todo *event, bool clearV = true );
43 void setJournal(Journal *jour, bool clearV = true ); 96 void setJournal(Journal *jour, bool clearV = true );
44 97
45 void appendEvent(Event *event, int mode = 0 ); 98 void appendEvent(Event *event, int mode = 0 );
46 void appendTodo(Todo *event, int mode = 0 ); 99 void appendTodo(Todo *event, int mode = 0 );
47 void appendJournal(Journal *jour, int mode = 0 ); 100 void appendJournal(Journal *jour, int mode = 0 );
48 101
49 void clearEvents(bool now=false); 102 void clearEvents(bool now=false);
50 103
51 void addText(QString text); 104 void addText(QString text);
52 void setSyncMode( bool ); 105 void setSyncMode( bool );
53 void setColorMode( int ); 106 void setColorMode( int );
54 void mailToAttendees( bool all ); 107 void mailToAttendees( bool all );
55 void printMe(); 108 void printMe();
56 109
57 protected: 110 protected:
58 int mColorMode; 111 int mColorMode;
59 void addTag(const QString & tag,const QString & text); 112 void addTag(const QString & tag,const QString & text);
60 113
61 void formatCategories(Incidence *event); 114 void formatCategories(Incidence *event);
62 void formatAttendees(Incidence *event); 115 void formatAttendees(Incidence *event);
63 void formatReadOnly(Incidence *event); 116 void formatReadOnly(Incidence *event);
64 void keyPressEvent ( QKeyEvent * e ); 117 void keyPressEvent ( QKeyEvent * e );
65 118
66 private: 119 private:
67 QTextBrowser *mEventTextView; 120 QTextBrowser *mEventTextView;
68 bool mSyncMode; 121 bool mSyncMode;
69 QString deTag(QString text); 122 QString deTag(QString text);
70 123
71 QString mText; 124 QString mText;
72 QString mMailSubject; 125 QString mMailSubject;
73 Incidence* mCurrentIncidence; 126 Incidence* mCurrentIncidence;
74 signals: 127 signals:
75 void launchaddressbook(QString uid); 128 void launchaddressbook(QString uid);
76}; 129};
77 130
78#endif 131#endif
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index ec55cca..35d084d 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -1,316 +1,308 @@
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 19
20#include <klocale.h> 20#include <klocale.h>
21 21
22#include <libkcal/event.h> 22#include <libkcal/event.h>
23#include <qtimer.h> 23#include <qtimer.h>
24#include <qpushbutton.h> 24#include <qpushbutton.h>
25 25
26#include "koeventviewer.h" 26#include "koeventviewer.h"
27#include <kmessagebox.h> 27#include <kmessagebox.h>
28#include "koprefs.h" 28#include "koprefs.h"
29#include <libkcal/todo.h> 29#include <libkcal/todo.h>
30#include "qapp.h" 30#include "qapp.h"
31 31
32#include "koeventviewerdialog.h" 32#include "koeventviewerdialog.h"
33extern int globalFlagBlockAgenda; 33extern int globalFlagBlockAgenda;
34 34
35KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) 35KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name)
36 : KDialogBase(parent,name, 36 : KDialogBase(parent,name,
37#ifndef DESKTOP_VERSION 37#ifndef DESKTOP_VERSION
38 true , 38 true ,
39#else 39#else
40 false, 40 false,
41#endif 41#endif
42 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda")) 42 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda"))
43{ 43{
44 sendSignalViewerClosed = true; 44 sendSignalViewerClosed = true;
45 mEventViewer = new KOEventViewer(this); 45 mEventViewer = new KOEventViewer(this);
46 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 46 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
47 setMainWidget(mEventViewer); 47 setMainWidget(mEventViewer);
48 setButtonText(Ok, i18n("Edit") ); 48 setButtonText(Ok, i18n("Edit") );
49 49
50 QObject::connect(findButton( Ok ),SIGNAL(clicked()), 50 QObject::connect(findButton( Ok ),SIGNAL(clicked()),
51 SLOT(editIncidence())); 51 SLOT(editIncidence()));
52 QObject::connect(this,SIGNAL(user1Clicked()), 52 QObject::connect(this,SIGNAL(user1Clicked()),
53 SLOT(showIncidence())); 53 SLOT(showIncidence()));
54 mIncidence = 0; 54 mIncidence = 0;
55 // TODO: Set a sensible size (based on the content?). 55 // TODO: Set a sensible size (based on the content?).
56 //showMaximized(); 56 //showMaximized();
57 //qDebug("++++++++++++KOEventViewerDialog() "); 57 //qDebug("++++++++++++KOEventViewerDialog() ");
58 // if ( KOPrefs::instance()->mCompactDialogs ) { 58 // if ( KOPrefs::instance()->mCompactDialogs ) {
59// setFixedSize( 240,284 ); 59// setFixedSize( 240,284 );
60// move( 0, 15 ); 60// move( 0, 15 );
61// } else { 61// } else {
62// setMinimumSize(300,200); 62// setMinimumSize(300,200);
63// resize(320,300); 63// resize(320,300);
64// } 64// }
65 mSyncMode = false; 65 mSyncMode = false;
66 mSyncResult = 0; 66 mSyncResult = 0;
67 67
68} 68}
69 69
70KOEventViewerDialog::~KOEventViewerDialog() 70KOEventViewerDialog::~KOEventViewerDialog()
71{ 71{
72 //qDebug("-------~KOEventViewerDialog() "); 72 //qDebug("-------~KOEventViewerDialog() ");
73} 73}
74void KOEventViewerDialog::showMe() 74void KOEventViewerDialog::showMe()
75{ 75{
76 76
77#ifdef DESKTOP_VERSION 77#ifdef DESKTOP_VERSION
78 int x,y,w,h; 78 int x,y,w,h;
79 x = geometry().x(); 79 x = geometry().x();
80 y = geometry().y(); 80 y = geometry().y();
81 w = width(); 81 w = width();
82 h = height(); 82 h = height();
83 show(); 83 show();
84 setGeometry(x,y,w,h); 84 setGeometry(x,y,w,h);
85#else 85#else
86 showMaximized(); 86 showMaximized();
87#endif 87#endif
88 raise(); 88 raise();
89 setActiveWindow(); 89 setActiveWindow();
90 mEventViewer->setFocus(); 90 mEventViewer->setFocus();
91 //raise(); 91 //raise();
92 92
93} 93}
94void KOEventViewerDialog::print() 94void KOEventViewerDialog::print()
95{ 95{
96 qDebug("PRINT ");
97 int km = KMessageBox::warningContinueCancel(this,mIncidence->summary().left(35) +
98 i18n("\n\nDo you really want to print this item?"),
99 i18n("KO/Pi Print Confirmation"),i18n("Print"));
100 if ( km != KMessageBox::Continue ) {
101 qDebug("cancel ");
102 return;
103 }
104 mEventViewer->printMe(); 96 mEventViewer->printMe();
105 97
106} 98}
107void KOEventViewerDialog::setSyncMode( bool b ) 99void KOEventViewerDialog::setSyncMode( bool b )
108{ 100{
109 mSyncMode = b; 101 mSyncMode = b;
110 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); 102 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode );
111 if ( mSyncMode ) { 103 if ( mSyncMode ) {
112 findButton( Close )->setText( i18n("Cancel Sync")); 104 findButton( Close )->setText( i18n("Cancel Sync"));
113 findButton( Ok )->setText( i18n("Remote")); 105 findButton( Ok )->setText( i18n("Remote"));
114 findButton( User1 )->setText( i18n("Local")); 106 findButton( User1 )->setText( i18n("Local"));
115 } else { 107 } else {
116 findButton( Close )->setText( i18n("Close")); 108 findButton( Close )->setText( i18n("Close"));
117 findButton( Ok )->setText( i18n("Edit")); 109 findButton( Ok )->setText( i18n("Edit"));
118 findButton( User1 )->setText( i18n("Agenda")); 110 findButton( User1 )->setText( i18n("Agenda"));
119 } 111 }
120 mEventViewer->setSyncMode( b ); 112 mEventViewer->setSyncMode( b );
121} 113}
122void KOEventViewerDialog::setColorMode( int m ) 114void KOEventViewerDialog::setColorMode( int m )
123{ 115{
124 mEventViewer->setColorMode( m ); 116 mEventViewer->setColorMode( m );
125} 117}
126int KOEventViewerDialog::executeS( bool local ) 118int KOEventViewerDialog::executeS( bool local )
127{ 119{
128 mSyncResult = 3; 120 mSyncResult = 3;
129 if ( local ) 121 if ( local )
130 findButton( User1 )->setFocus(); 122 findButton( User1 )->setFocus();
131 else 123 else
132 findButton( Ok )->setFocus(); 124 findButton( Ok )->setFocus();
133 exec(); 125 exec();
134 return mSyncResult; 126 return mSyncResult;
135} 127}
136 128
137void KOEventViewerDialog::updateConfig() 129void KOEventViewerDialog::updateConfig()
138{ 130{
139 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 131 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
140 132
141} 133}
142void KOEventViewerDialog::setEvent(Event *event) 134void KOEventViewerDialog::setEvent(Event *event)
143{ 135{
144 mEventViewer->setEvent(event); 136 mEventViewer->setEvent(event);
145 mIncidence = event; 137 mIncidence = event;
146 mEventViewer->setFocus(); 138 mEventViewer->setFocus();
147 //findButton( Close )->setFocus(); 139 //findButton( Close )->setFocus();
148 if ( !mSyncMode ) { 140 if ( !mSyncMode ) {
149 findButton( User1 )->setText( i18n("Agenda")); 141 findButton( User1 )->setText( i18n("Agenda"));
150 } 142 }
151} 143}
152void KOEventViewerDialog::setIncidence(Incidence *in ) 144void KOEventViewerDialog::setIncidence(Incidence *in )
153{ 145{
154 if ( in->type() == "Event" ) 146 if ( in->type() == "Event" )
155 setEvent( (Event*) in ); 147 setEvent( (Event*) in );
156 else if ( in->type() =="Todo" ) 148 else if ( in->type() =="Todo" )
157 setTodo( (Todo*) in ); 149 setTodo( (Todo*) in );
158 else if ( in->type() =="Journal" ) 150 else if ( in->type() =="Journal" )
159 setJournal( (Journal*) in ); 151 setJournal( (Journal*) in );
160} 152}
161void KOEventViewerDialog::addIncidence(Incidence *in) 153void KOEventViewerDialog::addIncidence(Incidence *in)
162{ 154{
163 if ( in->type() == "Event" ) 155 if ( in->type() == "Event" )
164 addEvent( (Event*) in ); 156 addEvent( (Event*) in );
165 else if ( in->type() =="Todo" ) 157 else if ( in->type() =="Todo" )
166 mEventViewer->setTodo( (Todo*) in, false ); 158 mEventViewer->setTodo( (Todo*) in, false );
167 else if ( in->type() =="Journal" ) 159 else if ( in->type() =="Journal" )
168 mEventViewer->setJournal( (Journal*) in, false ); 160 mEventViewer->setJournal( (Journal*) in, false );
169 if ( mSyncMode ) { 161 if ( mSyncMode ) {
170 findButton( User1 )->setFocus(); 162 findButton( User1 )->setFocus();
171 setCaption(i18n("Conflict! Please choose entry")); 163 setCaption(i18n("Conflict! Please choose entry"));
172 } 164 }
173} 165}
174 166
175void KOEventViewerDialog::addEvent(Event *event) 167void KOEventViewerDialog::addEvent(Event *event)
176{ 168{
177 mEventViewer->addEvent(event); 169 mEventViewer->addEvent(event);
178 mIncidence = event; 170 mIncidence = event;
179 mEventViewer->setFocus(); 171 mEventViewer->setFocus();
180 //findButton( Close )->setFocus(); 172 //findButton( Close )->setFocus();
181 if ( !mSyncMode ) { 173 if ( !mSyncMode ) {
182 findButton( User1 )->setText( i18n("Agenda")); 174 findButton( User1 )->setText( i18n("Agenda"));
183 } 175 }
184} 176}
185 177
186void KOEventViewerDialog::setTodo(Todo *event) 178void KOEventViewerDialog::setTodo(Todo *event)
187{ 179{
188 mEventViewer->setTodo(event); 180 mEventViewer->setTodo(event);
189 mIncidence = (Incidence*)event; 181 mIncidence = (Incidence*)event;
190 mEventViewer->setFocus(); 182 mEventViewer->setFocus();
191 //findButton( Close )->setFocus(); 183 //findButton( Close )->setFocus();
192 if ( !mSyncMode ) { 184 if ( !mSyncMode ) {
193 findButton( User1 )->setText( i18n("Set complete")); 185 findButton( User1 )->setText( i18n("Set complete"));
194 } 186 }
195} 187}
196void KOEventViewerDialog::setJournal(Journal *j) 188void KOEventViewerDialog::setJournal(Journal *j)
197{ 189{
198 mEventViewer->setJournal(j); 190 mEventViewer->setJournal(j);
199 mIncidence = (Incidence*)j; 191 mIncidence = (Incidence*)j;
200 mEventViewer->setFocus(); 192 mEventViewer->setFocus();
201 //findButton( Close )->setFocus(); 193 //findButton( Close )->setFocus();
202 if ( !mSyncMode ) { 194 if ( !mSyncMode ) {
203 findButton( User1 )->setText( i18n("Agenda")); 195 findButton( User1 )->setText( i18n("Agenda"));
204 } 196 }
205} 197}
206 198
207void KOEventViewerDialog::addText(QString text) 199void KOEventViewerDialog::addText(QString text)
208{ 200{
209 mEventViewer->addText(text); 201 mEventViewer->addText(text);
210 mEventViewer->setFocus(); 202 mEventViewer->setFocus();
211 //findButton( Close )->setFocus(); 203 //findButton( Close )->setFocus();
212} 204}
213void KOEventViewerDialog::editIncidence() 205void KOEventViewerDialog::editIncidence()
214{ 206{
215 sendSignalViewerClosed = false; 207 sendSignalViewerClosed = false;
216 if ( mSyncMode ) { 208 if ( mSyncMode ) {
217 mSyncResult = 2; 209 mSyncResult = 2;
218 accept(); 210 accept();
219 return; 211 return;
220 } 212 }
221 if ( mIncidence ){ 213 if ( mIncidence ){
222#ifndef DESKTOP_VERSION 214#ifndef DESKTOP_VERSION
223 hide(); 215 hide();
224#endif 216#endif
225 emit editIncidence( mIncidence ); 217 emit editIncidence( mIncidence );
226 } 218 }
227} 219}
228void KOEventViewerDialog::showIncidence() 220void KOEventViewerDialog::showIncidence()
229{ 221{
230 sendSignalViewerClosed = false; 222 sendSignalViewerClosed = false;
231 if ( mSyncMode ) { 223 if ( mSyncMode ) {
232 mSyncResult = 1; 224 mSyncResult = 1;
233 accept(); 225 accept();
234 return; 226 return;
235 } 227 }
236 228
237 if ( mIncidence ){ 229 if ( mIncidence ){
238#ifndef DESKTOP_VERSION 230#ifndef DESKTOP_VERSION
239 hide(); 231 hide();
240#endif 232#endif
241 QDate date; 233 QDate date;
242 if ( mIncidence->type() == "Todo" ) { 234 if ( mIncidence->type() == "Todo" ) {
243 /* 235 /*
244 if ( ((Todo*)mIncidence)->hasDueDate() ) 236 if ( ((Todo*)mIncidence)->hasDueDate() )
245 date = ((Todo*)mIncidence)->dtDue().date(); 237 date = ((Todo*)mIncidence)->dtDue().date();
246 else { 238 else {
247 globalFlagBlockAgenda = 2; 239 globalFlagBlockAgenda = 2;
248 emit showAgendaView( false ); 240 emit showAgendaView( false );
249 return; 241 return;
250 } 242 }
251 */ 243 */
252 ((Todo*)mIncidence)->setCompleted( true ); 244 ((Todo*)mIncidence)->setCompleted( true );
253 ((Todo*)mIncidence)->setCompleted(QDateTime::currentDateTime() ); 245 ((Todo*)mIncidence)->setCompleted(QDateTime::currentDateTime() );
254 hide(); 246 hide();
255 emit todoCompleted(((Todo*)mIncidence)); 247 emit todoCompleted(((Todo*)mIncidence));
256 return; 248 return;
257 249
258 } else 250 } else
259 date = mIncidence->dtStart().date(); 251 date = mIncidence->dtStart().date();
260 globalFlagBlockAgenda = 1; 252 globalFlagBlockAgenda = 1;
261 emit showAgendaView( false ); 253 emit showAgendaView( false );
262 globalFlagBlockAgenda = 2; 254 globalFlagBlockAgenda = 2;
263 emit jumpToTime( date ); 255 emit jumpToTime( date );
264 } 256 }
265} 257}
266void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) 258void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
267{ 259{
268 switch ( e->key() ) { 260 switch ( e->key() ) {
269 261
270 case Qt::Key_A : 262 case Qt::Key_A :
271 case Qt::Key_L : 263 case Qt::Key_L :
272 showIncidence(); 264 showIncidence();
273 break; 265 break;
274 case Qt::Key_E : 266 case Qt::Key_E :
275 case Qt::Key_R : 267 case Qt::Key_R :
276 editIncidence(); 268 editIncidence();
277 break; 269 break;
278 case Qt::Key_C: 270 case Qt::Key_C:
279 case Qt::Key_Escape: 271 case Qt::Key_Escape:
280 sendSignalViewerClosed = true; 272 sendSignalViewerClosed = true;
281 close(); 273 close();
282 break; 274 break;
283 case Qt::Key_I: 275 case Qt::Key_I:
284#ifndef DESKTOP_VERSION 276#ifndef DESKTOP_VERSION
285 sendSignalViewerClosed = true; 277 sendSignalViewerClosed = true;
286 close(); 278 close();
287#else 279#else
288 sendSignalViewerClosed = true; 280 sendSignalViewerClosed = true;
289 slotViewerClosed(); 281 slotViewerClosed();
290 //accept(); 282 //accept();
291#endif 283#endif
292 break; 284 break;
293 default: 285 default:
294 KDialogBase::keyPressEvent ( e ); 286 KDialogBase::keyPressEvent ( e );
295 break; 287 break;
296 } 288 }
297 289
298} 290}
299void KOEventViewerDialog::hideEvent ( QHideEvent * e ) 291void KOEventViewerDialog::hideEvent ( QHideEvent * e )
300{ 292{
301 KDialogBase::hideEvent ( e ); 293 KDialogBase::hideEvent ( e );
302 QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) ); 294 QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) );
303} 295}
304 296
305void KOEventViewerDialog::slotViewerClosed() 297void KOEventViewerDialog::slotViewerClosed()
306{ 298{
307 if ( mSyncMode ) 299 if ( mSyncMode )
308 return; 300 return;
309 301
310 if ( sendSignalViewerClosed ) { 302 if ( sendSignalViewerClosed ) {
311 //qDebug("KOEventViewerDialog::hideEvent "); 303 //qDebug("KOEventViewerDialog::hideEvent ");
312 emit signalViewerClosed(); 304 emit signalViewerClosed();
313 } 305 }
314 sendSignalViewerClosed = true; 306 sendSignalViewerClosed = true;
315} 307}
316 308
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 66ff75d..53fe7d0 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -1,465 +1,475 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <qlayout.h> 20#include <qlayout.h>
21#include <qtextbrowser.h> 21#include <qtextbrowser.h>
22#include <qtextcodec.h> 22#include <qtextcodec.h>
23#include <qfileinfo.h> 23#include <qfileinfo.h>
24#include <qlabel.h> 24#include <qlabel.h>
25 25
26#include <qapplication.h> 26#include <qapplication.h>
27#ifdef DESKTOP_VERSION 27#ifdef DESKTOP_VERSION
28#include <qpaintdevicemetrics.h> 28#include <qpaintdevicemetrics.h>
29#endif 29#endif
30#include <kglobal.h> 30#include <kglobal.h>
31#include <klocale.h> 31#include <klocale.h>
32#include <kdebug.h> 32#include <kdebug.h>
33#include <kiconloader.h> 33#include <kiconloader.h>
34#include <kmessagebox.h> 34#include <kmessagebox.h>
35 35
36#include <libkcal/calendar.h> 36#include <libkcal/calendar.h>
37 37
38#ifndef KORG_NOPRINTER 38#ifndef KORG_NOPRINTER
39#include "calprinter.h" 39#include "calprinter.h"
40#endif 40#endif
41#include "koglobals.h" 41#include "koglobals.h"
42#include "koprefs.h" 42#include "koprefs.h"
43#include "koeventviewerdialog.h" 43#include "koeventviewerdialog.h"
44#include "koeventviewer.h"
44#include <qstylesheet.h> 45#include <qstylesheet.h>
45#include "kowhatsnextview.h" 46#include "kowhatsnextview.h"
46using namespace KOrg; 47using namespace KOrg;
47 48
48void WhatsNextTextBrowser::setSource(const QString& n) 49void WhatsNextTextBrowser::setSource(const QString& n)
49{ 50{
50 51
51 if (n.startsWith("event:")) { 52 if (n.startsWith("event:")) {
52 emit showIncidence(n); 53 emit showIncidence(n);
53 return; 54 return;
54 } else if (n.startsWith("todo:")) { 55 } else if (n.startsWith("todo:")) {
55 emit showIncidence(n); 56 emit showIncidence(n);
56 return; 57 return;
57 } else { 58 } else {
58 QTextBrowser::setSource(n); 59 QTextBrowser::setSource(n);
59 } 60 }
60} 61}
61void WhatsNextTextBrowser::printMe() 62void WhatsNextTextBrowser::printMe()
62{ 63{
63#ifdef DESKTOP_VERSION 64#ifdef DESKTOP_VERSION
65 KOPrintPrefs pp ( this );
66 if (!pp.exec() )
67 return;
68 int scaleval = pp.printMode() ;
69
64 QPrinter printer; 70 QPrinter printer;
65 if (!printer.setup() ) 71 if (!printer.setup() )
66 return; 72 return;
67 QPainter p; 73 QPainter p;
68 p.begin ( &printer ); 74 p.begin ( &printer );
69 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 75 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
70 float dx, dy; 76 float dx, dy;
71 int wid = (m.width() * 9)/10; 77 int wid = (m.width() * 9)/10;
72 dx = (float) wid/(float)contentsWidth (); 78 dx = (float) wid/(float)contentsWidth ();
73 dy = (float)(m.height()) / (float)contentsHeight (); 79 dy = (float)(m.height()) / (float)contentsHeight ();
74 float scale; 80 float scale;
75 // scale to fit the width or height of the paper 81 // scale to fit the width or height of the paper
76 if ( dx < dy ) 82 if ( dx < dy )
77 scale = dx; 83 scale = dx;
78 else 84 else
79 scale = dy; 85 scale = dy;
80 p.translate( m.width()/10,0 ); 86 p.translate( m.width()/10,0 );
81 p.scale( scale, scale ); 87 qDebug("Scale: %f ", scale );
88 if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) {
89 qDebug("SCALE ");
90 p.scale( scale, scale );
91 }
82 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); 92 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
83 p.end(); 93 p.end();
84#endif 94#endif
85} 95}
86 96
87KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, 97KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent,
88 const char *name) 98 const char *name)
89 : KOrg::BaseView(calendar, parent, name) 99 : KOrg::BaseView(calendar, parent, name)
90{ 100{
91 // mDateLabel = 101 // mDateLabel =
92 // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); 102 // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this);
93 // mDateLabel->setMargin(2); 103 // mDateLabel->setMargin(2);
94 // mDateLabel->setAlignment(AlignCenter); 104 // mDateLabel->setAlignment(AlignCenter);
95 setFont( KOPrefs::instance()->mWhatsNextFont ); 105 setFont( KOPrefs::instance()->mWhatsNextFont );
96 mView = new WhatsNextTextBrowser(this); 106 mView = new WhatsNextTextBrowser(this);
97 connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); 107 connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &)));
98 QStyleSheet* stsh = mView->styleSheet(); 108 QStyleSheet* stsh = mView->styleSheet();
99 QStyleSheetItem * style ; 109 QStyleSheetItem * style ;
100 style = stsh->item ("h2" ); 110 style = stsh->item ("h2" );
101 if ( style ) { 111 if ( style ) {
102 style->setMargin(QStyleSheetItem::MarginAll,0); 112 style->setMargin(QStyleSheetItem::MarginAll,0);
103 } 113 }
104 style = stsh->item ("h3" ); 114 style = stsh->item ("h3" );
105 if ( style ) { 115 if ( style ) {
106 style->setMargin(QStyleSheetItem::MarginAll,0); 116 style->setMargin(QStyleSheetItem::MarginAll,0);
107 } 117 }
108 mEventViewer = 0; 118 mEventViewer = 0;
109 119
110 QBoxLayout *topLayout = new QVBoxLayout(this); 120 QBoxLayout *topLayout = new QVBoxLayout(this);
111 // topLayout->addWidget(mDateLabel); 121 // topLayout->addWidget(mDateLabel);
112 topLayout->addWidget(mView); 122 topLayout->addWidget(mView);
113 mTimer = new QTimer( this ); 123 mTimer = new QTimer( this );
114 connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); 124 connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView()));
115 125
116 connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); 126 connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
117 connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); 127 connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
118} 128}
119 129
120KOWhatsNextView::~KOWhatsNextView() 130KOWhatsNextView::~KOWhatsNextView()
121{ 131{
122} 132}
123 133
124int KOWhatsNextView::maxDatesHint() 134int KOWhatsNextView::maxDatesHint()
125{ 135{
126 return 0; 136 return 0;
127} 137}
128 138
129int KOWhatsNextView::currentDateCount() 139int KOWhatsNextView::currentDateCount()
130{ 140{
131 return 0; 141 return 0;
132} 142}
133 143
134QPtrList<Incidence> KOWhatsNextView::selectedIncidences() 144QPtrList<Incidence> KOWhatsNextView::selectedIncidences()
135{ 145{
136 QPtrList<Incidence> eventList; 146 QPtrList<Incidence> eventList;
137 147
138 return eventList; 148 return eventList;
139} 149}
140 150
141void KOWhatsNextView::printMe() 151void KOWhatsNextView::printMe()
142{ 152{
143#ifdef DESKTOP_VERSION 153#ifdef DESKTOP_VERSION
144 mView->printMe(); 154 mView->printMe();
145#endif 155#endif
146} 156}
147void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd, 157void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd,
148 const QDate &td) 158 const QDate &td)
149{ 159{
150#ifndef KORG_NOPRINTER 160#ifndef KORG_NOPRINTER
151 calPrinter->preview(CalPrinter::Day, fd, td); 161 calPrinter->preview(CalPrinter::Day, fd, td);
152#endif 162#endif
153} 163}
154void KOWhatsNextView::updateConfig() 164void KOWhatsNextView::updateConfig()
155{ 165{
156 setFont( KOPrefs::instance()->mWhatsNextFont ); 166 setFont( KOPrefs::instance()->mWhatsNextFont );
157 updateView(); 167 updateView();
158 168
159} 169}
160void KOWhatsNextView::showEvent ( QShowEvent * e ) 170void KOWhatsNextView::showEvent ( QShowEvent * e )
161{ 171{
162 //qDebug("KOWhatsNextView::showEvent "); 172 //qDebug("KOWhatsNextView::showEvent ");
163 restartTimer(); 173 restartTimer();
164 QWidget::showEvent ( e ); 174 QWidget::showEvent ( e );
165} 175}
166void KOWhatsNextView::hideEvent ( QHideEvent * e) 176void KOWhatsNextView::hideEvent ( QHideEvent * e)
167{ 177{
168 //qDebug(" KOWhatsNextView::hideEvent"); 178 //qDebug(" KOWhatsNextView::hideEvent");
169 mTimer->stop(); 179 mTimer->stop();
170 QWidget::hideEvent ( e ); 180 QWidget::hideEvent ( e );
171} 181}
172void KOWhatsNextView::restartTimer() 182void KOWhatsNextView::restartTimer()
173{ 183{
174 //qDebug("KOWhatsNextView::restartTimer() "); 184 //qDebug("KOWhatsNextView::restartTimer() ");
175 mTimer->start( 300000 ); 185 mTimer->start( 300000 );
176 //mTimer->start( 5000 ); 186 //mTimer->start( 5000 );
177} 187}
178void KOWhatsNextView::updateView() 188void KOWhatsNextView::updateView()
179{ 189{
180 //qDebug("KOWhatsNextView::updateView() "); 190 //qDebug("KOWhatsNextView::updateView() ");
181 if ( mTimer->isActive() ) 191 if ( mTimer->isActive() )
182 restartTimer(); 192 restartTimer();
183 //qDebug("KOWhatsNextView::updateView() "); 193 //qDebug("KOWhatsNextView::updateView() ");
184 // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); 194 // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate()));
185 KIconLoader kil("korganizer"); 195 KIconLoader kil("korganizer");
186 QString ipath;// = new QString(); 196 QString ipath;// = new QString();
187 // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); 197 // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath);
188 //<big><big><strong>" + date + "</strong></big></big>\n"; 198 //<big><big><strong>" + date + "</strong></big></big>\n";
189 mText = "<table width=\"100%\">\n"; 199 mText = "<table width=\"100%\">\n";
190 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; 200 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
191#ifdef DESKTOP_VERSION 201#ifdef DESKTOP_VERSION
192 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>"; 202 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>";
193#else 203#else
194 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; 204 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
195#endif 205#endif
196 // mText += "<img src=\""; 206 // mText += "<img src=\"";
197 // mText += ipath; 207 // mText += ipath;
198 // mText += "\">"; 208 // mText += "\">";
199 mEventDate = QDate::currentDate(); 209 mEventDate = QDate::currentDate();
200#ifdef DESKTOP_VERSION 210#ifdef DESKTOP_VERSION
201 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>"; 211 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>";
202#else 212#else
203 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; 213 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>";
204#endif 214#endif
205 mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; 215 mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>";
206 int iii; 216 int iii;
207 mTodos.clear(); 217 mTodos.clear();
208 QPtrList<Event> events; 218 QPtrList<Event> events;
209 QPtrList<Todo> todos = calendar()->todos(); 219 QPtrList<Todo> todos = calendar()->todos();
210 Todo * todo; 220 Todo * todo;
211 //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; 221 //mText += "<h2>" + i18n("Events: ") + "</h2>\n";
212 int daysToShow = KOPrefs::instance()->mWhatsNextDays ; 222 int daysToShow = KOPrefs::instance()->mWhatsNextDays ;
213 bool itemAdded = false; 223 bool itemAdded = false;
214 for ( iii = 0; iii < daysToShow; ++iii ) { 224 for ( iii = 0; iii < daysToShow; ++iii ) {
215 QString date; 225 QString date;
216 itemAdded = false; 226 itemAdded = false;
217 events = calendar()->events( mEventDate, true ); 227 events = calendar()->events( mEventDate, true );
218 228
219 if ( iii == 0 ) { // today !!! 229 if ( iii == 0 ) { // today !!!
220 todo = todos.first(); 230 todo = todos.first();
221 while(todo) { 231 while(todo) {
222 if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() < mEventDate ) { 232 if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() < mEventDate ) {
223 if ( ! itemAdded ) { 233 if ( ! itemAdded ) {
224 appendDay ( iii, mEventDate ); 234 appendDay ( iii, mEventDate );
225 //itemAdded = true; 235 //itemAdded = true;
226 236
227 } //bool reply=false, bool notRed = true, bool appendTable = false); 237 } //bool reply=false, bool notRed = true, bool appendTable = false);
228 appendEvent(todo, false, false, !itemAdded ); 238 appendEvent(todo, false, false, !itemAdded );
229 itemAdded = true; 239 itemAdded = true;
230 } 240 }
231 todo = todos.next(); 241 todo = todos.next();
232 } 242 }
233 } 243 }
234 244
235 245
236 if (events.count() > 0) { 246 if (events.count() > 0) {
237 // mText += "<p></p>"; 247 // mText += "<p></p>";
238 // kil.loadIcon("month",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); 248 // kil.loadIcon("month",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
239 // mText += "<h2>"; 249 // mText += "<h2>";
240 //mText += " <img src=\""; 250 //mText += " <img src=\"";
241 //mText += ipath; 251 //mText += ipath;
242 //mText += "\">"; 252 //mText += "\">";
243 if ( ! itemAdded ) { 253 if ( ! itemAdded ) {
244 appendDay ( iii, mEventDate ); 254 appendDay ( iii, mEventDate );
245 255
246 } 256 }
247 // for first day (iii == 0) 257 // for first day (iii == 0)
248 // we may have syncevents, or events in the past, which maybe should not be diaplayed 258 // we may have syncevents, or events in the past, which maybe should not be diaplayed
249 // for that reason we cannot append <table> in appendDay () for iii == 0 259 // for that reason we cannot append <table> in appendDay () for iii == 0
250 // we must append it in the first successful call of appendEvent() 260 // we must append it in the first successful call of appendEvent()
251 Event *ev = events.first(); 261 Event *ev = events.first();
252 while(ev) { 262 while(ev) {
253 //qDebug("+++++event append %s", ev->summary().latin1()); 263 //qDebug("+++++event append %s", ev->summary().latin1());
254 if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) { 264 if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) {
255 if ( appendEvent(ev, false , iii!= 0,!itemAdded ) ) 265 if ( appendEvent(ev, false , iii!= 0,!itemAdded ) )
256 itemAdded = true; 266 itemAdded = true;
257 } 267 }
258 ev = events.next(); 268 ev = events.next();
259 } 269 }
260 270
261 //mText += "</table>\n"; 271 //mText += "</table>\n";
262 } 272 }
263 273
264 todo = todos.first(); 274 todo = todos.first();
265 while(todo) { 275 while(todo) {
266 if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() == mEventDate ) { 276 if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() == mEventDate ) {
267 if ( ! itemAdded ) { 277 if ( ! itemAdded ) {
268 appendDay ( iii, mEventDate ); 278 appendDay ( iii, mEventDate );
269 //itemAdded = true; 279 //itemAdded = true;
270 } 280 }
271 appendEvent(todo, false , iii!= 0,!itemAdded); 281 appendEvent(todo, false , iii!= 0,!itemAdded);
272 itemAdded = true; 282 itemAdded = true;
273 } 283 }
274 todo = todos.next(); 284 todo = todos.next();
275 } 285 }
276 if ( !itemAdded && iii == 0 ) { 286 if ( !itemAdded && iii == 0 ) {
277 // appendDay ( iii, mEventDate ); 287 // appendDay ( iii, mEventDate );
278 //mText += "<table>"; 288 //mText += "<table>";
279 // mText += "<b><font color=\"#000080\"><em>"+i18n("No event, nothing to do.") +"</em></font></b>\n"; 289 // mText += "<b><font color=\"#000080\"><em>"+i18n("No event, nothing to do.") +"</em></font></b>\n";
280 mText += "<h3 align=\"center\"><font color=\"#008000\"><em>"+i18n("No event, nothing to do.") +"</em></font></h3>\n"; 290 mText += "<h3 align=\"center\"><font color=\"#008000\"><em>"+i18n("No event, nothing to do.") +"</em></font></h3>\n";
281 //mText +="</table>"; 291 //mText +="</table>";
282 } 292 }
283 if ( itemAdded ) 293 if ( itemAdded )
284 mText += "</table>\n"; 294 mText += "</table>\n";
285 mEventDate = mEventDate.addDays( 1 ); 295 mEventDate = mEventDate.addDays( 1 );
286 } 296 }
287 297
288 int topmostPrios = KOPrefs::instance()->mWhatsNextPrios; 298 int topmostPrios = KOPrefs::instance()->mWhatsNextPrios;
289 if (todos.count() > 0 && topmostPrios > 0 ) { 299 if (todos.count() > 0 && topmostPrios > 0 ) {
290 // kil.loadIcon("todo",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); 300 // kil.loadIcon("todo",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
291 // mText += "<h2>"; 301 // mText += "<h2>";
292 //<img src=\""; 302 //<img src=\"";
293 // mText += ipath; 303 // mText += ipath;
294 // mText += "\">"; 304 // mText += "\">";
295 // mText += i18n("Overdue To-Do:") + "</h2>\n"; 305 // mText += i18n("Overdue To-Do:") + "</h2>\n";
296 306
297 //mText += "<ul>\n"; 307 //mText += "<ul>\n";
298 bool gotone = false; 308 bool gotone = false;
299 int priority = 1; 309 int priority = 1;
300 int priosFound = 0; 310 int priosFound = 0;
301#ifdef DESKTOP_VERSION 311#ifdef DESKTOP_VERSION
302 mText +="<p></p>"; 312 mText +="<p></p>";
303#endif 313#endif
304 314
305 mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n"; 315 mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n";
306 mText += "<ul>\n"; 316 mText += "<ul>\n";
307 while (!gotone && priority<6) { 317 while (!gotone && priority<6) {
308 todo = todos.first(); 318 todo = todos.first();
309 while(todo) { 319 while(todo) {
310 if (!todo->isCompleted() && (todo->priority() == priority) ) { 320 if (!todo->isCompleted() && (todo->priority() == priority) ) {
311 if ( appendTodo(todo) ) 321 if ( appendTodo(todo) )
312 gotone = true; 322 gotone = true;
313 } 323 }
314 todo = todos.next(); 324 todo = todos.next();
315 } 325 }
316 if ( gotone ) { 326 if ( gotone ) {
317 gotone = false; 327 gotone = false;
318 ++priosFound; 328 ++priosFound;
319 if ( priosFound == topmostPrios ) 329 if ( priosFound == topmostPrios )
320 break; 330 break;
321 } 331 }
322 priority++; 332 priority++;
323 // kdDebug() << "adding the todos..." << endl; 333 // kdDebug() << "adding the todos..." << endl;
324 } 334 }
325 mText += "</ul>\n"; 335 mText += "</ul>\n";
326 } 336 }
327 337
328 int replys = 0; 338 int replys = 0;
329 events = calendar()->events(QDate::currentDate(), QDate(2975,12,6)); 339 events = calendar()->events(QDate::currentDate(), QDate(2975,12,6));
330 if (events.count() > 0) { 340 if (events.count() > 0) {
331 Event *ev = events.first(); 341 Event *ev = events.first();
332 while(ev) { 342 while(ev) {
333 Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 343 Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
334 if (me!=0) { 344 if (me!=0) {
335 if (me->status()==Attendee::NeedsAction && me->RSVP()) { 345 if (me->status()==Attendee::NeedsAction && me->RSVP()) {
336 if (replys == 0) { 346 if (replys == 0) {
337 mText += "<p></p>"; 347 mText += "<p></p>";
338 // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); 348 // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
339 //mText += "<h2>"; 349 //mText += "<h2>";
340 //<img src=\""; 350 //<img src=\"";
341 // mText += ipath; 351 // mText += ipath;
342 // mText += "\">"; 352 // mText += "\">";
343 //mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n"; 353 //mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n";
344 mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n"; 354 mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n";
345 mText += "<table>\n"; 355 mText += "<table>\n";
346 } 356 }
347 replys++; 357 replys++;
348 appendEvent(ev,true); 358 appendEvent(ev,true);
349 } 359 }
350 } 360 }
351 ev = events.next(); 361 ev = events.next();
352 } 362 }
353 } 363 }
354 todos = calendar()->todos(); 364 todos = calendar()->todos();
355 if (todos.count() > 0) { 365 if (todos.count() > 0) {
356 Todo *to = todos.first(); 366 Todo *to = todos.first();
357 while(to) { 367 while(to) {
358 if ( !to->isCompleted() ){ 368 if ( !to->isCompleted() ){
359 Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 369 Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
360 if (me!=0) { 370 if (me!=0) {
361 if (me->status()==Attendee::NeedsAction && me->RSVP()) { 371 if (me->status()==Attendee::NeedsAction && me->RSVP()) {
362 if (replys == 0) { 372 if (replys == 0) {
363 mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n"; 373 mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n";
364 mText += "<table>\n"; 374 mText += "<table>\n";
365 } 375 }
366 replys++; 376 replys++;
367 appendEvent(to, true); 377 appendEvent(to, true);
368 } 378 }
369 } 379 }
370 } 380 }
371 to = todos.next(); 381 to = todos.next();
372 } 382 }
373 } 383 }
374 if (replys > 0 ) mText += "</table>\n"; 384 if (replys > 0 ) mText += "</table>\n";
375 385
376 386
377 mText += "</td></tr>\n</table>\n"; 387 mText += "</td></tr>\n</table>\n";
378 388
379 mView->setText(mText); 389 mView->setText(mText);
380 mView->setFocus(); 390 mView->setFocus();
381 391
382 // QPixmap bPix = SmallIcon( "back" ); 392 // QPixmap bPix = SmallIcon( "back" );
383 // qDebug("xxxxxxxxxxxxxxxxxxxxx "); 393 // qDebug("xxxxxxxxxxxxxxxxxxxxx ");
384 // QWidget* test = new QWidget(); 394 // QWidget* test = new QWidget();
385 // test->setBackgroundMode(FixedPixmap ); 395 // test->setBackgroundMode(FixedPixmap );
386 // test->setBackgroundPixmap ( bPix ); 396 // test->setBackgroundPixmap ( bPix );
387 // test->resize( 300, 400 ); 397 // test->resize( 300, 400 );
388 // test->show(); 398 // test->show();
389 // mView->setBackgroundMode(FixedPixmap ); 399 // mView->setBackgroundMode(FixedPixmap );
390 // mView->setBackgroundPixmap ( bPix ); 400 // mView->setBackgroundPixmap ( bPix );
391 // qDebug("%s ",mText.latin1()); 401 // qDebug("%s ",mText.latin1());
392} 402}
393 403
394void KOWhatsNextView::appendDay( int i, QDate eventDate ) 404void KOWhatsNextView::appendDay( int i, QDate eventDate )
395{ 405{
396 QString date; 406 QString date;
397 QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); 407 QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer);
398 if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { 408 if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) {
399 if ( i == 0 ) { 409 if ( i == 0 ) {
400 //mText += "<table>\n"; 410 //mText += "<table>\n";
401 return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; 411 return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>";
402 } 412 }
403 else if ( i == 1 ) 413 else if ( i == 1 )
404 date = "<em><font color=\"#000080\">" + day + "</font></em>" ; 414 date = "<em><font color=\"#000080\">" + day + "</font></em>" ;
405 else date = "<em><font color=\"#000080\">" + day + "</font></em>"; 415 else date = "<em><font color=\"#000080\">" + day + "</font></em>";
406 mText += "<h2>" + date + "</h2>\n"; 416 mText += "<h2>" + date + "</h2>\n";
407 //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; 417 //mText += "<big><big><strong>" + date + "</strong></big></big>\n";
408 mText += "<table>\n"; 418 mText += "<table>\n";
409 419
410 420
411 421
412 } else { 422 } else {
413 if ( i == 0 ) { 423 if ( i == 0 ) {
414 //mText += "<table>\n"; 424 //mText += "<table>\n";
415 return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>"; 425 return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>";
416 } 426 }
417 427
418#ifdef DESKTOP_VERSION 428#ifdef DESKTOP_VERSION
419 else if ( i == 1 ) { 429 else if ( i == 1 ) {
420 date = "<h2><em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em></h2>" ; 430 date = "<h2><em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em></h2>" ;
421 } 431 }
422 else date = "<h2><em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em></h2>"; 432 else date = "<h2><em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em></h2>";
423#else 433#else
424 else if ( i == 1 ) { 434 else if ( i == 1 ) {
425 date = "<em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em>" ; 435 date = "<em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em>" ;
426 } 436 }
427 else date = "<em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em>"; 437 else date = "<em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em>";
428 438
429#endif 439#endif
430 mText += "<h2>" + date + "</h2>\n"; 440 mText += "<h2>" + date + "</h2>\n";
431 //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; 441 //mText += "<big><big><strong>" + date + "</strong></big></big>\n";
432 mText += "<table>\n"; 442 mText += "<table>\n";
433 } 443 }
434} 444}
435 445
436 446
437void KOWhatsNextView::showDates(const QDate &, const QDate &) 447void KOWhatsNextView::showDates(const QDate &, const QDate &)
438{ 448{
439 updateView(); 449 updateView();
440} 450}
441 451
442void KOWhatsNextView::showEvents(QPtrList<Event>) 452void KOWhatsNextView::showEvents(QPtrList<Event>)
443{ 453{
444} 454}
445 455
446void KOWhatsNextView::changeEventDisplay(Event *, int action) 456void KOWhatsNextView::changeEventDisplay(Event *, int action)
447{ 457{
448 switch(action) { 458 switch(action) {
449 case KOGlobals::EVENTADDED: 459 case KOGlobals::EVENTADDED:
450 updateView(); 460 updateView();
451 break; 461 break;
452 case KOGlobals::EVENTEDITED: 462 case KOGlobals::EVENTEDITED:
453 updateView(); 463 updateView();
454 break; 464 break;
455 case KOGlobals::EVENTDELETED: 465 case KOGlobals::EVENTDELETED:
456 updateView(); 466 updateView();
457 break; 467 break;
458 default: 468 default:
459 updateView(); 469 updateView();
460 kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl; 470 kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl;
461 } 471 }
462} 472}
463 473
464bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable ) 474bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable )
465{ 475{