summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2004-12-04 22:01:08 (UTC)
committer zautrix <zautrix>2004-12-04 22:01:08 (UTC)
commit9c7f3267a1d7db2dbc3bd6384e75cf8ffea1c3df (patch) (side-by-side diff)
tree0b1707f003049d6c86b001d87e2c3e2525ac471e /korganizer
parent33a7e96870517ccf4b1daf5bfcbac4755ee535b4 (diff)
downloadkdepimpi-9c7f3267a1d7db2dbc3bd6384e75cf8ffea1c3df.zip
kdepimpi-9c7f3267a1d7db2dbc3bd6384e75cf8ffea1c3df.tar.gz
kdepimpi-9c7f3267a1d7db2dbc3bd6384e75cf8ffea1c3df.tar.bz2
translation fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kowhatsnextview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 3801ed4..5f14bfa 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -55,385 +55,385 @@ void WhatsNextTextBrowser::setSource(const QString& n)
} else {
QTextBrowser::setSource(n);
}
}
KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent,
const char *name)
: KOrg::BaseView(calendar, parent, name)
{
// mDateLabel =
// new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this);
// mDateLabel->setMargin(2);
// mDateLabel->setAlignment(AlignCenter);
setFont( KOPrefs::instance()->mWhatsNextFont );
mView = new WhatsNextTextBrowser(this);
connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &)));
QStyleSheet* stsh = mView->styleSheet();
QStyleSheetItem * style ;
style = stsh->item ("h2" );
if ( style ) {
style->setMargin(QStyleSheetItem::MarginAll,0);
}
style = stsh->item ("h3" );
if ( style ) {
style->setMargin(QStyleSheetItem::MarginAll,0);
}
mEventViewer = 0;
QBoxLayout *topLayout = new QVBoxLayout(this);
// topLayout->addWidget(mDateLabel);
topLayout->addWidget(mView);
mTimer = new QTimer( this );
connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView()));
connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
}
KOWhatsNextView::~KOWhatsNextView()
{
}
int KOWhatsNextView::maxDatesHint()
{
return 0;
}
int KOWhatsNextView::currentDateCount()
{
return 0;
}
QPtrList<Incidence> KOWhatsNextView::selectedIncidences()
{
QPtrList<Incidence> eventList;
return eventList;
}
void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd,
const QDate &td)
{
#ifndef KORG_NOPRINTER
calPrinter->preview(CalPrinter::Day, fd, td);
#endif
}
void KOWhatsNextView::updateConfig()
{
setFont( KOPrefs::instance()->mWhatsNextFont );
updateView();
}
void KOWhatsNextView::showEvent ( QShowEvent * e )
{
//qDebug("KOWhatsNextView::showEvent ");
restartTimer();
QWidget::showEvent ( e );
}
void KOWhatsNextView::hideEvent ( QHideEvent * e)
{
//qDebug(" KOWhatsNextView::hideEvent");
mTimer->stop();
QWidget::hideEvent ( e );
}
void KOWhatsNextView::restartTimer()
{
//qDebug("KOWhatsNextView::restartTimer() ");
mTimer->start( 300000 );
//mTimer->start( 5000 );
}
void KOWhatsNextView::updateView()
{
if ( mTimer->isActive() )
restartTimer();
//qDebug("KOWhatsNextView::updateView() ");
// mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate()));
KIconLoader kil("korganizer");
QString ipath;// = new QString();
// kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath);
//<big><big><strong>" + date + "</strong></big></big>\n";
mText = "<table width=\"100%\">\n";
//mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
#ifdef DESKTOP_VERSION
mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>";
#else
mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
#endif
// mText += "<img src=\"";
// mText += ipath;
// mText += "\">";
mEventDate = QDate::currentDate();
#ifdef DESKTOP_VERSION
mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>";
#else
mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>";
#endif
mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>";
int iii;
mTodos.clear();
QPtrList<Event> events;
QPtrList<Todo> todos = calendar()->todos();
Todo * todo;
//mText += "<h2>" + i18n("Events: ") + "</h2>\n";
int daysToShow = KOPrefs::instance()->mWhatsNextDays ;
bool itemAdded = false;
for ( iii = 0; iii < daysToShow; ++iii ) {
QString date;
itemAdded = false;
events = calendar()->events( mEventDate, true );
if ( iii == 0 ) { // today !!!
todo = todos.first();
while(todo) {
if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() < mEventDate ) {
if ( ! itemAdded ) {
appendDay ( iii, mEventDate );
//itemAdded = true;
} //bool reply=false, bool notRed = true, bool appendTable = false);
appendEvent(todo, false, false, !itemAdded );
itemAdded = true;
}
todo = todos.next();
}
}
if (events.count() > 0) {
// mText += "<p></p>";
// kil.loadIcon("month",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
// mText += "<h2>";
//mText += " <img src=\"";
//mText += ipath;
//mText += "\">";
if ( ! itemAdded ) {
appendDay ( iii, mEventDate );
}
// for first day (iii == 0)
// we may have syncevents, or events in the past, which maybe should not be diaplayed
// for that reason we cannot append <table> in appendDay () for iii == 0
// we must append it in the first successful call of appendEvent()
Event *ev = events.first();
while(ev) {
//qDebug("+++++event append %s", ev->summary().latin1());
if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) {
if ( appendEvent(ev, false , iii!= 0,!itemAdded ) )
itemAdded = true;
}
ev = events.next();
}
//mText += "</table>\n";
}
todo = todos.first();
while(todo) {
if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() == mEventDate ) {
if ( ! itemAdded ) {
appendDay ( iii, mEventDate );
//itemAdded = true;
}
appendEvent(todo, false , iii!= 0,!itemAdded);
itemAdded = true;
}
todo = todos.next();
}
if ( !itemAdded && iii == 0 ) {
// appendDay ( iii, mEventDate );
//mText += "<table>";
// mText += "<b><font color=\"#000080\"><em>"+i18n("No event, nothing to do.") +"</em></font></b>\n";
- mText += "<h3 align=\"center\"><font color=\"#008000\"><em>"+i18n("No event, nothing to do. ") +"</em></font></h3>\n";
+ mText += "<h3 align=\"center\"><font color=\"#008000\"><em>"+i18n("No event, nothing to do.") +"</em></font></h3>\n";
//mText +="</table>";
}
if ( itemAdded )
mText += "</table>\n";
mEventDate = mEventDate.addDays( 1 );
}
int topmostPrios = KOPrefs::instance()->mWhatsNextPrios;
if (todos.count() > 0 && topmostPrios > 0 ) {
// kil.loadIcon("todo",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
// mText += "<h2>";
//<img src=\"";
// mText += ipath;
// mText += "\">";
// mText += i18n("Overdue To-Do:") + "</h2>\n";
//mText += "<ul>\n";
bool gotone = false;
int priority = 1;
int priosFound = 0;
#ifdef DESKTOP_VERSION
mText +="<p></p>";
#endif
mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n";
mText += "<ul>\n";
while (!gotone && priority<6) {
todo = todos.first();
while(todo) {
if (!todo->isCompleted() && (todo->priority() == priority) ) {
if ( appendTodo(todo) )
gotone = true;
}
todo = todos.next();
}
if ( gotone ) {
gotone = false;
++priosFound;
if ( priosFound == topmostPrios )
break;
}
priority++;
// kdDebug() << "adding the todos..." << endl;
}
mText += "</ul>\n";
}
int replys = 0;
events = calendar()->events(QDate::currentDate(), QDate(2975,12,6));
if (events.count() > 0) {
Event *ev = events.first();
while(ev) {
Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
if (me!=0) {
if (me->status()==Attendee::NeedsAction && me->RSVP()) {
if (replys == 0) {
mText += "<p></p>";
// kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
//mText += "<h2>";
//<img src=\"";
// mText += ipath;
// mText += "\">";
//mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n";
mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n";
mText += "<table>\n";
}
replys++;
appendEvent(ev,true);
}
}
ev = events.next();
}
}
todos = calendar()->todos();
if (todos.count() > 0) {
Todo *to = todos.first();
while(to) {
if ( !to->isCompleted() ){
Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
if (me!=0) {
if (me->status()==Attendee::NeedsAction && me->RSVP()) {
if (replys == 0) {
mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n";
mText += "<table>\n";
}
replys++;
appendEvent(to, true);
}
}
}
to = todos.next();
}
}
if (replys > 0 ) mText += "</table>\n";
mText += "</td></tr>\n</table>\n";
mView->setText(mText);
mView->setFocus();
// QPixmap bPix = SmallIcon( "back" );
// qDebug("xxxxxxxxxxxxxxxxxxxxx ");
// QWidget* test = new QWidget();
// test->setBackgroundMode(FixedPixmap );
// test->setBackgroundPixmap ( bPix );
// test->resize( 300, 400 );
// test->show();
// mView->setBackgroundMode(FixedPixmap );
// mView->setBackgroundPixmap ( bPix );
// qDebug("%s ",mText.latin1());
}
void KOWhatsNextView::appendDay( int i, QDate eventDate )
{
QString date;
QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer);
if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) {
if ( i == 0 ) {
//mText += "<table>\n";
return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>";
}
else if ( i == 1 )
date = "<em><font color=\"#000080\">" + day + "</font></em>" ;
else date = "<em><font color=\"#000080\">" + day + "</font></em>";
mText += "<h2>" + date + "</h2>\n";
//mText += "<big><big><strong>" + date + "</strong></big></big>\n";
mText += "<table>\n";
} else {
if ( i == 0 ) {
//mText += "<table>\n";
return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>";
}
#ifdef DESKTOP_VERSION
else if ( i == 1 ) {
date = "<h2><em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em></h2>" ;
}
else date = "<h2><em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em></h2>";
#else
else if ( i == 1 ) {
date = "<em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em>" ;
}
else date = "<em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em>";
#endif
mText += "<h2>" + date + "</h2>\n";
//mText += "<big><big><strong>" + date + "</strong></big></big>\n";
mText += "<table>\n";
}
}
void KOWhatsNextView::showDates(const QDate &, const QDate &)
{
updateView();
}
void KOWhatsNextView::showEvents(QPtrList<Event>)
{
}
void KOWhatsNextView::changeEventDisplay(Event *, int action)
{
switch(action) {
case KOGlobals::EVENTADDED:
updateView();
break;
case KOGlobals::EVENTEDITED:
updateView();
break;
case KOGlobals::EVENTDELETED:
updateView();
break;
default:
updateView();
kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl;
}
}
bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable )
{
if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") )
return false;
QDateTime cdt = QDateTime::currentDateTime();
QDateTime noc;
QString tempText;
if ( appendTable && !notRed ) {
tempText = "<table>";