X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=93caddd64a17ef6a715a3a7b4ad115aabc6f7f56;hp=9fe4a28bf5d2806a309b8d528b36bf1ce93cff0f;hb=e3395d9dd51f56240e4cb9509ccd403bf5f9e343;hpb=64561f92233e7105055714a9de3db8eead92dd44 diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 9fe4a28..93caddd 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1680,6 +1680,7 @@ public class Core implements IdentityListener, UpdateListener { try { configuration.getIntValue("Option/ConfigurationVersion").setValue(0); configuration.getIntValue("Option/InsertionDelay").setValue(options.getIntegerOption("InsertionDelay").getReal()); + configuration.getIntValue("Option/PostsPerPage").setValue(options.getIntegerOption("PostsPerPage").getReal()); configuration.getIntValue("Option/PositiveTrust").setValue(options.getIntegerOption("PositiveTrust").getReal()); configuration.getIntValue("Option/NegativeTrust").setValue(options.getIntegerOption("NegativeTrust").getReal()); configuration.getStringValue("Option/TrustComment").setValue(options.getStringOption("TrustComment").getReal()); @@ -1753,6 +1754,7 @@ public class Core implements IdentityListener, UpdateListener { } })); + options.addIntegerOption("PostsPerPage", new DefaultOption(25)); options.addIntegerOption("PositiveTrust", new DefaultOption(75)); options.addIntegerOption("NegativeTrust", new DefaultOption(-25)); options.addStringOption("TrustComment", new DefaultOption("Set from Sone Web Interface")); @@ -1772,6 +1774,7 @@ public class Core implements IdentityListener, UpdateListener { } options.getIntegerOption("InsertionDelay").set(configuration.getIntValue("Option/InsertionDelay").getValue(null)); + options.getIntegerOption("PostsPerPage").set(configuration.getIntValue("Option/PostsPerPage").getValue(null)); options.getIntegerOption("PositiveTrust").set(configuration.getIntValue("Option/PositiveTrust").getValue(null)); options.getIntegerOption("NegativeTrust").set(configuration.getIntValue("Option/NegativeTrust").getValue(null)); options.getStringOption("TrustComment").set(configuration.getStringValue("Option/TrustComment").getValue(null)); @@ -1961,6 +1964,27 @@ public class Core implements IdentityListener, UpdateListener { } /** + * Returns the number of posts to show per page. + * + * @return The number of posts to show per page + */ + public int getPostsPerPage() { + return options.getIntegerOption("PostsPerPage").get(); + } + + /** + * Sets the number of posts to show per page. + * + * @param postsPerPage + * The number of posts to show per page + * @return This preferences object + */ + public Preferences setPostsPerPage(Integer postsPerPage) { + options.getIntegerOption("PostsPerPage").set(postsPerPage); + return this; + } + + /** * Returns the positive trust. * * @return The positive trust