From e099c37ac90e95c5a3110941aaae2be229bccb8e Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 27 Oct 2004 13:36:25 +0000 Subject: wn view enhancements --- (limited to 'korganizer') diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 8dca3ae..1cdb2fb 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -229,7 +229,8 @@ KOPrefs::KOPrefs() : addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); - addItemBool("WNViewShowsParents",&mWNViewShowsParents,true); + addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; + addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 0656644..f2fe77a 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -232,6 +232,7 @@ class KOPrefs : public KPimPrefs bool mUseHighlightLightColor; bool mListViewMonthTimespan; bool mWNViewShowsParents; + bool mWNViewShowsPast; bool mWNViewShowLocation; bool mTodoViewShowsPercentage; bool mTodoViewUsesCatColors; diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 393e6e6..578c0e9 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -784,7 +784,7 @@ void KOPrefsDialog::setupViewsTab() topLayout->addWidget(holidayColor->button(),ii++,1); - holidayColor = + holidayColor = addWidColor(i18n("Color for Sundays + category \"Holiday\""), &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); topLayout->addWidget(holidayColor->label(),ii,0); @@ -797,25 +797,33 @@ void KOPrefsDialog::setupViewsTab() topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); ii = 0; - KPrefsDialogWidBool *passwdk = - addWidBool(i18n("Show parent To-Do's in What's Next view"), - &(KOPrefs::instance()->mWNViewShowsParents),topFrame); - topLayout->addWidget(passwdk->checkBox(), ii++,0); + KPrefsDialogWidBool *passwdk = + + addWidBool(i18n("Show events, that are done in \nWhat's Next view"), + &(KOPrefs::instance()->mWNViewShowsPast),topFrame); + topLayout->addWidget(passwdk->checkBox(), ii++,0); + passwdk = + addWidBool(i18n("Show parent To-Do's in What's Next view"), + &(KOPrefs::instance()->mWNViewShowsParents),topFrame); + topLayout->addWidget(passwdk->checkBox(), ii++,0); passwdk = - addWidBool(i18n("Show location in What's Next view"), - &(KOPrefs::instance()->mWNViewShowLocation),topFrame); - topLayout->addWidget(passwdk->checkBox(), ii++,0); + addWidBool(i18n("Show location in What's Next view"), + &(KOPrefs::instance()->mWNViewShowLocation),topFrame); + topLayout->addWidget(passwdk->checkBox(), ii++,0); passwdk = - addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), - &(KOPrefs::instance()->mShowSyncEvents),topFrame); - topLayout->addWidget(passwdk->checkBox(), ii++,0); - passwdk = - addWidBool(i18n("Use short date in \nWhat's Next/Event view"), - &(KOPrefs::instance()->mShortDateInViewer),topFrame); - topLayout->addMultiCellWidget(passwdk->checkBox(), ii,ii,0,1); + addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), + &(KOPrefs::instance()->mShowSyncEvents),topFrame); + topLayout->addWidget(passwdk->checkBox(), ii++,0); + passwdk = + addWidBool(i18n("Use short date in \nWhat's Next/Event view"), + &(KOPrefs::instance()->mShortDateInViewer),topFrame); + topLayout->addWidget(passwdk->checkBox(), ii++,0); + + + // *********************** Todo View topFrame = addPage(i18n("Todo View"),0,0); diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 0f0bf11..aa33588 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -357,7 +357,7 @@ void KOWhatsNextView::updateView() // test->show(); // mView->setBackgroundMode(FixedPixmap ); // mView->setBackgroundPixmap ( bPix ); - qDebug("%s ",mText.latin1()); + // qDebug("%s ",mText.latin1()); } void KOWhatsNextView::appendDay( int i, QDate eventDate ) @@ -436,19 +436,20 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) return; QDateTime cdt = QDateTime::currentDateTime(); QDateTime noc; + QString tempText; bool ok = true; if ( reply ) { noc = ev->getNextOccurence( cdt, &ok ); if (! ok && ev->type() == "Event") return; } - mText += ""; + tempText += ""; if (ev->type()=="Event") { if (reply) { if (!ev->doesFloat()) - mText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": "; + tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": "; else - mText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; + tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; } else { if (!ev->doesFloat()) { @@ -481,95 +482,99 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) else dateText += event->dtEndTimeStr(); if ( notRed ) - mText += dateText; + tempText += dateText; else { - if ( end < cdt ) - mText += "" + dateText + ""; + if ( end < cdt ) { + if ( !KOPrefs::instance()->mWNViewShowsPast ) + return; + tempText += "" + dateText + ""; + } else if ( st < cdt ) - mText += "" + dateText + ""; + tempText += "" + dateText + ""; else - mText += dateText; + tempText += dateText; } } else { - mText += i18n("Allday:"); + tempText += i18n("Allday:"); } } } else { mTodos.append( ev ); - mText += i18n("ToDo:"); + tempText += i18n("ToDo:"); if (reply) { - mText += " "; + tempText += " "; if ( noc != cdt ) { - mText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; + tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; } } else { if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) { - // mText +="" + i18n("O-due!") + ""; + // tempText +="" + i18n("O-due!") + ""; QString dfs = KGlobal::locale()->dateFormatShort(); KGlobal::locale()->setDateFormatShort("%d.%b"); - mText +="" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + ""; + tempText +="" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + ""; KGlobal::locale()->setDateFormatShort(dfs); } else { if (!ev->doesFloat() ) if( ( (Todo*)ev)->dtDue() < cdt ) { - mText +="" + ((Todo*)ev)->dtDueTimeStr() + ""; + tempText +="" + ((Todo*)ev)->dtDueTimeStr() + ""; } else - mText +=((Todo*)ev)->dtDueTimeStr(); + tempText +=((Todo*)ev)->dtDueTimeStr(); mTodos.append( ev ); } } } - mText += ""; + tempText += ""; bool needClose = false; if ( ev->cancelled() ) { - mText += "[c"; + tempText += "[c"; needClose =true; } if ( ev->isAlarmEnabled() ) { if ( !needClose) - mText +="["; - mText += "a"; + tempText +="["; + tempText += "a"; needClose =true; } if ( ev->description().length() > 0 ) { if ( !needClose) - mText +="["; - mText += "i"; + tempText +="["; + tempText += "i"; needClose =true; } if ( ev->recurrence()->doesRecur() ) { if ( !needClose) - mText +="["; - mText += "r"; + tempText +="["; + tempText += "r"; needClose =true; } if ( needClose ) { - mText += "] "; + tempText += "] "; } if ( ev->cancelled() ) - mText += ""; - mText += "type()=="Event") mText += "href=\"event:"; - if (ev->type()=="Todo") mText += "href=\"todo:"; - mText += ev->uid() + "\">"; + tempText += ""; + tempText += "type()=="Event") tempText += "href=\"event:"; + if (ev->type()=="Todo") tempText += "href=\"todo:"; + tempText += ev->uid() + "\">"; if ( ev->summary().length() > 0 ) - mText += ev->summary(); + tempText += ev->summary(); else - mText += i18n("-no summary-"); - mText += ""; + tempText += i18n("-no summary-"); + tempText += ""; if ( KOPrefs::instance()->mWNViewShowLocation ) if ( !ev->location().isEmpty() ) - mText += " ("+ev->location() +")"; + tempText += " ("+ev->location() +")"; if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) - mText += " ["+ev->relatedTo()->summary() +"]"; - mText += "\n"; + tempText += " ["+ev->relatedTo()->summary() +"]"; + tempText += "\n"; + mText += tempText; } bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) -- cgit v0.9.0.2