feat: prevent deletion of running instances

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2025-05-07 23:21:35 +03:00
parent 198fbd19cf
commit 4bad7e48c3
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318

View File

@ -1383,6 +1383,14 @@ void MainWindow::on_actionDeleteInstance_triggered()
return; return;
} }
if (m_selectedInstance->isRunning()) {
CustomMessageBox::selectable(this, tr("Cannot Delete Running Instance"),
tr("The selected instance is currently running and cannot be deleted. Please stop the instance before "
"attempting to delete it."),
QMessageBox::Warning, QMessageBox::Ok)
->exec();
return;
}
auto id = m_selectedInstance->id(); auto id = m_selectedInstance->id();
auto response = CustomMessageBox::selectable(this, tr("Confirm Deletion"), auto response = CustomMessageBox::selectable(this, tr("Confirm Deletion"),