diff --git a/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/settings/Settings.java b/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/settings/Settings.java index 2f7c860977208cd1618065afef7a548b9c2670f4..69f737fb72114dce51dc5ff6df573431a67b7bc8 100644 --- a/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/settings/Settings.java +++ b/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/settings/Settings.java @@ -45,6 +45,8 @@ public class Settings private Boolean migrationDeclined; + private Boolean orderTransactionNameSuggestionsAlphabetically; + public Settings() { // empty @@ -73,6 +75,7 @@ public class Settings defaultSettings.setInstalledVersionCode(0); defaultSettings.setWhatsNewShownForCurrentVersion(false); defaultSettings.setMigrationDeclined(false); + defaultSettings.setOrderTransactionNameSuggestionsAlphabetically(true); return defaultSettings; } @@ -301,6 +304,16 @@ public class Settings this.migrationDeclined = migrationDeclined; } + public Boolean getOrderTransactionNameSuggestionsAlphabetically() + { + return orderTransactionNameSuggestionsAlphabetically; + } + + public void setOrderTransactionNameSuggestionsAlphabetically(Boolean orderTransactionNameSuggestionsAlphabetically) + { + this.orderTransactionNameSuggestionsAlphabetically = orderTransactionNameSuggestionsAlphabetically; + } + @Override public String toString() { @@ -326,6 +339,7 @@ public class Settings ", installedVersionCode=" + installedVersionCode + ", whatsNewShownForCurrentVersion=" + whatsNewShownForCurrentVersion + ", migrationDeclined=" + migrationDeclined + + ", orderTransactionNameSuggestionsAlphabetically=" + orderTransactionNameSuggestionsAlphabetically + '}'; } } \ No newline at end of file diff --git a/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/settings/SettingsService.java b/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/settings/SettingsService.java index e06c91a8366244dc05cd30a900867e26b054fb65..7f68c4f9e3df2673fddef4a1f5228e8c12fdd231 100644 --- a/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/settings/SettingsService.java +++ b/BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/settings/SettingsService.java @@ -112,6 +112,10 @@ public class SettingsService { settings.setMigrationDeclined(defaultSettings.getMigrationDeclined()); } + if(settings.getOrderTransactionNameSuggestionsAlphabetically() == null) + { + settings.setOrderTransactionNameSuggestionsAlphabetically(defaultSettings.getOrderTransactionNameSuggestionsAlphabetically()); + } settingsRepository.save(settings); }