summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventviewer.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp112
1 files changed, 62 insertions, 50 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index f39b5e1..c8c2f28 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -279,4 +279,5 @@ void KOEventViewer::appendEvent(Event *event, int mode )
mCurrentIncidence = event;
bool shortDate = KOPrefs::instance()->mShortDateInViewer;
+ bool wideScreen = ( QApplication::desktop()->width() >= 640 );
topLevelWidget()->setCaption(i18n("Event Viewer"));
if ( mode == 0 ) {
@@ -332,6 +333,5 @@ void KOEventViewer::appendEvent(Event *event, int mode )
}
if (!event->location().isEmpty()) {
- addTag("b",i18n("Location: "));
- mText.append(deTag(event->location())+"<br>");
+ addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) );
mMailSubject += i18n(" at ") + event->location();
}
@@ -345,6 +345,10 @@ void KOEventViewer::appendEvent(Event *event, int mode )
next = event->getNextOccurence( QDateTime::currentDateTime() , &ok );
if ( ok ) {
- addTag("p",i18n("<b>Next recurrence is on:</b>") );
- addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate ));
+ if ( wideScreen ){
+ addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) );
+ } else {
+ addTag("p",i18n("<b>Next recurrence is on:</b>") );
+ addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate ));
+ }
mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true );
@@ -354,6 +358,10 @@ void KOEventViewer::appendEvent(Event *event, int mode )
nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last );
if ( last ) {
- addTag("p",i18n("<b>Last recurrence was on:</b>") );
- addTag("p", KGlobal::locale()->formatDate( nextd, shortDate ));
+ if ( wideScreen ){
+ addTag("p",i18n("<b>Last recurrence was on:</b>") +" " + KGlobal::locale()->formatDate( nextd, shortDate ));
+ } else{
+ addTag("p",i18n("<b>Last recurrence was on:</b>") );
+ addTag("p", KGlobal::locale()->formatDate( nextd, shortDate ));
+ }
}
}
@@ -368,14 +376,15 @@ void KOEventViewer::appendEvent(Event *event, int mode )
QDateTime t = alarm->time();
QString s =i18n("( %1 before )").arg( alarm->offsetText() );
- addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
- addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
+ if(wideScreen ){
+ addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
+ }else{
+ addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
+ addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
+ }
//addTag("p",s);
}
- addTag("b",i18n("Access: "));
- mText.append(event->secrecyStr()+"<br>");
+ addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr());
-
-
formatCategories(event);
@@ -384,19 +393,20 @@ void KOEventViewer::appendEvent(Event *event, int mode )
if ( KOPrefs::instance()->mEVshowCreated ) {
-#ifdef DESKTOP_VERSION
- addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
-#else
- addTag("p",i18n("<b>Created: ") +" </b>");
- addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
-#endif
+ if(wideScreen ){
+ addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
+ }else{
+ addTag("p",i18n("<b>Created: ") +" </b>");
+ addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
+ }
+
}
if ( KOPrefs::instance()->mEVshowChanged ) {
-#ifdef DESKTOP_VERSION
- addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) );
-#else
- addTag("p",i18n("<b>Last modified: ") +" </b>");
- addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
-#endif
+ if(wideScreen ){
+ addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) );
+ }else{
+ addTag("p",i18n("<b>Last modified: ") +" </b>");
+ addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
+ }
}
@@ -418,4 +428,5 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
topLevelWidget()->setCaption(i18n("Todo Viewer"));
bool shortDate = KOPrefs::instance()->mShortDateInViewer;
+ bool wideScreen = ( QApplication::desktop()->width() >= 640 );
if (mode == 0 )
addTag("h2",deTag(event->summary()));
@@ -470,7 +481,6 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
mMailSubject += i18n(" - " )+event->dtDueStr( true );
}
- if (!event->location().isEmpty()) {
- addTag("b",i18n("Location: "));
- mText.append(deTag(event->location())+"<br>");
+ if (!event->location().isEmpty()) {
+ addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) );
mMailSubject += i18n(" at ") + event->location();
}
@@ -481,12 +491,14 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
Alarm *alarm =event->alarms().first() ;
QDateTime t = alarm->time();
- QString s =i18n("( %1 before )").arg( alarm->offsetText() );
- addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
- addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
- //addTag("p",s);
+ QString s =i18n("( %1 before )").arg( alarm->offsetText() );
+ if ( wideScreen ) {
+ addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
+ } else {
+ addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
+ addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
+ }
}
- addTag("b",i18n("Access: "));
- mText.append(event->secrecyStr()+"<br>");
+ addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr());
formatCategories(event);
@@ -496,20 +508,21 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
if ( KOPrefs::instance()->mEVshowCreated ) {
-#ifdef DESKTOP_VERSION
- addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
-#else
- addTag("p",i18n("<b>Created: ") +" </b>");
- addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
-#endif
-
+ if(wideScreen ){
+
+ addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
+
+ } else {
+ addTag("p",i18n("<b>Created: ") +" </b>");
+ addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
+ }
}
if ( KOPrefs::instance()->mEVshowChanged ) {
-#ifdef DESKTOP_VERSION
- addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) );
-#else
- addTag("p",i18n("<b>Last modified: ") +" </b>");
- addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
-#endif
-
+ if(wideScreen ){
+ addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) );
+
+ } else {
+ addTag("p",i18n("<b>Last modified: ") +" </b>");
+ addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
+ }
}
if ( event->relatedTo() ) {
@@ -539,9 +552,8 @@ void KOEventViewer::formatCategories(Incidence *event)
if (!event->categoriesStr().isEmpty()) {
if (event->categories().count() == 1) {
- addTag("h3",i18n("Category"));
+ addTag("p","<b>"+i18n("Category") + ":</b> " + event->categoriesStrWithSpace());
} else {
- addTag("h3",i18n("Categories"));
+ addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ;
}
- addTag("p",event->categoriesStr());
}
}