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

#170 - Show error message on page duplicate when page limit is reached

parent 3f8f4984
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ import de.tobias.playpad.PlayPadMain; ...@@ -8,6 +8,7 @@ import de.tobias.playpad.PlayPadMain;
import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.PlayPadPlugin;
import de.tobias.playpad.Strings; import de.tobias.playpad.Strings;
import de.tobias.playpad.project.Project; import de.tobias.playpad.project.Project;
import de.tobias.playpad.project.ProjectSettings;
import de.tobias.playpad.project.page.Page; import de.tobias.playpad.project.page.Page;
import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.playpad.viewcontroller.main.IMainViewController;
import de.tobias.playpad.viewcontroller.main.MenuToolbarViewController; import de.tobias.playpad.viewcontroller.main.MenuToolbarViewController;
...@@ -104,7 +105,12 @@ public class DesktopPageEditButtonView extends HBox { ...@@ -104,7 +105,12 @@ public class DesktopPageEditButtonView extends HBox {
} }
Project project = page.getProject(); Project project = page.getProject();
project.addPage(clone); boolean added = project.addPage(clone);
if (!added) {
mainViewController.showErrorMessage(Localization.getString(Strings.ERROR_PROJECT_PAGE_COUNT, ProjectSettings.MAX_PAGES));
return;
}
controller.initPageButtons(); controller.initPageButtons();
mainViewController.showPage(clone); mainViewController.showPage(clone);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment