diff options
Diffstat (limited to 'archiveview.cpp')
-rw-r--r-- | archiveview.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/archiveview.cpp b/archiveview.cpp index 4d9e370..96bf01b 100644 --- a/archiveview.cpp +++ b/archiveview.cpp @@ -185,6 +185,18 @@ void ArchiveTree::rename(){ } } +void ArchiveTree::remove(){ + QModelIndex idx = currentIndex(); + QModelIndex realIdx = mProxy->mapToSource(idx); + QString warningMsg = QString("Really remove %1?").arg(idx.data().toString()); + int retval = QMessageBox::warning(this, tr("Question"), warningMsg, QMessageBox::Yes | QMessageBox::No); + if(retval == QMessageBox::Yes){ + if(!mModel->removeNode(realIdx)){ + impossible(); + } + } +} + void ArchiveTree::impossible(const QString msg){ QMessageBox::critical(this, tr("Error"), msg); } |