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

Fix page duplication on cancel, change page rename dialog header

parent a4da4b9b
No related branches found
No related tags found
No related merge requests found
...@@ -111,7 +111,11 @@ public class DesktopPageEditButtonView extends HBox implements EventHandler<Acti ...@@ -111,7 +111,11 @@ public class DesktopPageEditButtonView extends HBox implements EventHandler<Acti
Page clone = page.clone(); Page clone = page.clone();
// Show Rename dialog for cloned page // Show Rename dialog for cloned page
showPageNameDialog(clone); boolean success = showPageNameDialog(clone);
if (!success) {
return;
}
Project project = page.getProject(); Project project = page.getProject();
project.addPage(clone); project.addPage(clone);
...@@ -146,7 +150,7 @@ public class DesktopPageEditButtonView extends HBox implements EventHandler<Acti ...@@ -146,7 +150,7 @@ public class DesktopPageEditButtonView extends HBox implements EventHandler<Acti
} }
} }
private void showPageNameDialog(Page page) { private boolean showPageNameDialog(Page page) {
TextInputDialog dialog = new TextInputDialog(page.getName()); TextInputDialog dialog = new TextInputDialog(page.getName());
dialog.setHeaderText(Localization.getString(Strings.UI_Dialog_Page_Name_Header)); dialog.setHeaderText(Localization.getString(Strings.UI_Dialog_Page_Name_Header));
...@@ -158,6 +162,7 @@ public class DesktopPageEditButtonView extends HBox implements EventHandler<Acti ...@@ -158,6 +162,7 @@ public class DesktopPageEditButtonView extends HBox implements EventHandler<Acti
Optional<String> result = dialog.showAndWait(); Optional<String> result = dialog.showAndWait();
result.ifPresent(page::setName); result.ifPresent(page::setName);
return result.isPresent();
} }
} }
...@@ -231,7 +231,7 @@ Search.Alert.NoMatches=Keine Treffer gefunden. ...@@ -231,7 +231,7 @@ Search.Alert.NoMatches=Keine Treffer gefunden.
UI.Dialog.Page.Delete.Header=Seite l\u00F6schen UI.Dialog.Page.Delete.Header=Seite l\u00F6schen
UI.Dialog.Page.Delete.Content=M\u00F6chten Sie die Seite unwiederbringlich l\u00F6schen? UI.Dialog.Page.Delete.Content=M\u00F6chten Sie die Seite unwiederbringlich l\u00F6schen?
# UI - Dialog - Name - Delete # UI - Dialog - Name - Delete
UI.Dialog.Page.Name.Header=Seite umbenennen UI.Dialog.Page.Name.Header=Name der Seite
UI.Dialog.Page.Name.Content=Geben Sie einen Namen f\u00FCr die Seite ein. UI.Dialog.Page.Name.Content=Geben Sie einen Namen f\u00FCr die Seite ein.
# UI - Dialog - PathMatch # UI - Dialog - PathMatch
UI.Dialog.PathMatch.Status={} fehlende Pfade UI.Dialog.PathMatch.Status={} fehlende Pfade
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment