Manager: Add display name to new machine wizard
This commit is contained in:
@@ -355,12 +355,13 @@ VMManagerMain::newMachineWizard()
|
||||
const auto systemDir = QDir(vmm_path).path();
|
||||
#endif
|
||||
const auto existingConfiguration = wizard->field("existingConfiguration").toString();
|
||||
addNewSystem(newName, systemDir, existingConfiguration);
|
||||
const auto displayName = wizard->field("displayName").toString();
|
||||
addNewSystem(newName, systemDir, displayName, existingConfiguration);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
VMManagerMain::addNewSystem(const QString &name, const QString &dir, const QString &configFile)
|
||||
VMManagerMain::addNewSystem(const QString &name, const QString &dir, const QString &displayName, const QString &configFile)
|
||||
{
|
||||
const auto newSytemDirectory = QDir(QDir::cleanPath(dir + "/" + name));
|
||||
|
||||
@@ -423,6 +424,8 @@ VMManagerMain::addNewSystem(const QString &name, const QString &dir, const QStri
|
||||
delete new_system;
|
||||
return;
|
||||
}
|
||||
auto added_system = vm_model->getConfigObjectForIndex(created_object);
|
||||
added_system->setDisplayName(displayName);
|
||||
// Get the index of the newly-created system and select it
|
||||
const QModelIndex mapped_index = proxy_model->mapFromSource(created_object);
|
||||
ui->listView->setCurrentIndex(mapped_index);
|
||||
|
||||
Reference in New Issue
Block a user