-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 2 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 35 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 25 | ||||
-rw-r--r-- | korganizer/searchdialog.h | 1 | ||||
-rw-r--r-- | libkcal/incidence.cpp | 11 | ||||
-rw-r--r-- | libkcal/incidence.h | 2 |
6 files changed, 61 insertions, 15 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 8f28234..7fa63f4 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1373,9 +1373,9 @@ | |||
1373 | { "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, | 1373 | { "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, |
1374 | { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, | 1374 | { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, |
1375 | { "Print complete list","Drucke komplette Liste" }, | 1375 | { "Print complete list","Drucke komplette Liste" }, |
1376 | { "Hide all selected","Verstecke Selektierte" }, | 1376 | { "Hide all selected","Verstecke Selektierte" }, |
1377 | { "","" }, | 1377 | { "Add items","hinzufügen" }, |
1378 | { "","" }, | 1378 | { "","" }, |
1379 | { "","" }, | 1379 | { "","" }, |
1380 | { "","" }, | 1380 | { "","" }, |
1381 | { "","" }, \ No newline at end of file | 1381 | { "","" }, \ No newline at end of file |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index be51694..5797d1b 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -282,13 +282,13 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
282 | SLOT(clearSelection()),true); | 282 | SLOT(clearSelection()),true); |
283 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 283 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
284 | i18n("Delete all selected"),this, | 284 | i18n("Delete all selected"),this, |
285 | SLOT(deleteAll()),true); | 285 | SLOT(deleteAll()),true); |
286 | #ifdef DESKTOP_VERSION | 286 | |
287 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 287 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
288 | i18n("Hide all selected"),this, | 288 | i18n("Hide all selected"),this, |
289 | SLOT(hideAll()),true); | 289 | SLOT(hideAll()),true); |
290 | #endif | 290 | |
291 | mPopupMenu->insertSeparator(); | 291 | mPopupMenu->insertSeparator(); |
292 | #ifdef DESKTOP_VERSION | 292 | #ifdef DESKTOP_VERSION |
293 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 293 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
294 | i18n("Print complete list"),this, | 294 | i18n("Print complete list"),this, |
@@ -665,17 +665,44 @@ void KOListView::writeToFile( bool iCal ) | |||
665 | int icount = 0; | 665 | int icount = 0; |
666 | QPtrList<Incidence> delSel ; | 666 | QPtrList<Incidence> delSel ; |
667 | QListViewItem *item = mListView->firstChild (); | 667 | QListViewItem *item = mListView->firstChild (); |
668 | bool journal = iCal; // warn only for vCal | 668 | bool journal = iCal; // warn only for vCal |
669 | bool addSubTodos = false; | ||
670 | bool askSubTodos = true; | ||
669 | while ( item ) { | 671 | while ( item ) { |
670 | if ( item->isSelected() ) { | 672 | if ( item->isSelected() ) { |
671 | if ( !journal ) | 673 | if ( !journal ) |
672 | if ( ((KOListViewItem *)item)->data()->typeID() == journalID ) | 674 | if ( ((KOListViewItem *)item)->data()->typeID() == journalID ) |
673 | journal = true; | 675 | journal = true; |
674 | delSel.append(((KOListViewItem *)item)->data()); | 676 | Incidence* inc = ((KOListViewItem *)item)->data(); |
677 | if ( addSubTodos ) { | ||
678 | if ( delSel.findRef( inc ) == -1 ) | ||
679 | delSel.append( inc ); | ||
680 | } else | ||
681 | delSel.append(inc); | ||
682 | if ( inc->typeID() == todoID ) { | ||
683 | Todo * todo = (Todo*) inc; | ||
684 | if ( todo->relations().count() ) { | ||
685 | if ( askSubTodos ) { | ||
686 | int result = KMessageBox::warningYesNoCancel(this, | ||
687 | i18n("A selected todo has subtodos!\nDo you want to export\nall subtodos of all\nselected todos as well?"), | ||
688 | i18n("Todo has subtodos"), | ||
689 | i18n("Yes"), | ||
690 | i18n("No")); | ||
691 | if ( result == KMessageBox::Cancel ) { | ||
692 | return; | ||
693 | } | ||
694 | if (result == KMessageBox::Yes) | ||
695 | addSubTodos = true; | ||
696 | askSubTodos = false; | ||
697 | } | ||
698 | if ( addSubTodos ) { | ||
699 | inc->addRelationsToList( &delSel ); | ||
700 | } | ||
701 | } | ||
702 | } | ||
675 | ++icount; | 703 | ++icount; |
676 | } | 704 | } |
677 | |||
678 | item = item->nextSibling(); | 705 | item = item->nextSibling(); |
679 | } | 706 | } |
680 | if ( !iCal && journal ) { | 707 | if ( !iCal && journal ) { |
681 | int result = KMessageBox::warningContinueCancel(this, | 708 | int result = KMessageBox::warningContinueCancel(this, |
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) | |||
54 | 54 | ||
55 | // Search expression | 55 | // Search expression |
56 | QHBoxLayout *subLayout = new QHBoxLayout(); | 56 | QHBoxLayout *subLayout = new QHBoxLayout(); |
57 | layout->addLayout(subLayout); | 57 | layout->addLayout(subLayout); |
58 | /* | ||
58 | searchLabel = new QLabel(topFrame); | 59 | searchLabel = new QLabel(topFrame); |
59 | searchLabel->setText(i18n("Search for:")); | 60 | searchLabel->setText(i18n("Search for:")); |
60 | subLayout->addWidget(searchLabel); | 61 | subLayout->addWidget(searchLabel); |
61 | 62 | */ | |
62 | searchEdit = new KLineEdit(topFrame); | 63 | QPushButton *OkButton = new QPushButton( i18n("Search for:"), topFrame ); |
63 | subLayout->addWidget(searchEdit); | ||
64 | QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame ); | ||
65 | //OkButton->setDefault( true ); | 64 | //OkButton->setDefault( true ); |
66 | connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); | 65 | connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); |
67 | subLayout->addWidget(OkButton); | 66 | subLayout->addWidget(OkButton); |
67 | searchEdit = new KLineEdit(topFrame); | ||
68 | subLayout->addWidget(searchEdit); | ||
69 | |||
70 | mAddItems = new QCheckBox(i18n("Add items"),topFrame); | ||
71 | subLayout->addWidget(mAddItems); | ||
72 | |||
68 | searchEdit->setText("*"); // Find all events by default | 73 | searchEdit->setText("*"); // Find all events by default |
69 | searchEdit->setFocus(); | 74 | searchEdit->setFocus(); |
70 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); | 75 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); |
71 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); | 76 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); |
@@ -271,10 +276,10 @@ void SearchDialog::search(const QRegExp &re) | |||
271 | { | 276 | { |
272 | QPtrList<Event> events = mCalendar->events( mStartDate->date(), | 277 | QPtrList<Event> events = mCalendar->events( mStartDate->date(), |
273 | mEndDate->date(), | 278 | mEndDate->date(), |
274 | false /*mInclusiveCheck->isChecked()*/ ); | 279 | false /*mInclusiveCheck->isChecked()*/ ); |
275 | 280 | if ( !mAddItems->isChecked() ) | |
276 | mMatchedEvents.clear(); | 281 | mMatchedEvents.clear(); |
277 | if ( mSearchEvent->isChecked() ) { | 282 | if ( mSearchEvent->isChecked() ) { |
278 | Event *ev; | 283 | Event *ev; |
279 | for(ev=events.first();ev;ev=events.next()) { | 284 | for(ev=events.first();ev;ev=events.next()) { |
280 | if (mSummaryCheck->isChecked()) { | 285 | if (mSummaryCheck->isChecked()) { |
@@ -348,10 +353,11 @@ void SearchDialog::search(const QRegExp &re) | |||
348 | } | 353 | } |
349 | } | 354 | } |
350 | } | 355 | } |
351 | } | 356 | } |
352 | QPtrList<Todo> todos = mCalendar->todos( ); | 357 | QPtrList<Todo> todos = mCalendar->todos( ); |
353 | mMatchedTodos.clear(); | 358 | if ( !mAddItems->isChecked() ) |
359 | mMatchedTodos.clear(); | ||
354 | if ( mSearchTodo->isChecked() ) { | 360 | if ( mSearchTodo->isChecked() ) { |
355 | Todo *tod; | 361 | Todo *tod; |
356 | for(tod=todos.first();tod;tod=todos.next()) { | 362 | for(tod=todos.first();tod;tod=todos.next()) { |
357 | if (mSummaryCheck->isChecked()) { | 363 | if (mSummaryCheck->isChecked()) { |
@@ -416,9 +422,10 @@ void SearchDialog::search(const QRegExp &re) | |||
416 | } | 422 | } |
417 | } | 423 | } |
418 | } | 424 | } |
419 | } | 425 | } |
420 | mMatchedJournals.clear(); | 426 | if ( !mAddItems->isChecked() ) |
427 | mMatchedJournals.clear(); | ||
421 | if (mSearchJournal->isChecked() ) { | 428 | if (mSearchJournal->isChecked() ) { |
422 | QPtrList<Journal> journals = mCalendar->journals( ); | 429 | QPtrList<Journal> journals = mCalendar->journals( ); |
423 | Journal* journ; | 430 | Journal* journ; |
424 | 431 | ||
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h index 4559d20..11ad2f0 100644 --- a/korganizer/searchdialog.h +++ b/korganizer/searchdialog.h | |||
@@ -88,8 +88,9 @@ class SearchDialog : public QVBox | |||
88 | QCheckBox *mSearchTodo; | 88 | QCheckBox *mSearchTodo; |
89 | QCheckBox *mSearchJournal; | 89 | QCheckBox *mSearchJournal; |
90 | QCheckBox *mSearchAName; | 90 | QCheckBox *mSearchAName; |
91 | QCheckBox *mSearchAEmail; | 91 | QCheckBox *mSearchAEmail; |
92 | QCheckBox *mAddItems; | ||
92 | void keyPressEvent ( QKeyEvent *e) ; | 93 | void keyPressEvent ( QKeyEvent *e) ; |
93 | }; | 94 | }; |
94 | 95 | ||
95 | #endif | 96 | #endif |
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index f446197..4382416 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -449,8 +449,19 @@ QPtrList<Incidence> Incidence::relations() const | |||
449 | { | 449 | { |
450 | return mRelations; | 450 | return mRelations; |
451 | } | 451 | } |
452 | 452 | ||
453 | void Incidence::addRelationsToList(QPtrList<Incidence> *rel) | ||
454 | { | ||
455 | Incidence* inc; | ||
456 | QPtrList<Incidence> Relations = relations(); | ||
457 | for (inc=Relations.first();inc;inc=Relations.next()) { | ||
458 | inc->addRelationsToList( rel ); | ||
459 | } | ||
460 | if ( rel->findRef( this ) == -1 ) | ||
461 | rel->append( this ); | ||
462 | } | ||
463 | |||
453 | void Incidence::addRelation(Incidence *event) | 464 | void Incidence::addRelation(Incidence *event) |
454 | { | 465 | { |
455 | if( mRelations.findRef( event ) == -1 ) { | 466 | if( mRelations.findRef( event ) == -1 ) { |
456 | mRelations.append(event); | 467 | mRelations.append(event); |
diff --git a/libkcal/incidence.h b/libkcal/incidence.h index aa51e84..fc97ce9 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h | |||
@@ -112,9 +112,9 @@ class Incidence : public IncidenceBase | |||
112 | virtual bool accept(Visitor &) { return false; } | 112 | virtual bool accept(Visitor &) { return false; } |
113 | 113 | ||
114 | virtual Incidence *clone() = 0; | 114 | virtual Incidence *clone() = 0; |
115 | virtual void cloneRelations( Incidence * ); | 115 | virtual void cloneRelations( Incidence * ); |
116 | 116 | void addRelationsToList(QPtrList<Incidence> *rel); | |
117 | virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0; | 117 | virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0; |
118 | void setReadOnly( bool ); | 118 | void setReadOnly( bool ); |
119 | 119 | ||
120 | /** | 120 | /** |