You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently adding a new configuration setting is very tedious, it should be as simple as creating an object, similar to the way it works on desktop, in a single place, something like:
publicstaticfinalConfigurationSettingGUI_TOS_ACCEPTED =
newConfigurationSetting(
Boolean.class, // class of the value"frostwire.prefs.gui.tos_accepted", // keyfalse); // default valuepublicstaticfinalConfigurationSettingGUI_INTERSTITIAL_ON_EXIT_THRESHOLD =
newConfigurationSetting(
Float.class,
"frostwire.prefs.gui.interstitial_on_exit_threshold",
0.35f);
...
// Then you use those likeConfigurationSetting.GUI_TOS_ACCEPTED.value(); // gets the valueConfigurationSetting.GUI_TOS_ACCEPTED.set(true); // updates the setting valueConfigurationSetting.GUI_TOS_ACCEPTED.reset(); // resets to default value
and the whole thing gets taken care of, with backwards compatibility in one spot.
CC: @votaguz in case you want to do something different this weekend (and you have the time), this would be a useful refactor and a good study case to truly learn Java Generics.
Currently adding a new configuration setting is very tedious, it should be as simple as creating an object, similar to the way it works on desktop, in a single place, something like:
and the whole thing gets taken care of, with backwards compatibility in one spot.
CC: @votaguz in case you want to do something different this weekend (and you have the time), this would be a useful refactor and a good study case to truly learn Java Generics.
To work on this ticket read:
Constants.java
ConfigurationManager.java
ConfigurationDefaults.java
The text was updated successfully, but these errors were encountered: