summaryrefslogtreecommitdiffabout
path: root/korganizer/searchdialog.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/searchdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/searchdialog.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 59bf1a2..ef2fc1c 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -54,18 +54,23 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
// Search expression
QHBoxLayout *subLayout = new QHBoxLayout();
layout->addLayout(subLayout);
+ /*
searchLabel = new QLabel(topFrame);
searchLabel->setText(i18n("Search for:"));
subLayout->addWidget(searchLabel);
-
- searchEdit = new KLineEdit(topFrame);
- subLayout->addWidget(searchEdit);
- QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame );
+ */
+ QPushButton *OkButton = new QPushButton( i18n("Search for:"), topFrame );
//OkButton->setDefault( true );
connect(OkButton,SIGNAL(clicked()),SLOT(doSearch()));
subLayout->addWidget(OkButton);
+ searchEdit = new KLineEdit(topFrame);
+ subLayout->addWidget(searchEdit);
+
+ mAddItems = new QCheckBox(i18n("Add items"),topFrame);
+ subLayout->addWidget(mAddItems);
+
searchEdit->setText("*"); // Find all events by default
searchEdit->setFocus();
connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & )));
connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch()));
@@ -271,9 +276,9 @@ void SearchDialog::search(const QRegExp &re)
{
QPtrList<Event> events = mCalendar->events( mStartDate->date(),
mEndDate->date(),
false /*mInclusiveCheck->isChecked()*/ );
-
+ if ( !mAddItems->isChecked() )
mMatchedEvents.clear();
if ( mSearchEvent->isChecked() ) {
Event *ev;
for(ev=events.first();ev;ev=events.next()) {
@@ -349,8 +354,9 @@ void SearchDialog::search(const QRegExp &re)
}
}
}
QPtrList<Todo> todos = mCalendar->todos( );
+ if ( !mAddItems->isChecked() )
mMatchedTodos.clear();
if ( mSearchTodo->isChecked() ) {
Todo *tod;
for(tod=todos.first();tod;tod=todos.next()) {
@@ -416,8 +422,9 @@ void SearchDialog::search(const QRegExp &re)
}
}
}
}
+ if ( !mAddItems->isChecked() )
mMatchedJournals.clear();
if (mSearchJournal->isChecked() ) {
QPtrList<Journal> journals = mCalendar->journals( );
Journal* journ;