Manager: Reset the details area to initial state manually

instead of re-creating the widget when no machines are present
This commit is contained in:
Alexander Babikov
2026-01-13 03:27:16 +05:00
parent 30c77b69ac
commit d7d2dffe7b
3 changed files with 66 additions and 11 deletions

View File

@@ -734,12 +734,9 @@ VMManagerMain::deleteSystem(VMManagerSystem *sysconfig)
delete sysconfig;
if (vm_model->rowCount(QModelIndex()) <= 0) {
selected_sysconfig = new VMManagerSystem();
/* no machines left - get rid of the last machine's leftovers */
ui->detailsArea->layout()->removeWidget(vm_details);
delete vm_details;
vm_details = new VMManagerDetails();
ui->detailsArea->layout()->addWidget(vm_details);
selected_sysconfig = new VMManagerSystem();
vm_details->reset();
/* tell the mainwindow to disable the toolbar buttons */
emit selectionOrStateChanged(nullptr);
}