summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kolistview.cpp35
-rw-r--r--korganizer/searchdialog.cpp17
-rw-r--r--korganizer/searchdialog.h1
3 files changed, 44 insertions, 9 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index be51694..5797d1b 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -285,3 +285,3 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
SLOT(deleteAll()),true);
-#ifdef DESKTOP_VERSION
+
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
@@ -289,3 +289,3 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
SLOT(hideAll()),true);
-#endif
+
mPopupMenu->insertSeparator();
@@ -668,2 +668,4 @@ void KOListView::writeToFile( bool iCal )
bool journal = iCal; // warn only for vCal
+ bool addSubTodos = false;
+ bool askSubTodos = true;
while ( item ) {
@@ -673,6 +675,31 @@ void KOListView::writeToFile( bool iCal )
journal = true;
- delSel.append(((KOListViewItem *)item)->data());
+ Incidence* inc = ((KOListViewItem *)item)->data();
+ if ( addSubTodos ) {
+ if ( delSel.findRef( inc ) == -1 )
+ delSel.append( inc );
+ } else
+ delSel.append(inc);
+ if ( inc->typeID() == todoID ) {
+ Todo * todo = (Todo*) inc;
+ if ( todo->relations().count() ) {
+ if ( askSubTodos ) {
+ int result = KMessageBox::warningYesNoCancel(this,
+ i18n("A selected todo has subtodos!\nDo you want to export\nall subtodos of all\nselected todos as well?"),
+ i18n("Todo has subtodos"),
+ i18n("Yes"),
+ i18n("No"));
+ if ( result == KMessageBox::Cancel ) {
+ return;
+ }
+ if (result == KMessageBox::Yes)
+ addSubTodos = true;
+ askSubTodos = false;
+ }
+ if ( addSubTodos ) {
+ inc->addRelationsToList( &delSel );
+ }
+ }
+ }
++icount;
}
-
item = item->nextSibling();
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 59bf1a2..ef2fc1c 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -57,2 +57,3 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
layout->addLayout(subLayout);
+ /*
searchLabel = new QLabel(topFrame);
@@ -60,6 +61,4 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
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 );
@@ -67,2 +66,8 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
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
@@ -274,3 +279,3 @@ void SearchDialog::search(const QRegExp &re)
false /*mInclusiveCheck->isChecked()*/ );
-
+ if ( !mAddItems->isChecked() )
mMatchedEvents.clear();
@@ -352,2 +357,3 @@ void SearchDialog::search(const QRegExp &re)
QPtrList<Todo> todos = mCalendar->todos( );
+ if ( !mAddItems->isChecked() )
mMatchedTodos.clear();
@@ -419,2 +425,3 @@ void SearchDialog::search(const QRegExp &re)
}
+ if ( !mAddItems->isChecked() )
mMatchedJournals.clear();
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h
index 4559d20..11ad2f0 100644
--- a/korganizer/searchdialog.h
+++ b/korganizer/searchdialog.h
@@ -91,2 +91,3 @@ class SearchDialog : public QVBox
QCheckBox *mSearchAEmail;
+ QCheckBox *mAddItems;
void keyPressEvent ( QKeyEvent *e) ;