| 51 | } |
| 52 | |
| 53 | void EditSimulationDialog::processForLeaf() |
| 54 | { |
| 55 | auto& rawTO = _treeTO->getLeaf().rawTO; |
| 56 | std::string resourceTypeString = rawTO->resourceType == NetworkResourceType_Simulation ? "simulation" : "genome"; |
| 57 | |
| 58 | AlienImGui::InputText(AlienImGui::InputTextParameters().textWidth(0).hint("Name"), _newName); |
| 59 | |
| 60 | AlienImGui::Separator(); |
| 61 | |
| 62 | ImGui::PushID("description"); |
| 63 | AlienImGui::InputTextMultiline( |
| 64 | AlienImGui::InputTextMultilineParameters() |
| 65 | .hint("Description (optional)") |
| 66 | .textWidth(0) |
| 67 | .height(ImGui::GetContentRegionAvail().y - scale(50.0f)), |
| 68 | _newDescription); |
| 69 | ImGui::PopID(); |
| 70 | |
| 71 | AlienImGui::Separator(); |
| 72 | |
| 73 | ImGui::BeginDisabled(_newName.empty()); |
| 74 | if (AlienImGui::Button("OK")) { |
| 75 | if (NetworkValidationService::get().isStringValidForDatabase(_newName) && NetworkValidationService::get().isStringValidForDatabase(_newDescription)) { |
| 76 | EditNetworkResourceRequestData::Entry entry{.resourceId = rawTO->id, .newName = _newName, .newDescription = _newDescription}; |
| 77 | NetworkTransferController::get().onEdit(EditNetworkResourceRequestData{.entries = std::vector{entry}}); |
| 78 | close(); |
| 79 | } else { |
| 80 | showMessage("Error", Const::NotAllowedCharacters); |
| 81 | } |
| 82 | } |
| 83 | ImGui::EndDisabled(); |
| 84 | ImGui::SetItemDefaultFocus(); |
| 85 | |
| 86 | ImGui::SameLine(); |
| 87 | if (AlienImGui::Button("Cancel")) { |
| 88 | close(); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | void EditSimulationDialog::processForFolder() |
| 93 | { |
nothing calls this directly
no test coverage detected