[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/kdepim/enterprise/kdepim/korganizer
From: Allen Winter <winter () kde ! org>
Date: 2010-05-01 15:19:45
Message-ID: 20100501151945.C5353AC8AA () svn ! kde ! org
[Download RAW message or body]
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<QIconViewItem*> selected;
+ QStringList labels;
for ( QIconViewItem *it = mAttachments->firstItem( ); it; it = it->nextItem( ) ) \
{ if ( !it->isSelected() ) continue;
selected << it;
+
+ AttachmentListItem *attitem = static_cast<AttachmentListItem*>(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<QIconViewItem*>::iterator it( selected.begin() ), end( \
selected.end() ); it != end ; ++it ) { + QString labelsStr = labels.join( "<br>" );
+
+ if ( KMessageBox::questionYesNo(
+ this,
+ i18n( "<qt>Do you really want to remove these attachments?<p>%1</qt>" \
).arg( labelsStr ), + i18n( "Remove Attachment?" ) ) != KMessageBox::Yes ) {
+ return;
+ }
+
+ for ( QValueList<QIconViewItem*>::iterator it( selected.begin() ), end( \
selected.end() ); + it != end ; ++it ) {
delete *it;
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic