MCPcopy Create free account
hub / github.com/chrxh/alien / processForFolder

Method processForFolder

source/Gui/EditSimulationDialog.cpp:92–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void 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}

Callers

nothing calls this directly

Calls 7

scaleFunction · 0.85
InputTextParametersClass · 0.85
showMessageFunction · 0.85
sizeMethod · 0.80
concatenateFolderNameMethod · 0.80
onEditMethod · 0.80

Tested by

no test coverage detected