From ef9f9bf62b016ecf46ef76caf179369a5b2d809b Mon Sep 17 00:00:00 2001
From: tobias <thinkdifferent055@gmail.com>
Date: Sun, 25 Oct 2020 14:14:15 +0100
Subject: [PATCH] #164 - Add option to override max pages

---
 .../de/tobias/playpad/project/ProjectSettings.java   | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/PlayWallCore/src/main/java/de/tobias/playpad/project/ProjectSettings.java b/PlayWallCore/src/main/java/de/tobias/playpad/project/ProjectSettings.java
index 42efc1b2..0e4d089f 100644
--- a/PlayWallCore/src/main/java/de/tobias/playpad/project/ProjectSettings.java
+++ b/PlayWallCore/src/main/java/de/tobias/playpad/project/ProjectSettings.java
@@ -1,12 +1,22 @@
 package de.tobias.playpad.project;
 
 import de.thecodelabs.storage.settings.annotation.Key;
+import de.thecodelabs.utils.application.ApplicationUtils;
 
 import java.nio.file.Path;
 
 public class ProjectSettings {
 
-	public static final int MAX_PAGES = 10;
+	public static final int MAX_PAGES;
+
+	static {
+		Object maxPages = ApplicationUtils.getApplication().getUserDefaults().getData("MAX_PAGES");
+		if (maxPages != null) {
+			MAX_PAGES = Integer.parseInt(maxPages.toString());
+		} else {
+			MAX_PAGES = 10;
+		}
+	}
 
 	public static final int MAX_COLUMNS = 15;
 	public static final int MAX_ROWS = 15;
-- 
GitLab