summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt2
-rw-r--r--korganizer/kolistview.cpp35
-rw-r--r--korganizer/searchdialog.cpp17
-rw-r--r--korganizer/searchdialog.h1
-rw-r--r--libkcal/incidence.cpp11
-rw-r--r--libkcal/incidence.h2
6 files changed, 57 insertions, 11 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
@@ -1375,5 +1375,5 @@
{ "Print complete list","Drucke komplette Liste" },
{ "Hide all selected","Verstecke Selektierte" },
-{ "","" },
+{ "Add items","hinzufügen" },
{ "","" },
{ "","" },
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index be51694..5797d1b 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -284,9 +284,9 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
i18n("Delete all selected"),this,
SLOT(deleteAll()),true);
-#ifdef DESKTOP_VERSION
+
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
i18n("Hide all selected"),this,
SLOT(hideAll()),true);
-#endif
+
mPopupMenu->insertSeparator();
#ifdef DESKTOP_VERSION
@@ -667,4 +667,6 @@ void KOListView::writeToFile( bool iCal )
QListViewItem *item = mListView->firstChild ();
bool journal = iCal; // warn only for vCal
+ bool addSubTodos = false;
+ bool askSubTodos = true;
while ( item ) {
if ( item->isSelected() ) {
@@ -672,8 +674,33 @@ void KOListView::writeToFile( bool iCal )
if ( ((KOListViewItem *)item)->data()->typeID() == journalID )
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
@@ -56,14 +56,19 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
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();
@@ -273,5 +278,5 @@ void SearchDialog::search(const QRegExp &re)
mEndDate->date(),
false /*mInclusiveCheck->isChecked()*/ );
-
+ if ( !mAddItems->isChecked() )
mMatchedEvents.clear();
if ( mSearchEvent->isChecked() ) {
@@ -351,4 +356,5 @@ void SearchDialog::search(const QRegExp &re)
}
QPtrList<Todo> todos = mCalendar->todos( );
+ if ( !mAddItems->isChecked() )
mMatchedTodos.clear();
if ( mSearchTodo->isChecked() ) {
@@ -418,4 +424,5 @@ void SearchDialog::search(const QRegExp &re)
}
}
+ if ( !mAddItems->isChecked() )
mMatchedJournals.clear();
if (mSearchJournal->isChecked() ) {
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h
index 4559d20..11ad2f0 100644
--- a/korganizer/searchdialog.h
+++ b/korganizer/searchdialog.h
@@ -90,4 +90,5 @@ class SearchDialog : public QVBox
QCheckBox *mSearchAName;
QCheckBox *mSearchAEmail;
+ QCheckBox *mAddItems;
void keyPressEvent ( QKeyEvent *e) ;
};
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index f446197..4382416 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -451,4 +451,15 @@ QPtrList<Incidence> Incidence::relations() const
}
+void Incidence::addRelationsToList(QPtrList<Incidence> *rel)
+{
+ Incidence* inc;
+ QPtrList<Incidence> Relations = relations();
+ for (inc=Relations.first();inc;inc=Relations.next()) {
+ inc->addRelationsToList( rel );
+ }
+ if ( rel->findRef( this ) == -1 )
+ rel->append( this );
+}
+
void Incidence::addRelation(Incidence *event)
{
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index aa51e84..fc97ce9 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -114,5 +114,5 @@ class Incidence : public IncidenceBase
virtual Incidence *clone() = 0;
virtual void cloneRelations( Incidence * );
-
+ void addRelationsToList(QPtrList<Incidence> *rel);
virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0;
void setReadOnly( bool );