SVN commit 1121522 by winterz: provide YesNo instead of a Warning messagebox when removing attachments. also list the attachments that will be removed. MERGE:trunk (show the list) M +19 -5 koeditorattachments.cpp --- branches/kdepim/enterprise/kdepim/korganizer/koeditorattachments.cpp #1121521:1121522 @@ -712,17 +712,31 @@ void KOEditorAttachments::slotRemove() { QValueList selected; + QStringList labels; for ( QIconViewItem *it = mAttachments->firstItem( ); it; it = it->nextItem( ) ) { if ( !it->isSelected() ) continue; selected << it; + + AttachmentListItem *attitem = static_cast(it); + KCal::Attachment *att = attitem->attachment(); + labels << att->label(); } - if ( selected.isEmpty() || KMessageBox::warningContinueCancel(this, - selected.count() == 1?i18n("This item will be permanently deleted."): - i18n("The selected items will be permanently deleted."), - i18n("KOrganizer Confirmation"),KStdGuiItem::del()) != KMessageBox::Continue ) + + if ( selected.isEmpty() ) { return; + } - for ( QValueList::iterator it( selected.begin() ), end( selected.end() ); it != end ; ++it ) { + QString labelsStr = labels.join( "
" ); + + if ( KMessageBox::questionYesNo( + this, + i18n( "Do you really want to remove these attachments?

%1" ).arg( labelsStr ), + i18n( "Remove Attachment?" ) ) != KMessageBox::Yes ) { + return; + } + + for ( QValueList::iterator it( selected.begin() ), end( selected.end() ); + it != end ; ++it ) { delete *it; } }