♻️ Refactor how preferences pages are set up

This commit is contained in:
Simon Schneegans
2022-01-22 20:24:38 +01:00
parent 55727f7c2b
commit a5f7769e58
10 changed files with 37 additions and 57 deletions
+5 -1
View File
@@ -65,10 +65,14 @@ var PreferencesDialog = class PreferencesDialog {
this.bindSwitch('destroy-dialogs');
// Add all other effect pages.
const stack = this._builder.get_object('main-stack');
ALL_EFFECTS.forEach(Effect => {
const [minMajor, minMinor] = Effect.getMinShellVersion();
if (utils.shellVersionIsAtLeast(minMajor, minMinor)) {
Effect.initPreferences(this);
const page = Effect.getPreferences(this);
if (page) {
stack.add_titled(page, Effect.getNick(), Effect.getLabel());
}
}
});