| 3828 | } |
| 3829 | |
| 3830 | void MapEditorController::addMapPart() |
| 3831 | { |
| 3832 | bool accepted = false; |
| 3833 | QString name = QInputDialog::getText( |
| 3834 | window, |
| 3835 | tr("Add new part..."), |
| 3836 | tr("Enter the name of the map part:"), |
| 3837 | QLineEdit::Normal, |
| 3838 | QString(), |
| 3839 | &accepted ); |
| 3840 | if (accepted && !name.isEmpty()) |
| 3841 | { |
| 3842 | auto* part = new MapPart(name, map); |
| 3843 | map->addPart(part, map->getCurrentPartIndex() + 1); |
| 3844 | map->setCurrentPart(part); |
| 3845 | map->push(new MapPartUndoStep(map, MapPartUndoStep::RemoveMapPart, part)); |
| 3846 | } |
| 3847 | } |
| 3848 | |
| 3849 | void MapEditorController::removeMapPart() |
| 3850 | { |
nothing calls this directly
no test coverage detected