Skip to content
Snippets Groups Projects
Commit 6724e7bf authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

Do not add new mapping on cancel input dialog

parent ea06d306
Branches
Tags
No related merge requests found
......@@ -337,18 +337,21 @@ public class MappingTabViewController extends ProfileSettingsTabViewController i
TextInputDialog dialog = new TextInputDialog();
dialog.initModality(Modality.WINDOW_MODAL);
dialog.initOwner(getContainingWindow());
dialog.setHeaderText("Umbenennen");
dialog.setHeaderText("Name");
dialog.setContentText("Geben Sie einen Namen für das Mapping Profil ein."); // TODO Localize
dialog.showAndWait().filter(s -> !s.isEmpty()).ifPresent(preset::setName);
dialog.showAndWait().filter(s -> !s.isEmpty()).ifPresent(name -> {
preset.setName(name);
final MappingCollection mappings = Profile.currentProfile().getMappings();
mappings.addMapping(preset);
mappingComboBox.getItems().add(preset);
mappingComboBox.getSelectionModel().select(preset);
final MappingCollection mappings = Profile.currentProfile().getMappings();
mappings.addMapping(preset);
mappingComboBox.getItems().add(preset);
mappingComboBox.getSelectionModel().select(preset);
if (mappings.count() > 1) {
mappingDeleteButton.setDisable(false);
}
});
if (mappings.count() > 1) {
mappingDeleteButton.setDisable(false);
}
}
@SuppressWarnings("Duplicates")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment