author | zautrix <zautrix> | 2005-06-08 12:35:38 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-08 12:35:38 (UTC) |
commit | d9e240cf1a88f4213c9169e9168d01b669613312 (patch) (side-by-side diff) | |
tree | ed22cb872cc0f38625afe0f01036a48eb9b3edfa /korganizer/searchdialog.cpp | |
parent | 2448916479b456ca7c880427a80e8e32e95b2fba (diff) | |
download | kdepimpi-d9e240cf1a88f4213c9169e9168d01b669613312.zip kdepimpi-d9e240cf1a88f4213c9169e9168d01b669613312.tar.gz kdepimpi-d9e240cf1a88f4213c9169e9168d01b669613312.tar.bz2 |
better export
-rw-r--r-- | korganizer/searchdialog.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 59bf1a2..ef2fc1c 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp @@ -50,26 +50,31 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) { mCalendar = calendar; QFrame *topFrame = new QFrame( this ) ;//plainPage(); QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); // 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())); // Subjects to search // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), // topFrame); @@ -267,18 +272,18 @@ void SearchDialog::updateView() listView->addJournals(mMatchedJournals); } void SearchDialog::search(const QRegExp &re) { QPtrList<Event> events = mCalendar->events( mStartDate->date(), mEndDate->date(), false /*mInclusiveCheck->isChecked()*/ ); - - mMatchedEvents.clear(); + if ( !mAddItems->isChecked() ) + mMatchedEvents.clear(); if ( mSearchEvent->isChecked() ) { Event *ev; for(ev=events.first();ev;ev=events.next()) { if (mSummaryCheck->isChecked()) { #if QT_VERSION >= 0x030000 if (re.search(ev->summary()) != -1) #else if (re.match(ev->summary()) != -1) @@ -344,18 +349,19 @@ void SearchDialog::search(const QRegExp &re) mMatchedEvents.append(ev); break; } } } } } } - QPtrList<Todo> todos = mCalendar->todos( ); - mMatchedTodos.clear(); + QPtrList<Todo> todos = mCalendar->todos( ); + if ( !mAddItems->isChecked() ) + mMatchedTodos.clear(); if ( mSearchTodo->isChecked() ) { Todo *tod; for(tod=todos.first();tod;tod=todos.next()) { if (mSummaryCheck->isChecked()) { #if QT_VERSION >= 0x030000 if (re.search(tod->summary()) != -1) #else if (re.match(tod->summary()) != -1) @@ -412,17 +418,18 @@ void SearchDialog::search(const QRegExp &re) mMatchedTodos.append(tod); break; } } } } } } - mMatchedJournals.clear(); + if ( !mAddItems->isChecked() ) + mMatchedJournals.clear(); if (mSearchJournal->isChecked() ) { QPtrList<Journal> journals = mCalendar->journals( ); Journal* journ; for(journ=journals.first();journ;journ=journals.next()) { if ( journ->dtStart().date() <= mEndDate->date() &&journ->dtStart().date() >= mStartDate->date()) { #if QT_VERSION >= 0x030000 |