| 90 | } |
| 91 | |
| 92 | void EditSimulationDialog::processForFolder() |
| 93 | { |
| 94 | if (ImGui::BeginChild("##Folder", {0, -scale(50.0f)})) { |
| 95 | AlienImGui::InputText(AlienImGui::InputTextParameters().textWidth(0).hint("Folder name"), _newName); |
| 96 | } |
| 97 | ImGui::EndChild(); |
| 98 | |
| 99 | AlienImGui::Separator(); |
| 100 | |
| 101 | ImGui::BeginDisabled(_newName.empty()); |
| 102 | if (AlienImGui::Button("OK")) { |
| 103 | if (NetworkValidationService::get().isStringValidForDatabase(_newName)) { |
| 104 | |
| 105 | EditNetworkResourceRequestData requestData; |
| 106 | for (auto const& rawTO : _rawTOs) { |
| 107 | auto nameWithoutOldFolder = rawTO->resourceName.substr(_origFolderName.size() + 1); |
| 108 | auto newName = NetworkResourceService::get().concatenateFolderName({_newName, nameWithoutOldFolder}, false); |
| 109 | requestData.entries.emplace_back(rawTO->id, newName, rawTO->description); |
| 110 | } |
| 111 | NetworkTransferController::get().onEdit(requestData); |
| 112 | close(); |
| 113 | } else { |
| 114 | showMessage("Error", Const::NotAllowedCharacters); |
| 115 | } |
| 116 | } |
| 117 | ImGui::EndDisabled(); |
| 118 | ImGui::SetItemDefaultFocus(); |
| 119 | |
| 120 | ImGui::SameLine(); |
| 121 | if (AlienImGui::Button("Cancel")) { |
| 122 | close(); |
| 123 | } |
| 124 | } |
nothing calls this directly
no test coverage detected