From 4b57adc8bbfd1c6efe5af64ea14035250a3d01cc Mon Sep 17 00:00:00 2001 From: LoveIsGrief Date: Thu, 5 Sep 2019 22:50:36 +0200 Subject: [PATCH 01/56] Write skeleton for PreferenceGroup This will contain the preferences related to the default container --- src/ui-preferences/PreferenceGroup.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/ui-preferences/PreferenceGroup.js diff --git a/src/ui-preferences/PreferenceGroup.js b/src/ui-preferences/PreferenceGroup.js new file mode 100644 index 0000000..2155133 --- /dev/null +++ b/src/ui-preferences/PreferenceGroup.js @@ -0,0 +1,24 @@ +/** + * Groups preferences together and displays them in a manner to reflect that fact. + */ +export default class PreferenceGroup { + + /** + * + * @param prefix {String} The prefix to be used for all keys of the preferences + * e.g windowOptions --> preferences will be windowOptions.optionX + * @param ui_title {String} The title to be shown to the user + * @param ui_description {String} The description to be shown to the user + * @param preferences {Preference[]} + * @param toggleable {boolean} Indicates whether the preferences + * can be toggled together + */ + constructor(prefix, ui_title, ui_description, preferences, toggleable=false){ + this.prefix = prefix; + this._ui_title = ui_title; + this._ui_description = ui_description; + this._preferences = preferences; + this._toggleable = toggleable; + this._enabled = false; + } +} From 9bd54f5743b881983a621380a0050cadc7225a93 Mon Sep 17 00:00:00 2001 From: LoveIsGrief Date: Fri, 6 Sep 2019 16:52:02 +0200 Subject: [PATCH 02/56] Rename variables to use camelCase --- src/ui-preferences/PreferenceGroup.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ui-preferences/PreferenceGroup.js b/src/ui-preferences/PreferenceGroup.js index 2155133..8dc4bf1 100644 --- a/src/ui-preferences/PreferenceGroup.js +++ b/src/ui-preferences/PreferenceGroup.js @@ -7,16 +7,16 @@ export default class PreferenceGroup { * * @param prefix {String} The prefix to be used for all keys of the preferences * e.g windowOptions --> preferences will be windowOptions.optionX - * @param ui_title {String} The title to be shown to the user - * @param ui_description {String} The description to be shown to the user + * @param uiTitle {String} The title to be shown to the user + * @param uiDescription {String} The description to be shown to the user * @param preferences {Preference[]} * @param toggleable {boolean} Indicates whether the preferences * can be toggled together */ - constructor(prefix, ui_title, ui_description, preferences, toggleable=false){ + constructor(prefix, uiTitle, uiDescription, preferences, toggleable=false){ this.prefix = prefix; - this._ui_title = ui_title; - this._ui_description = ui_description; + this._uiTitle = uiTitle; + this._uiDescription = uiDescription; this._preferences = preferences; this._toggleable = toggleable; this._enabled = false; From 6a556b3b4635dc6a1f65c17d9c5ccd25c177dc34 Mon Sep 17 00:00:00 2001 From: LoveIsGrief Date: Sat, 7 Sep 2019 01:13:23 +0200 Subject: [PATCH 03/56] First visible version of PreferenceGroup Saving hasn't been tested yet! Additionally the ChoicePreference and StringPreference have been added. A major change is the introduction of the preferences.json and building the preferences UI from a JSON. This allows us to separate the definition of preferences from the code as much as possible. A greater separation of concerns was further introduced using the raw-loader. It will mark a move away from using the