Commit 25a9a930 authored by Dirk Wilden's avatar Dirk Wilden

ask before removing items

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4086 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 460b52a8
......@@ -40,6 +40,7 @@
#include <ACG/QtWidgets/QtMaterialDialog.hh>
#include <QInputDialog>
#include <QMessageBox>
/// Slot for Remove action in ContextMenu
void DataControlPlugin::slotPopupRemove ( ) {
......@@ -50,6 +51,23 @@ void DataControlPlugin::slotPopupRemove ( ) {
// Get all selected rows
QModelIndexList indexList = selection->selectedRows();
QMessageBox msgBox;
msgBox.setText("Do you really want to remove the selected objects?");
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::No);
QString text;
for ( int i = 0 ; i < indexList.size() ; ++i) {
BaseObject* deleteItem = model_->getItem( indexList[i] );
text += deleteItem->name() + "\n";
}
msgBox.setDetailedText(text);
if ( msgBox.exec() == QMessageBox::No)
return;
for ( int i = 0 ; i < indexList.size() ; ++i) {
BaseObject* deleteItem = model_->getItem( indexList[i] );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment