summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-18 09:21:06 (UTC)
committer zautrix <zautrix>2005-06-18 09:21:06 (UTC)
commit252c62bffc34f2c71002c71abea480807fa1455a (patch) (side-by-side diff)
treeed84520d75b534bb6013fc45fdb93f1a39e6e2e0
parent39112dfe29d2108d54d37f25dc57dcd9299f1f93 (diff)
downloadkdepimpi-252c62bffc34f2c71002c71abea480807fa1455a.zip
kdepimpi-252c62bffc34f2c71002c71abea480807fa1455a.tar.gz
kdepimpi-252c62bffc34f2c71002c71abea480807fa1455a.tar.bz2
fixx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp11
-rw-r--r--korganizer/kolistview.h2
-rw-r--r--korganizer/searchdialog.cpp1
3 files changed, 14 insertions, 0 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 0b2f9a4..22d9ac0 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -242,16 +242,17 @@ bool ListItemVisitor::visit(Journal * j)
}
KOListView::KOListView(Calendar *calendar, QWidget *parent,
const char *name)
: KOEventView(calendar, parent, name)
{
mActiveItem = 0;
+ mForceShowCompletedTodos = false;
mListView = new KOListViewListView(this);
mListView->addColumn(i18n("Summary"));
mListView->addColumn(i18n("Start Date"));
mListView->addColumn(i18n("Start Time"));
mListView->addColumn(i18n("End Date"));
mListView->addColumn(i18n("End Time"));
mListView->addColumn(i18n("Alarm")); // alarm set?
mListView->addColumn(i18n("Recurs")); // recurs?
@@ -1042,21 +1043,31 @@ void KOListView::addJournals(QPtrList<Journal> eventList)
for(ev = eventList.first(); ev; ev = eventList.next()) {
addIncidence(ev);
}
if ( !mListView->currentItem() ){
updateView();
}
}
+void KOListView::showCompletedTodos()
+{
+ mForceShowCompletedTodos = true;
+}
void KOListView::addIncidence(Incidence *incidence)
{
if ( mUidDict.find( incidence->uid() ) ) return;
// mListView->setFont ( KOPrefs::instance()->mListViewFont );
+ if ( incidence->typeID() == todoID ) {
+ if ( ! mForceShowCompletedTodos ) {
+ if ( !KOPrefs::instance()->mShowCompletedTodo && ((Todo*)incidence)->isCompleted() )
+ return;
+ }
+ }
mUidDict.insert( incidence->uid(), incidence );
KOListViewItem *item = new KOListViewItem( incidence, mListView );
ListItemVisitor v(item, mStartDate );
if (incidence->accept(v)) {
return;
}
else delete item;
}
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index d384af0..bcef0f0 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -258,16 +258,17 @@ class KOListView : public KOEventView
void readSettings(KConfig *config, QString setting = "KOListView Layout");
void writeSettings(KConfig *config, QString setting = "KOListView Layout");
void updateList();
void clearList();
void setStartDate(const QDate &start);
int count();
QString getWhatsThisText(QPoint p);
QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false );
+ void showCompletedTodos();
signals:
void signalNewEvent();
void beamIncidenceList(QPtrList<Incidence>);
public slots:
void hideAll();
void printList();
void resetFocus();
@@ -303,16 +304,17 @@ class KOListView : public KOEventView
protected:
void writeToFile( bool iCal );
void addEvents(QPtrList<Event> eventList);
void addIncidence(Incidence *);
KOListViewItem *getItemForEvent(Incidence *event);
private:
+ bool mForceShowCompletedTodos;
QPopupMenu* mCalPopup;
KOListViewWhatsThis *mKOListViewWhatsThis;
KOListViewListView *mListView;
KOEventPopupMenu *mPopupMenu;
KOListViewItem *mActiveItem;
QDict<Incidence> mUidDict;
QDate mStartDate;
void keyPressEvent ( QKeyEvent * ) ;
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index bba49f0..a8de297 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -133,16 +133,17 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
mEndDate->setDate(QDate::currentDate().addDays(365));
rangeLayout->addWidget(mEndDate);
QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget );
rangeLayout->addWidget( (QWidget*)wt );
layout->addWidget(rangeWidget);
// Results list view
listView = new KOListView(mCalendar,topFrame);
layout->addWidget(listView);
+ listView->showCompletedTodos();
//layout->setStretchFactor( listView, 333 );
//listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) );
//listView->setMaximumHeight( 50 );
listView->readSettings(KOGlobals::config(),"SearchListView Layout");
connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList()));
setCaption( i18n("KO/Pi Find: "));
#ifdef DESKTOP_VERSION