39 using namespace KCalCore;
43 #include <KSystemTimeZone>
45 using namespace KCalUtils;
46 using namespace Stringify;
52 return i18nc(
"@item incidence type is event",
"event" );
54 return i18nc(
"@item incidence type is to-do/task",
"to-do" );
56 return i18nc(
"@item incidence type is journal",
"journal" );
58 return i18nc(
"@item incidence type is freebusy",
"free/busy" );
67 return KGlobal::locale()->formatDateTime( todo->completed().dateTime(),
68 ( shortfmt ? KLocale::ShortDate :
69 KLocale::LongDate ) );
76 return i18nc(
"@item incidence access if for everyone",
"Public" );
78 return i18nc(
"@item incidence access is by owner only",
"Private" );
80 return i18nc(
"@item incidence access is by owner and a controlled group",
"Confidential" );
100 return i18nc(
"@item event is tentative",
"Tentative" );
102 return i18nc(
"@item event is definite",
"Confirmed" );
104 return i18nc(
"@item to-do is complete",
"Completed" );
106 return i18nc(
"@item to-do needs action",
"Needs-Action" );
108 return i18nc(
"@item event orto-do is canceled; journal is removed",
"Canceled" );
110 return i18nc(
"@item to-do is in process",
"In-Process" );
112 return i18nc(
"@item journal is in draft form",
"Draft" );
114 return i18nc(
"@item journal is in final form",
"Final" );
122 QString Stringify::incidenceStatus(
const Incidence::Ptr &incidence )
125 return incidence->customStatus();
127 return incidenceStatus( incidence->status() );
135 return i18nc(
"@item chairperson",
"Chair" );
139 return i18nc(
"@item participation is required",
"Participant" );
142 return i18nc(
"@item participation is optional",
"Optional Participant" );
145 return i18nc(
"@item non-participant copied for information",
"Observer" );
150 QStringList Stringify::attendeeRoleList()
166 return i18nc(
"@item event, to-do or journal needs action",
"Needs Action" );
169 return i18nc(
"@item event, to-do or journal accepted",
"Accepted" );
172 return i18nc(
"@item event, to-do or journal declined",
"Declined" );
175 return i18nc(
"@item event or to-do tentatively accepted",
"Tentative" );
178 return i18nc(
"@item event or to-do delegated",
"Delegated" );
181 return i18nc(
"@item to-do completed",
"Completed" );
184 return i18nc(
"@item to-do in process of being completed",
"In Process" );
187 return i18nc(
"@item event or to-do status unknown",
"Unknown" );
192 QStringList Stringify::attendeeStatusList()
208 if ( spec.isValid() ) {
211 if ( spec.timeZone() != KSystemTimeZones::local() ) {
212 timeZone =
' ' + spec.timeZone().name();
215 return KGlobal::locale()->formatTime( dt.toTimeSpec( spec ).time(), !shortfmt ) + timeZone;
217 return KGlobal::locale()->formatTime( dt.time(), !shortfmt );
223 if ( spec.isValid() ) {
226 if ( spec.timeZone() != KSystemTimeZones::local() ) {
227 timeZone =
' ' + spec.timeZone().name();
231 KGlobal::locale()->formatDate( dt.toTimeSpec( spec ).date(),
232 ( shortfmt ? KLocale::ShortDate : KLocale::LongDate ) ) +
236 KGlobal::locale()->formatDate( dt.date(),
237 ( shortfmt ? KLocale::ShortDate : KLocale::LongDate ) );
242 bool shortfmt,
const KDateTime::Spec &spec )
248 if ( spec.isValid() ) {
250 if ( spec.timeZone() != KSystemTimeZones::local() ) {
251 timeZone =
' ' + spec.timeZone().name();
254 return KGlobal::locale()->formatDateTime(
255 dt.toTimeSpec( spec ).dateTime(),
256 ( shortfmt ? KLocale::ShortDate : KLocale::LongDate ) ) + timeZone;
258 return KGlobal::locale()->formatDateTime(
260 ( shortfmt ? KLocale::ShortDate : KLocale::LongDate ) );
266 QString message =
"";
268 switch ( exception.
code() ) {
270 message = i18nc(
"@item",
"Load Error" );
273 message = i18nc(
"@item",
"Save Error" );
276 message = i18nc(
"@item",
"Parse Error in libical" );
279 message = i18nc(
"@item",
"Parse Error in the kcalcore library" );
282 message = i18nc(
"@item",
"No calendar component found." );
285 message = i18nc(
"@item",
"Expected iCalendar, got vCalendar format" );
288 message = i18nc(
"@item",
"iCalendar Version 2.0 detected." );
291 message = i18nc(
"@item",
"Expected iCalendar, got unknown format" );
294 message = i18nc(
"@item",
"Restriction violation" );
297 message = i18nc(
"@item",
"No writable resource found" );
299 case Exception::SaveErrorOpenFile:
300 Q_ASSERT( exception.
arguments().count() == 1 );
301 message = i18nc(
"@item",
"Error saving to '%1'.", exception.
arguments()[0] );
303 case Exception::SaveErrorSaveFile:
304 Q_ASSERT( exception.
arguments().count() == 1 );
305 message = i18nc(
"@item",
"Could not save '%1'", exception.
arguments()[0] );
307 case Exception::LibICalError:
308 message = i18nc(
"@item",
"libical error" );
310 case Exception::VersionPropertyMissing:
311 message = i18nc(
"@item",
"No VERSION property found" );
313 case Exception::ExpectedCalVersion2:
314 message = i18nc(
"@item",
"Expected iCalendar, got vCalendar format" );
316 case Exception::ExpectedCalVersion2Unknown:
317 message = i18nc(
"@item",
"Expected iCalendar, got unknown format" );
319 case Exception::ParseErrorNotIncidence:
320 message = i18nc(
"@item",
"object is not a freebusy, event, todo or journal" );
322 case Exception::ParseErrorEmptyMessage:
323 message = i18nc(
"@item",
"messageText is empty, unable to parse into a ScheduleMessage" );
325 case Exception::ParseErrorUnableToParse:
326 message = i18nc(
"@item",
"icalparser is unable to parse messageText into a ScheduleMessage" );
328 case Exception::ParseErrorMethodProperty:
329 message = i18nc(
"@item",
"message does not contain ICAL_METHOD_PROPERTY" );
344 return i18nc(
"@item this is a new scheduling message",
345 "New Scheduling Message" );
347 return i18nc(
"@item this is an update to an existing scheduling message",
348 "Updated Scheduling Message" );
350 return i18nc(
"@item obsolete status",
"Obsolete" );
352 return i18nc(
"@item this is a request for a new scheduling message",
353 "New Scheduling Message Request" );
355 return i18nc(
"@item this is a request for an update to an existing scheduling message",
356 "Updated Scheduling Message Request" );
358 return i18nc(
"@item unknown status",
"Unknown Status: %1",
int( status ) );
366 return i18nc(
"@item incidence access if for everyone",
"Public" );
368 return i18nc(
"@item incidence access is by owner only",
"Private" );
370 return i18nc(
"@item incidence access is by owner and a controlled group",
"Confidential" );
376 QStringList Stringify::secrecyList()