From 9b1aaa9c36cce079de36e49a34303031790444a5 Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Wed, 22 May 2019 04:56:36 +0300 Subject: [PATCH] Preferences and Setting hotfix. Few bugs left. --- src/main/java/konogonka/AppPreferences.java | 2 +- src/main/java/konogonka/Settings/SettingsController.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/konogonka/AppPreferences.java b/src/main/java/konogonka/AppPreferences.java index 77cade0..9f467e9 100644 --- a/src/main/java/konogonka/AppPreferences.java +++ b/src/main/java/konogonka/AppPreferences.java @@ -52,7 +52,7 @@ public class AppPreferences { - public int getTitleKeysCount(){ + public int getTitleKeysCount(){ // TODO: do the same for other multi-keys and single return preferences.getInt("title_keys_count", 0); } // Since we don't want to store title keys that are no longer in use, we have to (try to) remove them. diff --git a/src/main/java/konogonka/Settings/SettingsController.java b/src/main/java/konogonka/Settings/SettingsController.java index 1faf364..044aa46 100644 --- a/src/main/java/konogonka/Settings/SettingsController.java +++ b/src/main/java/konogonka/Settings/SettingsController.java @@ -36,7 +36,7 @@ public class SettingsController implements Initializable { public void initialize(URL url, ResourceBundle resourceBundle) { ListSelectorKAEKAppController.initSelector(32, "key_area_key_application_"); ListSelectorKAEKOceanController.initSelector(32, "key_area_key_ocean_"); - ListSelectorKAEKSysController.initSelector(32, "key_area_key_sys_"); + ListSelectorKAEKSysController.initSelector(32, "key_area_key_system_"); ListSelectorTitleKeysController.initSelector(32, null); // 32 required LinkedHashMap preparedPairsMapInit = new LinkedHashMap<>(); @@ -60,7 +60,7 @@ public class SettingsController implements Initializable { preparedPairsMapInit.clear(); cnt = 0; while (!(kaekApp = AppPreferences.getInstance().getSystemKey(cnt)).isEmpty()){ - preparedPairsMapInit.put("key_area_key_sys_"+String.format("%02d", cnt), kaekApp); + preparedPairsMapInit.put("key_area_key_system_"+String.format("%02d", cnt), kaekApp); cnt++; } ListSelectorKAEKSysController.setList(preparedPairsMapInit); @@ -195,7 +195,7 @@ public class SettingsController implements Initializable { String[] kaekSysKeySet = ListSelectorKAEKSysController.getList(); if (kaekSysKeySet != null){ for (int i = 0; i < kaekSysKeySet.length; i++) - AppPreferences.getInstance().setOceanKey(i, kaekSysKeySet[i].split("\\s=\\s", 2)[1]); + AppPreferences.getInstance().setSystemKey(i, kaekSysKeySet[i].split("\\s=\\s", 2)[1]); } String[] titleKeysSet = ListSelectorTitleKeysController.getList();