author | zautrix <zautrix> | 2004-10-27 13:36:25 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-27 13:36:25 (UTC) |
commit | e099c37ac90e95c5a3110941aaae2be229bccb8e (patch) (side-by-side diff) | |
tree | dad2ae54474767c4c5797e1780c4a3fee8c132e5 | |
parent | 2f3396d84d2f3c92e1e0e420d677892c1f9c0778 (diff) | |
download | kdepimpi-e099c37ac90e95c5a3110941aaae2be229bccb8e.zip kdepimpi-e099c37ac90e95c5a3110941aaae2be229bccb8e.tar.gz kdepimpi-e099c37ac90e95c5a3110941aaae2be229bccb8e.tar.bz2 |
wn view enhancements
-rw-r--r-- | kalarmd/simplealarmdaemonapplet.cpp | 1 | ||||
-rw-r--r-- | kalarmd/simplealarmdaemonapplet.h | 1 | ||||
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 18 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 3 | ||||
-rw-r--r-- | korganizer/koprefs.h | 1 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 38 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 79 |
7 files changed, 78 insertions, 63 deletions
diff --git a/kalarmd/simplealarmdaemonapplet.cpp b/kalarmd/simplealarmdaemonapplet.cpp index 7e8125d..94d8428 100644 --- a/kalarmd/simplealarmdaemonapplet.cpp +++ b/kalarmd/simplealarmdaemonapplet.cpp @@ -16,4 +16,5 @@ SimpleAlarmDaemonApplet::~SimpleAlarmDaemonApplet() { delete mApplet; + mApplet = 0; } diff --git a/kalarmd/simplealarmdaemonapplet.h b/kalarmd/simplealarmdaemonapplet.h index a4cbee4..1787bf3 100644 --- a/kalarmd/simplealarmdaemonapplet.h +++ b/kalarmd/simplealarmdaemonapplet.h @@ -5,5 +5,4 @@ class SimpleAlarmDaemonImpl; -class ScreenshotApplet; class SimpleAlarmDaemonApplet : public TaskbarAppletInterface diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index 4ff6861..50c4605 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp @@ -49,5 +49,5 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) { mAlarmDialog = new AlarmDialog( 0 ); - mPopUp = new QPopupMenu( 0 ); + mPopUp = new QPopupMenu( this ); mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) ); mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) ); @@ -63,10 +63,10 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) mPopUp->insertSeparator(); mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) ); - mTimerPopUp = new QPopupMenu( mPopUp ); + mTimerPopUp = new QPopupMenu( this ); - mBeepPopUp = new QPopupMenu( mPopUp ); - mSoundPopUp = new QPopupMenu( mBeepPopUp ); - mPausePopUp = new QPopupMenu( mBeepPopUp ); - QPopupMenu* savePopUp = new QPopupMenu( mBeepPopUp ); + mBeepPopUp = new QPopupMenu( this ); + mSoundPopUp = new QPopupMenu( this ); + mPausePopUp = new QPopupMenu( this ); + QPopupMenu* savePopUp = new QPopupMenu( this ); savePopUp->insertItem( "Save", 0 ); savePopUp->insertItem( "Load", 1 ); @@ -82,5 +82,5 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) mPausePopUp->insertItem( " 5 min", 300 ); mPausePopUp->insertItem( "10 min", 600 ); - mSuspendPopUp = new QPopupMenu( mBeepPopUp ); + mSuspendPopUp = new QPopupMenu( this ); mSuspendPopUp->insertItem( "Off", 0 ); mSuspendPopUp->insertItem( " 1x", 1 ); @@ -143,5 +143,5 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl() { - delete mPopUp; + //delete mPopUp; delete mAlarmDialog; } @@ -565,5 +565,5 @@ void SimpleAlarmDaemonImpl::newMail() void SimpleAlarmDaemonImpl::showAdd() { - QCopEnvelope e("QPE/Application/kapi", " "); + QCopEnvelope e("QPE/Application/kapi", "raise()"); } void SimpleAlarmDaemonImpl::ringSync() diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 8dca3ae..1cdb2fb 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -230,5 +230,6 @@ KOPrefs::KOPrefs() : 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); diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 0656644..f2fe77a 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -233,4 +233,5 @@ class KOPrefs : public KPimPrefs bool mListViewMonthTimespan; bool mWNViewShowsParents; + bool mWNViewShowsPast; bool mWNViewShowLocation; bool mTodoViewShowsPercentage; diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 393e6e6..578c0e9 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -785,5 +785,5 @@ void KOPrefsDialog::setupViewsTab() - holidayColor = + holidayColor = addWidColor(i18n("Color for Sundays + category \"Holiday\""), &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); @@ -798,23 +798,31 @@ void KOPrefsDialog::setupViewsTab() 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 diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 0f0bf11..aa33588 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -358,5 +358,5 @@ void KOWhatsNextView::updateView() // mView->setBackgroundMode(FixedPixmap ); // mView->setBackgroundPixmap ( bPix ); - qDebug("%s ",mText.latin1()); + // qDebug("%s ",mText.latin1()); } @@ -437,4 +437,5 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) QDateTime cdt = QDateTime::currentDateTime(); QDateTime noc; + QString tempText; bool ok = true; if ( reply ) { @@ -443,11 +444,11 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) return; } - mText += "<tr><td><b>"; + tempText += "<tr><td><b>"; 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 { @@ -482,17 +483,20 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) dateText += event->dtEndTimeStr(); if ( notRed ) - mText += dateText; + tempText += dateText; else { - if ( end < cdt ) - mText += "<font color=\"#F00000\">" + dateText + "</font>"; + if ( end < cdt ) { + if ( !KOPrefs::instance()->mWNViewShowsPast ) + return; + tempText += "<font color=\"#F00000\">" + dateText + "</font>"; + } else if ( st < cdt ) - mText += "<font color=\"#008000\">" + dateText + "</font>"; + tempText += "<font color=\"#008000\">" + dateText + "</font>"; else - mText += dateText; + tempText += dateText; } } else { - mText += i18n("Allday:"); + tempText += i18n("Allday:"); } @@ -500,33 +504,33 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) } 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 +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; + // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; QString dfs = KGlobal::locale()->dateFormatShort(); KGlobal::locale()->setDateFormatShort("%d.%b"); - mText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; + tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; KGlobal::locale()->setDateFormatShort(dfs); } else { if (!ev->doesFloat() ) if( ( (Todo*)ev)->dtDue() < cdt ) { - mText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; + tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; } else - mText +=((Todo*)ev)->dtDueTimeStr(); + tempText +=((Todo*)ev)->dtDueTimeStr(); mTodos.append( ev ); } } } - mText += "</b></td><td>"; + tempText += "</b></td><td>"; bool needClose = false; if ( ev->cancelled() ) { - mText += "<font color=\"#F00000\">[c"; + tempText += "<font color=\"#F00000\">[c"; needClose =true; @@ -534,6 +538,6 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) if ( ev->isAlarmEnabled() ) { if ( !needClose) - mText +="["; - mText += "a"; + tempText +="["; + tempText += "a"; needClose =true; @@ -541,34 +545,35 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) 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 += "</font>"; - mText += "<a "; - if (ev->type()=="Event") mText += "href=\"event:"; - if (ev->type()=="Todo") mText += "href=\"todo:"; - mText += ev->uid() + "\">"; + tempText += "</font>"; + tempText += "<a "; + if (ev->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 += "</a>"; + tempText += i18n("-no summary-"); + tempText += "</a>"; 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 += "</td></tr>\n"; + tempText += " ["+ev->relatedTo()->summary() +"]"; + tempText += "</td></tr>\n"; + mText += tempText; } |