summaryrefslogtreecommitdiffabout
path: root/libkcal/kincidenceformatter.cpp
Unidiff
Diffstat (limited to 'libkcal/kincidenceformatter.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/kincidenceformatter.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index d1ace4f..9359fad 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -47,30 +47,32 @@ KIncidenceFormatter::KIncidenceFormatter()
47} 47}
48void KIncidenceFormatter::setEvent(Event *event) 48void KIncidenceFormatter::setEvent(Event *event)
49{ 49{
50 int mode = 0; 50 int mode = 0;
51 mCurrentIncidence = event; 51 mCurrentIncidence = event;
52 bool shortDate = true; 52 bool shortDate = true;
53 if ( mode == 0 ) { 53 if ( mode == 0 ) {
54 addTag("h3",deTag(event->summary())); 54 addTag("h3",deTag(event->summary()));
55 formatReadOnly(event);
55 } 56 }
56 else { 57 else {
57 if ( mColorMode == 1 ) { 58 if ( mColorMode == 1 ) {
58 mText +="<font color=\"#00A000\">"; 59 mText +="<font color=\"#00A000\">";
59 } 60 }
60 if ( mColorMode == 2 ) { 61 if ( mColorMode == 2 ) {
61 mText +="<font color=\"#C00000\">"; 62 mText +="<font color=\"#C00000\">";
62 } 63 }
63 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 64 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
64 if ( mode == 1 ) { 65 if ( mode == 1 ) {
65 addTag("h2",i18n( "Local: " ) +deTag(event->summary())); 66 addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
66 } else { 67 } else {
67 addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); 68 addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
68 } 69 }
70 formatReadOnly(event);
69 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 71 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
70 if ( mColorMode ) 72 if ( mColorMode )
71 mText += "</font>"; 73 mText += "</font>";
72 } 74 }
73 if (event->cancelled ()) { 75 if (event->cancelled ()) {
74 mText +="<font color=\"#B00000\">"; 76 mText +="<font color=\"#B00000\">";
75 addTag("i",i18n("This event has been cancelled!")); 77 addTag("i",i18n("This event has been cancelled!"));
76 mText.append("<br>"); 78 mText.append("<br>");
@@ -138,17 +140,16 @@ void KIncidenceFormatter::setEvent(Event *event)
138 } 140 }
139 141
140 142
141 143
142 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); 144 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
143 // mText.append(event->secrecyStr()+"<br>"); 145 // mText.append(event->secrecyStr()+"<br>");
144 formatCategories(event); 146 formatCategories(event);
145 147
146 formatReadOnly(event);
147 formatAttendees(event); 148 formatAttendees(event);
148 149
149 if ( mCreated ) { 150 if ( mCreated ) {
150#ifdef DESKTOP_VERSION 151#ifdef DESKTOP_VERSION
151 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); 152 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
152#else 153#else
153 addTag("p",i18n("<b>Created: ") +" </b>"); 154 addTag("p",i18n("<b>Created: ") +" </b>");
154 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); 155 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
@@ -173,30 +174,33 @@ void KIncidenceFormatter::setEvent(Event *event)
173 174
174} 175}
175 176
176void KIncidenceFormatter::setTodo(Todo *event ) 177void KIncidenceFormatter::setTodo(Todo *event )
177{ 178{
178 int mode = 0; 179 int mode = 0;
179 mCurrentIncidence = event; 180 mCurrentIncidence = event;
180 bool shortDate = true; 181 bool shortDate = true;
181 if (mode == 0 ) 182 if (mode == 0 ) {
182 addTag("h3",deTag(event->summary())); 183 addTag("h3",deTag(event->summary()));
184 formatReadOnly(event);
185 }
183 else { 186 else {
184 if ( mColorMode == 1 ) { 187 if ( mColorMode == 1 ) {
185 mText +="<font color=\"#00A000\">"; 188 mText +="<font color=\"#00A000\">";
186 } 189 }
187 if ( mColorMode == 2 ) { 190 if ( mColorMode == 2 ) {
188 mText +="<font color=\"#B00000\">"; 191 mText +="<font color=\"#B00000\">";
189 } 192 }
190 if ( mode == 1 ) { 193 if ( mode == 1 ) {
191 addTag("h2",i18n( "Local: " ) +deTag(event->summary())); 194 addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
192 } else { 195 } else {
193 addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); 196 addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
194 } 197 }
198 formatReadOnly(event);
195 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 199 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
196 if ( mColorMode ) 200 if ( mColorMode )
197 mText += "</font>"; 201 mText += "</font>";
198 } 202 }
199 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { 203 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
200 mText +="<font color=\"#B00000\">"; 204 mText +="<font color=\"#B00000\">";
201 addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(shortDate) ) ); 205 addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(shortDate) ) );
202 mText += "</font>"; 206 mText += "</font>";
@@ -242,17 +246,16 @@ void KIncidenceFormatter::setTodo(Todo *event )
242 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 246 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
243 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 247 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
244 //addTag("p",s); 248 //addTag("p",s);
245 } 249 }
246 250
247 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); 251 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
248 formatCategories(event); 252 formatCategories(event);
249 253
250 formatReadOnly(event);
251 formatAttendees(event); 254 formatAttendees(event);
252 if ( mCreated ) { 255 if ( mCreated ) {
253#ifdef DESKTOP_VERSION 256#ifdef DESKTOP_VERSION
254 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); 257 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
255#else 258#else
256 addTag("p",i18n("<b>Created: ") +" </b>"); 259 addTag("p",i18n("<b>Created: ") +" </b>");
257 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); 260 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
258#endif 261#endif