From d9e240cf1a88f4213c9169e9168d01b669613312 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 08 Jun 2005 12:35:38 +0000 Subject: better export --- (limited to 'korganizer/kolistview.cpp') diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index be51694..5797d1b 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -283,11 +283,11 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 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 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), @@ -666,15 +666,42 @@ void KOListView::writeToFile( bool iCal ) QPtrList delSel ; QListViewItem *item = mListView->firstChild (); bool journal = iCal; // warn only for vCal + bool addSubTodos = false; + bool askSubTodos = true; while ( item ) { if ( item->isSelected() ) { if ( !journal ) 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(); } if ( !iCal && journal ) { -- cgit v0.9.0.2